Inserting Build Date and Time in a Property
Is the possible to create a property in the build script which contains the current date and time for a build?
Thank you.
Is the possible to create a property in the build script which contains the current date and time for a build?
Thank you.
This information is not currently available in the build script, but it should be fairly simple to write a custom task to provide it. The markup would look something like:
<UsingTask TaskName="MyNamespace.GetDateTime" AssemblyFile="MyNamespace.GetDateTime.dll" />
...
<Target Name="TargetToOverride">
<GetDateTime>
<Output TaskParameter="CurrentDateTime" PropertyName="CurrentDateTime" />
</GetDateTime>
</Target>
You would then just need to write a custom task which sets a public property called CurrentDateTime to something like DateTime.UtcNow in its Execute method, pick the team build target you wish to override (if you want this information available from right at the beginning of the build, I would suggest BeforeEndToEndIteration), etc.
-Aaron