Re: Updating a Build Number
Re: Updating a Build Number
- Subject: Re: Updating a Build Number
- From: Jens Miltner <email@hidden>
- Date: Mon, 29 Jun 2009 09:29:25 +0200
Am 26.06.2009 um 22:36 schrieb Seth Willits:
On Jun 24, 2009, at 7:58 AM, 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 just looked at this (I read Chris Hanson's blog since the man page
wasn't clear enough for me). I think it's a bit silly. Why should I
have to quite Xcode just to increment the build number? Any time I
build my "Release" configuration, I simply want the build number to
increase. I don't see why it should be any more complicated than
that (at least in my situation), so I created that simple build
script. Xcode doesn't like it though.
When building a target, Xcode processes Info.plist before anything
else. This means that it creates a plist file and moves it into the
build products folder, *then*, my script is executed which increases
the value in the source products' Info.plist file. So the number in
the source-products is actually N+1 rather than being the same
number. The problem there is that if I then commit the code, it's
not the right value relative to the code. So that's kinda sucky.
In our projects, I solved this by moving the scripts that update other
files to their own target and make my main target depend on that target.
Meanwhile, this _might_ have changed, i.e. when you carefully specify
the input and output files of your shell script build phase, Xcode
_might_ take those dependencies into account in *all* the various
build phases, but if you move your script to another target it
definitely *will* do so...
(You'll have to modify the 'source' Info.plist, of course.
Alternatively, you should be able to specify "$
(CONFIGURATION_BUILD_DIR)/MyInfo.plist" as the "Info.plist" property
of your main target and write your modified copy of the Info.plist to
that file. Make sure to set up the input/output dependencies of your
shell script build phase correctly.)
The bigger problem though is that if I do a build, let's say the
version is 100 in the final built app, and Info.plist in the source
folder says 101. If I build again, Info.plist is updated to 102, but
*VERY VERY OFTEN* the app's Info.plist is left unchanged -- it'd
still be 100. Then I have to wack build again, and it then jumps to
102. I don't know what the heck is going on here, but it's
annoying. :\
Might be a problem with dependencies - see above
A third problem is that I have a build script at the very end of
building which is supposed to zip the file for me and create a
digital signature on it for Sparkle and some other things, but that
happens *before* code signing so it's not zipping the correct/final
result. There seems to be no way to change this.
Again, I'd suggest moving your zipping phase to a separate target,
make your main target a dependency of that target and build the new
target when you want to build a distribution.
You dependency would look like this:
update build number target <- main target (build app) target <-
create zip archive target
HTH,
</jum>
_______________________________________________
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