Re: Versioning / increasing build number

2010-02-09 Thread Austin Ziegler
[I sent this reply privately to Stefan a few days ago and realized
that it hadn't come to the mailing list.]

On Fri, Feb 5, 2010 at 12:26 PM, Stefan Wolfrum  wrote:
> Okay, found & read Chris Hanson's blog article from 2005:
> http://chanson.livejournal.com/125568.html
>
> I totally agree with the guy who wrote the first comment!
>
> So, looks like agvtool is the wrong path to follow if I want an integer build 
> number that just increases everytime
> I hit cmd-R or cmd-Y or cmd-B or variations of those.

This does more than you need if your'e not using Git, but it's a good
basis for making your own incremental versioning system. If you're
using SVN, it's fairly easy to look for "svn tag version xcode".

http://github.com/halostatue/xcode-git-version

-austin
-- 
Austin Ziegler • halosta...@gmail.com • aus...@halostatue.ca
http://www.halostatue.ca/ • http://twitter.com/halostatue
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Versioning / increasing build number

2010-02-09 Thread Dave DeLong
Another option, which I posted as a comment on my site (linked to previously), 
is to move Info.plist to Info.template.plist, and then use the build number 
script to generate the Info.plist that the compiler will actually use.  That 
way you can set an ignore on the generated Info.plist file (if you're using a 
source control system), but still have the original template plist in the 
repository.

Dave

On Feb 9, 2010, at 9:09 AM, Jens Miltner wrote:

> Just one more thought:
> 
> you could have a shell script build phase that runs whatever tool you're 
> using to bump the build number and only run this when building the deployment 
> configuration (e.g. by checking ${CONFIGURATION} in your script, or by 
> activating the "Run script only when installing" checkbox in the script build 
> phase, which seems to have the side effect of only executing during the 
> deployment builds).
> 
> That way, your debug builds (during your development cycles) won't 
> proliferate the build numbers, but any time you run a deployment build, the 
> build number gets bumped...
> 
> 
> 
> 
> Am 06.02.2010 um 00:58 schrieb Stefan Wolfrum:
> 
>> thanks a lot for both replies!!
>> 
>> I don't know which approach to follow though.
>> I'm currently not using a versioning system so maybe Jonathan's method is 
>> sufficient.
>> However, I like Gwynne's method, too...
>> *sigh*
>> 
>> But at least: problem solved!
>> 
>> Thanks and sorry: I'll spend more time with Google next time before I ask 
>> here. (And I know the Xcode mailing list now, too...)
>> 
>> Stefan.
>> 
>> Am 06.02.2010 um 00:09 schrieb Gwynne Raskind:
>> 
>>> On Feb 5, 2010, at 1:56 PM, jonat...@mugginsoft.com wrote:
> 2) Right now the file doesn't get built new every time I build my 
> application. So the number isn't increasing yet. How can this be achieved?
 I use the following in a script phase to get a perpetually increasing 
 build number.
 
 #!/bin/bash
 # http://davedelong.com/blog/2009/04/15/incrementing-build-numbers-xcode
 buildNumber=$(/usr/libexec/PlistBuddy -c "Print MGSBuildNumber" Info.plist)
 buildNumber=$(($buildNumber + 1))
 /usr/libexec/PlistBuddy -c "Set :MGSBuildNumber $buildNumber" Info.plist
>>> 
>>> 
>>> This taints your original Info.plist with changing data, which is annoying 
>>> for version-controlled code. You can find the script I use at 
>>> ; it's a short AppleScript that tricks 
>>> Xcode into doing the right thing.
>>> 
>>> -- Gwynne
>>> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/davedelong%40me.com
> 
> This email sent to davedel...@me.com



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Versioning / increasing build number

2010-02-09 Thread Jens Miltner
Just one more thought:

you could have a shell script build phase that runs whatever tool you're using 
to bump the build number and only run this when building the deployment 
configuration (e.g. by checking ${CONFIGURATION} in your script, or by 
activating the "Run script only when installing" checkbox in the script build 
phase, which seems to have the side effect of only executing during the 
deployment builds).

That way, your debug builds (during your development cycles) won't proliferate 
the build numbers, but any time you run a deployment build, the build number 
gets bumped...




Am 06.02.2010 um 00:58 schrieb Stefan Wolfrum:

> thanks a lot for both replies!!
> 
> I don't know which approach to follow though.
> I'm currently not using a versioning system so maybe Jonathan's method is 
> sufficient.
> However, I like Gwynne's method, too...
> *sigh*
> 
> But at least: problem solved!
> 
> Thanks and sorry: I'll spend more time with Google next time before I ask 
> here. (And I know the Xcode mailing list now, too...)
> 
> Stefan.
> 
> Am 06.02.2010 um 00:09 schrieb Gwynne Raskind:
> 
>> On Feb 5, 2010, at 1:56 PM, jonat...@mugginsoft.com wrote:
 2) Right now the file doesn't get built new every time I build my 
 application. So the number isn't increasing yet. How can this be achieved?
>>> I use the following in a script phase to get a perpetually increasing build 
>>> number.
>>> 
>>> #!/bin/bash
>>> # http://davedelong.com/blog/2009/04/15/incrementing-build-numbers-xcode
>>> buildNumber=$(/usr/libexec/PlistBuddy -c "Print MGSBuildNumber" Info.plist)
>>> buildNumber=$(($buildNumber + 1))
>>> /usr/libexec/PlistBuddy -c "Set :MGSBuildNumber $buildNumber" Info.plist
>> 
>> 
>> This taints your original Info.plist with changing data, which is annoying 
>> for version-controlled code. You can find the script I use at 
>> ; it's a short AppleScript that tricks 
>> Xcode into doing the right thing.
>> 
>> -- Gwynne
>> 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Versioning / increasing build number

