I'm trying to use the CCNetBuildDate and CCNetBuildTime parameters to dynamically change the output filename of my unit test results, so for example:
<project>
<workingDirectory>C:\MyProject</workingDirectory>
<tasks>
<msbuild>
<buildArgs>/property:TestResultsFile=TestResults.$[CCNetBuildDate].$[CCNetBuildTime].trx</buildArgs>
<!-- etc... -->
</msbuild>
</tasks>
<publishers>
<merge>
<files>
<file>TestResults.$[CCNetBuildDate].$[CCNetBuildTime].trx</file>
</files>
</merge>
<xmllogger />
</publishers>
</project>
The trouble is that I cant figure out the syntax for using parameters in this way - I've tried dozens of variations:
- $(CCNetBuildTime)
- ${CCNetBuildTime}
- $CCNetBuildTime
But it never seems to actually pass the build time as the parameter (so for example in the above case I ended up with a filename "TestResults.$[CCNetBuildDate].$[CCNetBuildTime].trx"
What am I doing wrong?
(FYI: The reason I'm trying to dynamically decide the test results filename is because with a fixed results filename I kept on having the results from past builds included in my build report)