Is there an MSBuild macro for build date/time? -
suppose have build script target section following:
<target name="assemblyversionmain" inputs="@(assemblyversionfiles)" outputs="updatedassemblyversionfiles"> <attrib files="%(assemblyversionfiles.fullpath)" normal="true"/> <assemblyinfo codelanguage="cs" outputfile="%(assemblyversionfiles.fullpath)" assemblyproduct="$(productname)" assemblytitle="$(productname)" assemblycompany="$(companyname)" assemblycopyright="© $(companyname) 2014" <!-- line --> assemblyversion="$(major).$(minor).$(build).$(revision)" assemblyfileversion="$(major).$(minor).$(build).$(revision)" assemblyinformationalversion="$(major).$(minor).$(build).$(revision)"> <output taskparameter="outputfile" itemname="updatedassemblyversionfiles"/> </assemblyinfo> </target>
at moment, year static , has changed manually. there simple way of replacing "2014" $(year)? i've checked msbuild reference nothing jumps out @ me.
since using msbuild 4 use property function this, e.g.:
<propertygroup> <currentdate>$([system.datetime]::now.tostring(yyyy.mm.dd))</currentdate> </propertygroup>
just format recieved date need it. there plenty of other functions available, see http://msdn.microsoft.com/en-us/library/dd633440(v=vs.100).aspx.
Comments
Post a Comment