views:

2098

answers:

3

While setting up CruiseControl, I added a buildpublisher block to the publisher tasks:

<buildpublisher>
  <sourceDir>C:\MyBuild\</sourceDir>
  <publishDir>C:\MyBuildPublished\</publishDir>
  <alwaysPublish>false</alwaysPublish>
</buildpublisher>

This works, but it copies the entire file contents of the build, I only want to copy the DLL's and .aspx pages, I don't need the source code to get published.

Does anyone know of a way to filter this, or do I need to setup a task to run a RoboCopy script instead?

+2  A: 

I set up a task to do this. I'm not aware of any way to make CruiseControl be that specific. I usually just chain a batch file to do the copy to the CC.net task.

DannySmurf
A: 

The default build publisher in CC.NET does not provide a way to do this. You have a few options:

  • Create your own build publisher with the desired functionality
  • Create a custom NAnt/MSBuild task
  • Use a scripting technology (RoboCopy, batch file, etc.) to create a script file and run an "Executable" task for CC.NET, or an "exec" task for NAnt/MSBuild
Scott Dorman
+1  A: 

I'm not sure with a web project, but for our winforms app, you can grab the TargetOutputs from the MSBuild task like so:

<MSBuild Projects="@(VSProjects)"
  Properties="Configuration=$(Configuration)">
  <Output TaskParameter="TargetOutputs" ItemName="BuildTargetOutputs"/>
</MSBuild>

and then do a copy:

<Copy SourceFiles="@(BuildTargetOutputs)" 
  DestinationFolder="bin"
  SkipUnchangedFiles="true" />

Not sure what the TargetOutputs are for a web project, but for winforms and class libraries, it's the .dll or .exe.

Mike