From 8392c7f800abb96a2b4edd29346a7531b7438954 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 1 Aug 2007 18:01:25 -0700 Subject: [PATCH] Adding a project build script that replaces the CFBundleVersion in the plist with a Git build string --- MacGDBp.xcodeproj/project.pbxproj | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/MacGDBp.xcodeproj/project.pbxproj b/MacGDBp.xcodeproj/project.pbxproj index 3295aa2..c7cb818 100644 --- a/MacGDBp.xcodeproj/project.pbxproj +++ b/MacGDBp.xcodeproj/project.pbxproj @@ -147,6 +147,7 @@ 8D1107290486CEB800E47090 /* Resources */, 8D11072C0486CEB800E47090 /* Sources */, 8D11072E0486CEB800E47090 /* Frameworks */, + 1E78FD670C6155EB00D6D005 /* ShellScript */, ); buildRules = ( ); @@ -187,6 +188,22 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 1E78FD670C6155EB00D6D005 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /usr/bin/ruby; + shellScript = "require \"ftools\"\nrequire \"Time\"\n\nhash = %x{/usr/local/bin/git log -1 --pretty=format:%h}\ntimestamp = %x{/usr/local/bin/git log -1 --pretty=format:%ct}\ntime = Time.at(timestamp.to_i)\n\nbuild = (\"%02d\" % time.year) + (\"%02d\" % time.month) + (\"%02d\" % time.day) + \".\" + hash\n\ninfopath = ENV[\"CONFIGURATION_BUILD_DIR\"] + \"/\" + ENV[\"INFOPLIST_PATH\"]\n\nputs infopath\n\nfile = \"\"\nio = File.new(infopath)\nlastline = \"\"\nwhile line = io.gets do\n\tif lastline.match(\"CFBundleVersion\")\n\t\tfile += \"\\t#{build}\\n\"\n\telse\n\t\tfile += line\n\tend\n\tlastline = line\nend\nio.close\n\nio = File.new(infopath, \"w\")\nio.write(file)\nio.close"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 8D11072C0486CEB800E47090 /* Sources */ = { isa = PBXSourcesBuildPhase; -- 2.22.5