Fixed build version info generator

CQTexperiment
Chris Moeller 2013-10-12 17:53:59 -07:00
parent e6a2773e8a
commit ee29955db0
2 changed files with 8 additions and 4 deletions

View File

@ -2026,8 +2026,8 @@
outputPaths = ( outputPaths = (
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = Scripts/genversion.sh; shellPath = /bin/sh;
shellScript = ""; shellScript = "${PROJECT_DIR}/Scripts/genversion.sh";
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */

View File

@ -1,10 +1,14 @@
#!/bin/sh #!/bin/sh
hg_version=$(hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}') hg_version=$(/usr/local/bin/hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}')
build_time=$(date) build_time=$(date)
info_plist="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/Info.plist" echo "hg_version=${hg_version}"
echo "build_time=${build_time}"
info_plist="${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion '${hg_version}'" "${info_plist}" /usr/libexec/PlistBuddy -c "Set :CFBundleVersion '${hg_version}'" "${info_plist}"
/usr/libexec/PlistBuddy -c "Add :BuildTime date '${build_time}'" "${info_plist}" /usr/libexec/PlistBuddy -c "Add :BuildTime date '${build_time}'" "${info_plist}"
exit 0