• 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: storing git version in the plist
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: storing git version in the plist


  • Subject: Re: storing git version in the plist
  • From: Alexander von Below <email@hidden>
  • Date: Tue, 04 Dec 2012 21:14:57 +0100

I put the versions in the processed plist, using PlistBuddy

Like this:

# Set the version from version.txt
product_version=`cat version.txt`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion \"$product_version\"" "$TARGET_BUILD_DIR/$INFOPLIST_PATH"

HTH

Alex

Am 04.12.2012 um 20:04 schrieb Joel Reymont <email@hidden>:

> I created an aggregate target named Versioning and made my other
> targets dependent on it.
>
> I put the following in the Run Script build phase of Versioning
>
> ---
> cd "$PROJECT_DIR"
> GIT_VERSION=$(/usr/local/bin/git rev-parse --short HEAD)
> SHORT_VERSION=$(git describe | sed -e 's/^v//' -e 's/g//')
> VERSION=$(git rev-list master | wc -l)
>
> cd "$PROJECT_TEMP_DIR"
> echo "#define GIT_VERSION $GIT_VERSION" > revision.prefix
> echo "#define SHORT_VERSION \"$SHORT_VERSION\"" >> revision.prefix
> echo "#define VERSION $VERSION" >> revision.prefix
> ---
>
> I enabled plist preprocessing for the project and pointed plist
> preprocessor prefix file to $PROJECT_TEMP_DIR/revision.prefix.
> Finally, I plugged in the above variables into each plist file.
>
> Now, here's my problem... I only get a proper replacement in each
> plist file when I clean the target and rebuild. The plists don't seem
> to be processed afterwards even if change something in the target and
> it gets rebuilt.
>
> Do I need to "touch" the un-processed plist for it to be rebuild and
> what is the best way to do so?
>
> I tried adding a Run Script build phase to touch the unprocessed plist
> for each target but I can only insert the build phase after the Target
> Dependencies phase and the plist is (not)processed by then.
>
>   Thanks, Joel
>
>
> --------------------------------------------------------------------------
> for hire: mac osx device driver ninja. kernel, usb and coreaudio drivers
> ---------------------+------------+---------------------------------------
> http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
> ---------------------+------------+---------------------------------------
> _______________________________________________
> 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

 _______________________________________________
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

  • Follow-Ups:
    • Re: storing git version in the plist
      • From: Joel Reymont <email@hidden>
    • Re: storing git version in the plist
      • From: Joel Reymont <email@hidden>
References: 
 >storing git version in the plist (From: Joel Reymont <email@hidden>)
 >Re: storing git version in the plist (From: Joel Reymont <email@hidden>)

  • Prev by Date: Printing dynamic arrays in LLDB
  • Next by Date: Re: storing git version in the plist
  • Previous by thread: Re: storing git version in the plist
  • Next by thread: Re: storing git version in the plist
  • Index(es):
    • Date
    • Thread