• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Updating a Build Number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updating a Build Number


  • Subject: Re: Updating a Build Number
  • From: Philip Aker <email@hidden>
  • Date: Wed, 24 Jun 2009 11:26:21 -0700

On 2009-06-24, at 10:42:46, Scott Tooker wrote:

If you are just looking to increment a simple build number, I'd strongly encourage you to look at the agvtool tool provided as part of Xcode Tools (man agvtool). This provides a convenient way to easily version different builds of you application without having to manually edit your Info.plist.


I want to use $CURRENT_PROJECT_VERSION for my build number and $VERSION_INFO_PREFIX for something I only have to change every 1000 builds.

This should work, though you usually don't change $VERSION_INFO_PREFIX unless you have a massive change in your product (since that setting is just a prefix, like NS, to place in front of some generated variables).

Yes. This is what I'm doing: ${VERSION_INFO_PREFIX}.$ {CURRENT_PROJECT_VERSION}


where VERSION_INFO_PREFIX will be something like 1.2 and I don't mind manually changing it every 1000 builds.


I would like to have my build numbers starting at 001 and increment so that the next numbers are 002, 003, etc. Will agvtool handle this?

$CURRENT_PROJECT__VERSION needs to be an integer or floating point number. However, if you need the "002" format for something specialized like a filename, you should be able to use <insert your scripting language of choice here> to transform the number into something suitable for the filename.

That's kind of the problem. We would also like to have a Get Info from the Finder on the bundle, and for apps, the About Box show the zero digit(s) prefix. But I had only thought to format using AppleScript to call a shell tool and then set the project version in AppleScript not in an xcconfig. But that's another problem because the xcconfigs I use are shared across all projects and not located in the project folder.



The goal is to upload my stuff for testing and zip up the product in a folder titled SomeProduct1.2.007.zip (for example) using mkdir -p, ditto -ck in a build phase. That way, all the releases appear sequentially in the manager's folder and it's easy for us to coordinate and access previous releases/builds.

This (with an appropriate run script) should work. Just keep in mind that you need to call agvtool to increment the version number, so doing that from within a project's build is kinda sketchy (since you are modifying the project itself).

I know about that anomaly calling agvtool from a build phase. I have an AppleScript that works if I have a single project at a time open. I think it's because there is a context switch.



My usual workflow is to run "agvtool next-version" on the command line when I'm ready to cut a new submission of a project and then build the new submission.

I'm looking to auto-increment using the "00X" form for every build. It doesn't matter if I submit sequentially, only if the version numbers below 100 will retain their prefix so that sorting on arbitrary machines will be consistent.



There's also some nice integration with Subversion and CVS so you can automatically check in and tag the version bump.

For this client, I'm only sending product, not source :-)


Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Updating a Build Number (From: Seth Willits <email@hidden>)
 >Re: Updating a Build Number (From: Chris Espinosa <email@hidden>)
 >Re: Updating a Build Number (From: Seth Willits <email@hidden>)
 >Re: Updating a Build Number (From: Scott Tooker <email@hidden>)
 >Re: Updating a Build Number (From: Philip Aker <email@hidden>)
 >Re: Updating a Build Number (From: Scott Tooker <email@hidden>)

  • Prev by Date: Re: Code sign issues
  • Next by Date: Re: NSString Retain Count of 2147483647
  • Previous by thread: Re: Updating a Build Number
  • Next by thread: Re: Updating a Build Number
  • Index(es):
    • Date
    • Thread