开发者

Get changesets at "run on agent" sequence into build template workflow

开发者 https://www.devze.com 2023-03-17 19:38 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消