I need开发者_JAVA技巧 to generate a custom build number for the builds of the TFS server
Today I generated build number version with the current datetime (YY + current day of year), like this: build = Convert.ToInt16(DateTime.Today.ToString("yy") + DateTime.Today.DayOfYear.ToString());
Its works perfectly, but now I need to generate this number with the date of last changeset associated with the build.
How I get this date?
Remember: I'm generate build number at "run on agent" sequence into build template workflow.
Thanks
By the way I do this:
I had have a custom process template with a activity "GetAssemblyVersion".
This activity have this code:
. . . [RequiredArgument] public InArgument> ChangesetsToVersion { get; set; }
protected override string Execute(CodeActivityContext context)
{
.
.
.
IList<Changeset> changesetsToVersion = context.GetValue(ChangesetsToVersion);
var dataBase = changesetsToVersion.OrderByDescending(e => e.CreationDate).First().CreationDate;
build = Convert.ToInt16(dataBase.ToString("yy") + dataBase.DayOfYear.ToString());
. . . } I didn't test it yet, but this like to works fine.
精彩评论