aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Resources/Info.plist2
-rwxr-xr-xScripts/build-version.pl32
-rw-r--r--sequel-pro.xcodeproj/project.pbxproj29
3 files changed, 62 insertions, 1 deletions
diff --git a/Resources/Info.plist b/Resources/Info.plist
index e3851dd8..ab10cc48 100644
--- a/Resources/Info.plist
+++ b/Resources/Info.plist
@@ -44,7 +44,7 @@
<key>CFBundleShortVersionString</key>
<string>0.9.3</string>
<key>CFBundleVersion</key>
- <string>238</string>
+ <string></string>
<key>NSAppleScriptEnabled</key>
<string>YES</string>
<key>NSHumanReadableCopyright</key>
diff --git a/Scripts/build-version.pl b/Scripts/build-version.pl
new file mode 100755
index 00000000..f8cd47ec
--- /dev/null
+++ b/Scripts/build-version.pl
@@ -0,0 +1,32 @@
+#! /usr/bin/perl -w
+
+## Author: Stuart Connolly (stuconnolly.com)
+## Copyright (c) 2008 Stuart Connolly. All rights reserved.
+##
+## Paramters: <none>
+##
+## Description: Updates the application/bundle's Info.plist CFBundleVersion to match that of the current
+## Subversion revision.
+
+use strict;
+
+die "$0: Must be run from within Xcode. Exiting..." unless $ENV{"BUILT_PRODUCTS_DIR"};
+
+my $revision = `svnversion -n ./`;
+my $info_plist = "$ENV{BUILT_PRODUCTS_DIR}/$ENV{INFOPLIST_PATH}";
+
+my $version = $revision;
+
+($version =~ m/(\d+)[MS]*$/) && ($version = $1);
+
+die "$0: No Subversion revision found. Exiting..." unless $version;
+
+open(INFO_FH, "$info_plist") or die "$0: $info_plist: $!";
+my $info = join("", <INFO_FH>);
+close(INFO_FH);
+
+$info =~ s/([\t ]+<key>CFBundleVersion<\/key>\n[\t ]+<string>).*?(<\/string>)/$1$version$2/;
+
+open(INFO_FH, ">$info_plist") or die "$0: $info_plist: $!";
+print INFO_FH $info;
+close(INFO_FH);
diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj
index f14836d3..dfd76db9 100644
--- a/sequel-pro.xcodeproj/project.pbxproj
+++ b/sequel-pro.xcodeproj/project.pbxproj
@@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */
1761FD480EF03A6F00331368 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1761FD460EF03A6F00331368 /* MainMenu.xib */; };
+ 1761FD9E0EF0488900331368 /* build-version.pl in Resources */ = {isa = PBXBuildFile; fileRef = 1761FD9D0EF0488900331368 /* build-version.pl */; };
17E641460EF01EB5001BC333 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 17E641440EF01EB5001BC333 /* main.m */; };
17E641560EF01EF6001BC333 /* CustomQuery.m in Sources */ = {isa = PBXBuildFile; fileRef = 17E641490EF01EF6001BC333 /* CustomQuery.m */; };
17E641570EF01EF6001BC333 /* MainController.m in Sources */ = {isa = PBXBuildFile; fileRef = 17E6414B0EF01EF6001BC333 /* MainController.m */; };
@@ -116,6 +117,7 @@
/* Begin PBXFileReference section */
1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
1761FD470EF03A6F00331368 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
+ 1761FD9D0EF0488900331368 /* build-version.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = "build-version.pl"; sourceTree = "<group>"; };
17E641440EF01EB5001BC333 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
17E641450EF01EB5001BC333 /* sequel-pro_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "sequel-pro_Prefix.pch"; sourceTree = "<group>"; };
17E641480EF01EF6001BC333 /* CustomQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomQuery.h; sourceTree = "<group>"; };
@@ -265,6 +267,14 @@
name = "Other Frameworks";
sourceTree = "<group>";
};
+ 1761FD9C0EF0486A00331368 /* Scripts */ = {
+ isa = PBXGroup;
+ children = (
+ 1761FD9D0EF0488900331368 /* build-version.pl */,
+ );
+ path = Scripts;
+ sourceTree = "<group>";
+ };
17E641420EF01E8A001BC333 /* Source */ = {
isa = PBXGroup;
children = (
@@ -476,6 +486,7 @@
17E641420EF01E8A001BC333 /* Source */,
17E642050EF020A3001BC333 /* Interfaces */,
17E641430EF01E90001BC333 /* Resources */,
+ 1761FD9C0EF0486A00331368 /* Scripts */,
2A37F4C3FDCFA73011CA2CEA /* Frameworks */,
19C28FB0FE9D524F11CA2CBB /* Products */,
);
@@ -502,6 +513,7 @@
8D15AC300486D014006FF6A4 /* Sources */,
8D15AC330486D014006FF6A4 /* Frameworks */,
4DECC4940EC2B447008D359E /* CopyFiles */,
+ 1761FDAF0EF0496500331368 /* ShellScript */,
);
buildRules = (
);
@@ -596,11 +608,28 @@
17E6423E0EF0218B001BC333 /* InfoPlist.strings in Resources */,
17E642700EF02733001BC333 /* English.lproj in Resources */,
1761FD480EF03A6F00331368 /* MainMenu.xib in Resources */,
+ 1761FD9E0EF0488900331368 /* build-version.pl in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
+/* Begin PBXShellScriptBuildPhase section */
+ 1761FDAF0EF0496500331368 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# Add build/bundle version\n${SRCROOT}/Scripts/build-version.pl";
+ };
+/* End PBXShellScriptBuildPhase section */
+
/* Begin PBXSourcesBuildPhase section */
8D15AC300486D014006FF6A4 /* Sources */ = {
isa = PBXSourcesBuildPhase;