Permalink
Browse files

only way this would work

  • Loading branch information...
1 parent e989fa2 commit 3bc1e5fca3449e0751bc0afb0f23711df6b7cd52 @schacon committed Jun 24, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 Git.xcodeproj/project.pbxproj
@@ -635,7 +635,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/usr/bin/env ruby";
- shellScript = "# Xcode auto-versioning script for git by Andre Arko\n# This script will set your CFBundleVersion number to the name of the most recent\n# git tag, and include the current commit's distance from that tag and sha1 hash\n#\n# With tag \"v1.0\", and two commits since then, the build will be:\n# v1.0 (b2 h12345)\n#\n# Create new tags with \"git tag <version> -m <message>\"\n#\n# based on the ruby script by Abizern which was\n# based on the git script by Marcus S. Zarra and Matt Long which was\n# based on the Subversion script by Axel Andersson\n\n# Uncomment to only run when doing a Release build\n# if ENV[\"BUILD_STYLE\"] != \"Release\"\n# puts \"Not a Release build.\"\n# exit\n# end\n\ngitnum = `/usr/bin/env git describe --long`.chomp.split(\"-\")\nversion = gitnum[0] + \" (b#{gitnum[1]} #{gitnum[2]})\"\n\ninfo_file = File.join(ENV['BUILT_PRODUCTS_DIR'], ENV['INFOPLIST_PATH'])\ninfo = File.open(info_file, \"r\").read\n\nversion_re = /([\\t ]+<key>CFBundleVersion<\\/key>\\n[\\t ]+<string>).*?(<\\/string>)/\ninfo =~ version_re\nbundle_version_string = $1 + version + $2\n\ninfo.gsub!(version_re, bundle_version_string)\nFile.open(info_file, \"w\") { |file| file.write(info) }\nputs \"Set version string to '#{version}'\"\n";
+ shellScript = "# Xcode auto-versioning script for git by Andre Arko\n# This script will set your CFBundleVersion number to the name of the most recent\n# git tag, and include the current commit's distance from that tag and sha1 hash\n#\n# With tag \"v1.0\", and two commits since then, the build will be:\n# v1.0 (b2 h12345)\n#\n# Create new tags with \"git tag <version> -m <message>\"\n#\n# based on the ruby script by Abizern which was\n# based on the git script by Marcus S. Zarra and Matt Long which was\n# based on the Subversion script by Axel Andersson\n\n# Uncomment to only run when doing a Release build\n# if ENV[\"BUILD_STYLE\"] != \"Release\"\n# puts \"Not a Release build.\"\n# exit\n# end\n\ngitnum = `/usr/local/bin/git describe --long`.chomp.split(\"-\")\nversion = gitnum[0] + \" (b#{gitnum[1]} #{gitnum[2]})\"\n\ninfo_file = File.join(ENV['BUILT_PRODUCTS_DIR'], ENV['INFOPLIST_PATH'])\ninfo = File.open(info_file, \"r\").read\n\nversion_re = /([\\t ]+<key>CFBundleVersion<\\/key>\\n[\\t ]+<string>).*?(<\\/string>)/\ninfo =~ version_re\nbundle_version_string = $1 + version + $2\n\ninfo.gsub!(version_re, bundle_version_string)\nFile.open(info_file, \"w\") { |file| file.write(info) }\nputs \"Set version string to '#{version}'\"\n";
};
F5A8DD8110800A580022EDA0 /* Attach DMG */ = {
isa = PBXShellScriptBuildPhase;

0 comments on commit 3bc1e5f

Please sign in to comment.