views:

92

answers:

2

Hello.

I have a CruiseControl.NET powered build server and an exec task that increments assembly version of the project before building it. I was wondering, was there a way (a CruiseControl.NET task I don't know about) to submit that modified file back to SVN?

I need it so when the setup projects are built manually (I am using msbuld so those aren't built continuously) all the build files will have the correct assembly versions on deployment. Oh and if someone knows how to build setup & deployment projects on a build server without Visual Studio installed, I'm dying to know!

EDIT: Thanks to Jonathan Stanton the update now works, however it creates another problem... The build server now loops (on change it updates assembly version and commits the file. This caouses the onModify trigger to fire so it updates assembly version and commits the file...).

What can I do so it won't loop? Can I add an update SVN task? Will that help?

A: 

This question may help.

I gave up on the setup and deployment projects because of the VS dependency.

devstuff
Rekreativc
I now use WiX to generate .msi setups. A couple of rough edges with VS integration but virtually painless.
devstuff
+1  A: 

The following task will commit back the a file in to the source repo.

<exec executable="svn.exe">          
    <buildArgs>commit -F <file you want to commit back> --username USER --password PASS --no-auth-cache --non-interactive --message 'CruiseControl.net build %CCNetLabel%'</buildArgs> 
    <buildTimeoutSeconds>10</buildTimeoutSeconds>
</exec> 

The following links may be of use:

I hope that this helps

Jonathan

EDIT

There is another way to do this and that is to allow CC.NET to set the build version in the DLL. There is a walkthrough on how to do this at Damir's Corner entitled Setting Up SVN and CC.NET for .NET Development

Jonathan Stanton
I am just wondering if this won't cause the build trigger again and thus create an infinite loop of incrementing and building the same project all over again?
Rekreativc
This indeed does loop the build server. A full build now happens every 5 minutes (With an increased version). What can I do so the task won't trigger CruiseControl.NET build?
Rekreativc
What is the file that you are committing? If it is the dll then could you create a new branch or new repo that contains just this file. You would then map that branch / repo to a new directory, have a task that copied the dll/file to that directory and then run the commit on that file.Your other projects would just then have to monitor that new branch/repo for that file.
Jonathan Stanton
I am commiting the assemblyversion.cs file on every project (that was modified)
Rekreativc
See edit above.
Jonathan Stanton
Rekreativc - Does the Damir's Corner blog help you at all?
Jonathan Stanton
You can configure a Filtered Source Control block to ignore certain files/extensions. This way the commit will not kick off another build. I've got an example at work but the documentation on the Thoughtworks site should point you in the right direction.
DilbertDave