2

Hello i have a variable in Ant: ${env.BUILD_NUMBER}
And i wan't that this variable is always 6 characters long.
If not Ant should add trailing zeros.

1 should be 100000
39 should be 390000
5656 should be 565600

How is this possible using a Ant build script?

Thanks!

user1051892
  • 3,382
  • 1
  • 14
  • 8

1 Answers1

1

There is a solution using the PropertyFile Ant task described here: Re: Zero-Padding an Int Ant Property

You may also want to checkout the propertyregex task from Ant Contrib. See Replacing characters in Ant property

Community
  • 1
  • 1
Christopher Peisert
  • 21,862
  • 3
  • 86
  • 117