From 6b974d87718cda682da553023f86e8a038c2f420 Mon Sep 17 00:00:00 2001 From: GRMrGecko Date: Thu, 21 Apr 2011 11:18:03 -0500 Subject: [PATCH] Xcode Scripts Start --- Build Directory.sh | 14 ++++++++++++++ Git Version.sh | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100755 Build Directory.sh create mode 100755 Git Version.sh diff --git a/Build Directory.sh b/Build Directory.sh new file mode 100755 index 0000000..e1c3d26 --- /dev/null +++ b/Build Directory.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# +# Build Directory +# +# Created by Mr. Gecko on 4/21/11. +# No Copyright Claimed. Public Domain. +# + +if [ "$SRCROOT/build" != "$SYMROOT" ]; then + if [ -d "$SRCROOT/build" ]; then + /bin/rm -Rf "$SRCROOT/build" + fi + /bin/ln -fs "$SYMROOT" "$SRCROOT/build" +fi \ No newline at end of file diff --git a/Git Version.sh b/Git Version.sh new file mode 100755 index 0000000..c05f227 --- /dev/null +++ b/Git Version.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# +# Git Version +# +# Created by Mr. Gecko on 4/21/11. +# No Copyright Claimed. Public Domain. +# + +INFO="${CONFIGURATION_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/Info" +GITDIR="${PROJECT_DIR}/.git" + +VERSION=`defaults read "${INFO}" CFBundleVersion` +if [ -d "${GITDIR}" ]; then + REVISION=`git --git-dir="${GITDIR}" rev-parse --short HEAD` + defaults write "${INFO}" CFBundleShortVersionString -string "${VERSION} (${REVISION})" +else + defaults write "${INFO}" CFBundleShortVersionString -string "${VERSION}" +fi \ No newline at end of file