2010-02-05 Thread Stefan Wolfrum
thanks a lot for both replies!!

I don't know which approach to follow though.
I'm currently not using a versioning system so maybe Jonathan's method is 
sufficient.
However, I like Gwynne's method, too...
*sigh*

But at least: problem solved!

Thanks and sorry: I'll spend more time with Google next time before I ask here. 
(And I know the Xcode mailing list now, too...)

Stefan.

Am 06.02.2010 um 00:09 schrieb Gwynne Raskind:

> On Feb 5, 2010, at 1:56 PM, jonat...@mugginsoft.com wrote:
>>> 2) Right now the file doesn't get built new every time I build my 
>>> application. So the number isn't increasing yet. How can this be achieved?
>> I use the following in a script phase to get a perpetually increasing build 
>> number.
>> 
>> #!/bin/bash
>> # http://davedelong.com/blog/2009/04/15/incrementing-build-numbers-xcode
>> buildNumber=$(/usr/libexec/PlistBuddy -c "Print MGSBuildNumber" Info.plist)
>> buildNumber=$(($buildNumber + 1))
>> /usr/libexec/PlistBuddy -c "Set :MGSBuildNumber $buildNumber" Info.plist
> 
> 
> This taints your original Info.plist with changing data, which is annoying 
> for version-controlled code. You can find the script I use at 
> ; it's a short AppleScript that tricks 
> Xcode into doing the right thing.
> 
> -- Gwynne
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/mailinglists%40wops.de
> 
> This email sent to mailingli...@wops.de

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Versioning / increasing build number

2010-02-05 Thread Gwynne Raskind
On Feb 5, 2010, at 1:56 PM, jonat...@mugginsoft.com wrote:
>> 2) Right now the file doesn't get built new every time I build my 
>> application. So the number isn't increasing yet. How can this be achieved?
> I use the following in a script phase to get a perpetually increasing build 
> number.
> 
> #!/bin/bash
> # http://davedelong.com/blog/2009/04/15/incrementing-build-numbers-xcode
> buildNumber=$(/usr/libexec/PlistBuddy -c "Print MGSBuildNumber" Info.plist)
> buildNumber=$(($buildNumber + 1))
> /usr/libexec/PlistBuddy -c "Set :MGSBuildNumber $buildNumber" Info.plist


This taints your original Info.plist with changing data, which is annoying for 
version-controlled code. You can find the script I use at 
; it's a short AppleScript that tricks 
Xcode into doing the right thing.

-- Gwynne

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Versioning / increasing build number

2010-02-05 Thread jonat...@mugginsoft.com

On 5 Feb 2010, at 10:40, Stefan Wolfrum wrote:
> 
> 2) Right now the file doesn't get built new every time I build my 
> application. So the number isn't increasing yet. How can this be achieved?
> 
I use the following in a script phase to get a perpetually increasing build 
number.

#!/bin/bash
# http://davedelong.com/blog/2009/04/15/incrementing-build-numbers-xcode
buildNumber=$(/usr/libexec/PlistBuddy -c "Print MGSBuildNumber" Info.plist)
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :MGSBuildNumber $buildNumber" Info.plist

Regards

Jonathan Mitchell

Developer
http://www.mugginsoft.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Versioning / increasing build number

2010-02-05 Thread Stefan Wolfrum
Okay, found & read Chris Hanson's blog article from 2005:
http://chanson.livejournal.com/125568.html

I totally agree with the guy who wrote the first comment!

So, looks like agvtool is the wrong path to follow if I want an integer build 
number that just increases everytime I hit cmd-R or cmd-Y or cmd-B or 
variations of those.

:-(

Am 05.02.2010 um 11:40 schrieb Stefan Wolfrum:

> A question about versioning. Information seems a bit sparse on this according 
> to a few Google/cocoa-dev archives/ADC/Apple Discussions searches.
> 
> I want to have a consecutive build number (an integer counting up each new 
> build) displayed in my application (in an NSTextField, About dialog).
> Now I know how to access the Main/Major program version (string) from the 
> main bundle (CFBundleVersion). But that's not the constantly increasing 
> integer I am looking for.
> 
> What I did so far:
> - in my project settings I set "Versioning System" to "Apple Generic"
> - in my project settings I set "Current Project Version" to 1
> 
> I now get a file $(PRODUCT_NAME)_vers.c built in the folder 
> build/$(PRODUCT_NAME).build/Debug/$(PRODUCT_NAME).build/DerivedSources
> 
> It contains two variables and it looks like I'm interested in the second
> const double $(PRODUCT_NAME)VersionNumber __attribute__ ((used)) = (double)1.;
> 
> However, I still have two questions:
> 1) How do I get access to this const in my source code? I guess I have to 
> declare a const as "extern" somehow somewhere?! agvtool doc says this 
> generated c file gets linked into the binary...
> 2) Right now the file doesn't get built new every time I build my 
> application. So the number isn't increasing yet. How can this be achieved?
> 
> Thanks a lot!
> Stefan.___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/mailinglists%40wops.de
> 
> This email sent to mailingli...@wops.de

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com