msbuildtasks did not solve my problem. As explained in the description, I need a special format. Also, the documentation for msbuildtasks is good ... find it.
I changed the source code of the AssemblyInfo Task by adding a new type of increment 'YearAndDay' with my needs:
case IncrementMethod.YearAndDay:
{
DateTime dDate = DateTime.Now;
long buildNumber = dDate.Year % 2000 * 1000;
buildNumber += dDate.DayOfYear;
string newVersionNumber = buildNumber.ToString();
Log.LogMessage(MessageImportance.Low, logMessage, newVersionNumber);
return newVersionNumber;
}
This seemed to be the easiest solution.
source
share