Azure Pipelines选项内部版本号:$(Rev:r)在每个内部版本上递增吗?

时间:2020-10-14 19:31:32

标签: c# azure azure-devops azure-pipelines

documentation指出“构建完成后,如果内部版本号没有其他更改,则Rev整数值将增加1”。

但是,您可以在下面看到即使 did 发生了变化,它仍然会增加。

Build Versions

Build number format

在内部版本号中使用TokenType tokenType = new TokenType("Toyota Corolla-" + UUID.randomUUID(), 0); 时,有人知道实际行为是什么吗?

1 个答案:

答案 0 :(得分:0)

您已如下指定build number format

1.$(Rev:r).$(Year:yy)$(DayOfYear)

您需要进行后续构建。当您对前缀$(Rev:r)进行硬编码时,1.左侧的所有内容保持不变。 $(Rev:r)的右侧在这里无关紧要。因此,您的$(Rev:r)会不断增加1,如下所示:

1.1.2010 // first build on tenth day of 2020
1.2.2010 // second build, same day
1.3.2115 // third build on fifteenth day of 2021

现在,如果您将格式更改为

1.$(Year:yy)$(DayOfYear).$(Rev:r)

您最终会遇到这种情况

1.2010.1 // first build on tenth day of 2020
1.2010.2 // second build, same day
1.2115.1 // third build on fifteenth day of 2021