I’m publishing a website by copying a fileset which should exclude .cs and other files. I’ve tested my NAnt script from the command line and it works fine but when it is called from CCNet, it copies all files, completely ignoring the excludes on my fileset. Any ideas what’s going wrong here?
Calling my NAnt build file from from CruiseControl.Net.
<tasks>
<nant>
<executable>$(nant.exe)</executable>
<baseDirectory>$(build-dir)\$(project-dir)</baseDirectory>
<buildArgs></buildArgs>
<nologo>true</nologo>
<buildFile>aview-dev.build.xml</buildFile>
<targetList>
<target>go</target>
</targetList>
<buildTimeoutSeconds>300</buildTimeoutSeconds>
</nant>
</tasks>
The chunk of the NAnt build file that doesn’t seem to work (part of my ‘publish’ step).
<copy todir="${publish.path}" includeemptydirs="false">
<fileset basedir="${src.path}" defaultexcludes="true">
<include name="**/**" />
<exclude name="**.csproj*"/>
<exclude name="**.cs"/>
<exclude name="**.vb"/>
<exclude name="**.sln"/>
<exclude name="**/obj/**"/>
</fileset>
</copy>
The same NAnt file works fine when run directly from the command prompt.
nant -buildfile:test.build.xml -debug
I’m using NAnt 0.91 and CCNet 1.6.7981.1
After running the NAnt script in debug mode and checking that the .vb files were not actually getting copied by NAnt, I went back to my CCNet configuration. I realized that I had defined a buildpublisher block in my ccnet.config and was using that in my ccnet project file. After the NAnt task correctly copied the files, the buildpublisher task re-copied everything without any filter (including .vb files, the .svn directory, etc).
Removing the buildpublisher task fixed the problem.