Mittwoch, 20. März 2013

BURN #04: passing preprocessor variables into the build

A nice solution is explained here on stackoverflow:

it basically says that you should:

1st in the wixproj file add the following:
<Target Name="BeforeBuild">
    <CreateProperty Condition="$(BuildNumber) != ''"
Value="BuildNumber=$(BuildNumber);$(DefineConstants)">
      <Output TaskParameter="Value" PropertyName="DefineConstants" />
    </CreateProperty>
    <CreateProperty Condition="$(RevisionNumber) != ''"
Value="RevisionNumber =$(RevisionNumber);$(DefineConstants)">
      <Output TaskParameter="Value" PropertyName="DefineConstants" />
    </CreateProperty>
  </Target>
2nd in your msbuild task do this:
<MSBuild Projects="YourWixProject.wixproj" 
   Properties="BuildNumber=$(VerBuildNumber);RevisionNumber=$(RevisionNumber)" 
/>

Donnerstag, 14. März 2013

Writing custom NANT and msbuild tasks

Just a friendly reminder to reuse work of others.

See here for msbuild:
Nant help can be found here:
Or, since i only wanted to learn how to write a task which deletes directories which are older than XX:
Look at slashdot to delete all directories which are more than 7 days old