CruiseControl.NET parameter passing - cruisecontrol.net

I have a CruiseControl.NET ccnet.config file, which monitors two different projects in the same project scope. If one of them changes, it has to trigger a build. But I wanted to know which project has been changed among the two. I have to pass them as a commandline parameter. Is there any built-in property?

Splitting the project to two projects seems like the right thing to do.
Specifically, split to to projects and add a Project trigger for the DML project.
This way if the table scripts are to be changed, both projects will be triggered and if only some DML statement changes, only the second project will be triggered.
In case both projects have common trigger then i recommend using a synchronization queue.
<queue name="Q_Synchronizer" duplicates="UseFirst" />
<project name="project1_name" queue="Q_Synchronizer" queuePriority="1">project stuff...</project>
<project name="project2_name" queue="Q_Synchronizer" queuePriority="2">project stuff...</project>
HTH

Related

How to run an action / script after files all files are copied to target install dir?

Due to the buggy nature of InstallShield, it is incorrectly modifying my app.config files replacing <clear /> with <clear></clear>
After my app.config file is copied to install path, I want to run a custom action that can scan for all config files and do a standard find and replace.
I don't need code for the find and replace, what I want to know is how / where to put this custom action using Installshield?
Your best bet would be creating a deferred execution custom action and place it near the end of the execution sequence. This will guarantee it would run after the files have been installed.
In the 'Custom Actions and Sequences', Create a new custom action of the appropriate type (depending on your implementation of this replacement action). Set it's In-Script Execution to 'Deferred' and in the Sequence section have add it to the Install Exec Sequence, After ScheduleReboot.
The easiest way to modify config/ini files after deployment of files is the option of INI File Changes or Text File Changes under the System Configuration tab. You can mention the config file location and the replacement changes that you want to perform. Please refer this link.

Custom Build Action for sqlproj

I came across this article which will add a custom "Build Action" option to the properties window for csproj. However, I would like to have a custom Build Action for the objects in a database project. Is there something I can add to the .sqlproj file that can do something similar? Can I add a custom Build Action at all for SQL?
You can edit sqlproj file and add your own msbuild target to it. It'll be equal to post\pre-build action.
Edited:
.SQLProj file is actually MSBuild script file (if we are both talking about SSDT SQL Database project one :)). So you can open it in any text editor and add something like this:
<Target Name="PreBuildEvent" AfterTargets="PrepareForBuild">
<Exec WorkingDirectory="$(OutDir)" Command="calc.exe" />
</Target>
It'll be very close to the way how PreBuild command being executed to build process.
Check that PrepareForBuild target is being called during your build process or change it to any other you want. You can go further and extend your build process with any msbuild tasks you want.

SlowCheetah does not Process Transforms

I copied a web.config that already has show cheetah transforms defined from one project to another. The transforms show up in the new project just fine, and I can edit them. However, they are not being applied when I run the project.
How can I fix that?
The project itself must be configured to apply transforms.
To do that, in the new project:
Right-click web.config (or whichever file has the transforms)
Add Transform
This will setup the project to apply Slow Cheetah transforms, and will leave the copied / edited transforms in place.
This action may take a moment because the project is unloaded, modified, and re-loaded.

MonoDevelop: Any way to override resources / classes using projects?

Consider a solution has 2 projects: ProjectA and ProjectB (both are MonoTouch apps) and ProjectBase. ProjectBase contains the whole application, but Main.cs file (with the entry point) is located in ProjectA and ProjectB (which reference ProjectBase). This way, running any of A/B projects will boot up the application from ProjectBase.
Now, I want to override something for ProjectA only (it might be XIB file, image or a .NET class). Is there any way I can setup the solution so that the code and resources, produced by ProjectBase, are merged with the ones from ProjectA/ProjectB and the latter wins?
I found (probably a quirky and kinda-undefined-behavior-driven way) of overriding XIBs: I just put a XIB into ProjectA and ProjectB, name it the same as it was named in ProjectBase and them exclude it from ProjectBase. Although MonoDevelop compiles all items, it seems that the startup project's XIBs get priority, so that I see ProjectA-specific XIBs when I launch ProjectA and ProjectB-specific XIBs when I launch ProjectB. However, I am not sure it is the way it should behave, plus, from what I can see from build log, ALL projects get built yielding resources at the end.
P.S. I'm sorry if this has been asked previously, but I was not able to find the similar question on SO.
I was once trying to do this for a bunch of apps. I would have thought build order would be ProjectBase and then ProjectA, and the content copy system would be the same... Guess this means we are wrong.
You could do a few things.
A) Build your own program to copy resources which are marked for content. Would not be very hard, just need to read the .csproj files. XML parsing is easy enough in .NET. Run this program on post build. Would just have to be careful when doing builds such as to zip or to the device as I am not sure how it handles post-build events.
B) [This is what I did instead] If I expect to also make ProjectC, ProjectD ... ProjectN I instead made a program to generate my program... (Programception).
What it does, has ProjectBase, and ProjectTempalte. You enter your new project name into this program, say, "MyNewProject" and it will create the correct folder structure, write the correct csproj files, and update SLN file. ProjectTemplate has various placeholders in .csproj files like {PLACEHOLDER} which Programception would just go through and find/replace with my project name. Image files (and in your case XIB) are then only kept within ProjectA (B..C..N) unless I do not expect to try and override them in which case they would stay in ProjectBase. This is a lot easier with a XIBless application I would assume. I never use XIB's anyway.
Hope that helps!

Is there a way to reference the last build label of a project in CruiseControl.NET?

Is there a way to reference the last build label of a particular project in CC.NET? I have a project set to execute a task that needs to run only when Force Build is clicked, but the path of the working directory changes based on the build number of our main trunk.
Currently I have a workaround where we set an environment variable to the value of %ccnetlabel%, but this seems like a dirty way to do it, and I am curious to know if there is a way to refernce the build label of a project directly.
We are running CC.NET 1.4.4.49.
I found out that with 1.4.4.49 there is not a way to reference another project's build label. I got around this by adding the following XML to the project configuration:
<labeller type="stateFileLabeller">
<project>Other-Project-To-Take-Build-Number-From</project>
</labeller>
What had happened was that once I figured out that %ccNetLabel% was actually the correct way to go about this, I tried just using it in this new project (we use %ccNetLabel% elsewhere which works fine). However, without specifying the labeller tag, %ccNetLabel% causes CC.NET to throw an exception saying that '%' was not expected.

Resources