From b07190a7f63162d2836ab930e317242b64dee3f6 Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Thu, 29 May 2008 23:26:32 -0700 Subject: [PATCH] Adding automagic bzr version numbering (ooh so shiny!) --- Info.plist | 4 +++- Sparkle.xcodeproj/project.pbxproj | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Info.plist b/Info.plist index 25775685..3cfbcb89 100644 --- a/Info.plist +++ b/Info.plist @@ -1,5 +1,5 @@ - + CFBundleDevelopmentRegion @@ -20,6 +20,8 @@ ???? CFBundleVersion 1.5 + CFBundleShortVersionString + 1.5 Beta (bzr) NSPrincipalClass diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 23f1c1c8..71cbc05c 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -643,6 +643,7 @@ 8DC2EF520486A6940098B216 /* Resources */, 8DC2EF540486A6940098B216 /* Sources */, 8DC2EF560486A6940098B216 /* Frameworks */, + 6131B1910DDCDE32005215F0 /* Run Script: Set Bzr Version Info */, ); buildRules = ( ); @@ -773,6 +774,20 @@ shellPath = /bin/sh; shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; }; + 6131B1910DDCDE32005215F0 /* Run Script: Set Bzr Version Info */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 12; + files = ( + ); + inputPaths = ( + ); + name = "Run Script: Set Bzr Version Info"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = "/usr/bin/env perl -w"; + shellScript = "# Xcode auto-versioning script for Subversion\n# by Axel Andersson, modified by Daniel Jalkut to add\n# \"--revision HEAD\" to the svn info line, which allows\n# the latest revision to always be used.\n\nuse strict;\n\ndie \"$0: Must be run from Xcode\" unless $ENV{\"BUILT_PRODUCTS_DIR\"};\n# Get the current subversion revision number and use it to set the CFBundleVersion value\nmy $REV = `PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/local/bin /usr/bin/env bzr revno`;\nmy $INFO = \"$ENV{BUILT_PRODUCTS_DIR}/$ENV{WRAPPER_NAME}/Resources/Info.plist\";\n\nmy $version = $REV;\n\n# (Match the last group of digits and optional letter M/S):\n\n# ugly yet functional (barely) regex by Daniel Jalkut:\n#$version =~ s/([\\d]*:)(\\d+[M|S]*).*/$2/;\n\n# better yet still functional regex via Kevin \"Regex Nerd\" Ballard\n($version =~ m/(\\d.)+[MS]*$/) && ($version = $&);\n\ndie \"$0: No Bazaar revision found\" unless $version;\n\nopen(FH, \"$INFO\") or die \"$0: $INFO: $!\";\nmy $info = join(\"\", );\nclose(FH);\n\n$info =~ s/([\\t ]+CFBundleVersion<\\/key>\\n[\\t ]+).*?(<\\/string>)/$1$version$2/;\n\nopen(FH, \">$INFO\") or die \"$0: $INFO: $!\";\nprint FH $info;\nclose(FH);"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */