开发者

Example using build number in version string when building Android project via ant?

开发者 https://www.devze.com 2022-12-28 04:04 出处:网络
We are using Hudson to automate our Android build. I need to incorporate the build number into the version string used in our app. Was wonderi开发者_StackOverflow社区ng if anyone had an example of doi

We are using Hudson to automate our Android build. I need to incorporate the build number into the version string used in our app. Was wonderi开发者_StackOverflow社区ng if anyone had an example of doing that before I (re?)invent that wheel. Obviously I need to replace a string value in one of our config files.


Your shell script has access to the environment variable "BUILD_NUMBER", for example "153". You could use that in your config file.

You could also consider "BUILD_ID ", which adds time/date info, such as "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)

To be super-verbose, you could use the "BUILD_TAG" variable, which is a string of "hudson-${JOBNAME}-${BUILD_NUMBER}"

Finally, there is a version number plugin:
http://wiki.hudson-ci.org/display/HUDSON/Version+Number+Plugin

... which gives you a ton of other options.

0

精彩评论

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