mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
About-Panel: Show git-describe using Info.plist
This patch adds a CFBundleGitRevision key to Info.plist which is set to the output of "git describe" when building. The menu-entry for "About GitX" was reconnected to a custom method in the AppController, which reads the CF-string from the .plist and also indicates if the build is a DEBUG-build. Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This commit is contained in:
committed by
Pieter de Bie
parent
8cdb2e6c9d
commit
0b81911d76
@@ -28,6 +28,7 @@
|
||||
- (NSManagedObjectContext *)managedObjectContext;
|
||||
|
||||
- (IBAction)openPreferencesWindow:(id)sender;
|
||||
- (IBAction)showAboutPanel:(id)sender;
|
||||
|
||||
- (IBAction)installCliTool:(id)sender;
|
||||
|
||||
|
||||
@@ -92,6 +92,20 @@
|
||||
[[PBPrefsWindowController sharedPrefsWindowController] showWindow:nil];
|
||||
}
|
||||
|
||||
- (IBAction)showAboutPanel:(id)sender
|
||||
{
|
||||
NSString *gitversion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleGitVersion"];
|
||||
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
|
||||
if (gitversion)
|
||||
[dict addEntriesFromDictionary:[[NSDictionary alloc] initWithObjectsAndKeys:gitversion, @"Version", nil]];
|
||||
|
||||
#ifdef DEBUG_BUILD
|
||||
[dict addEntriesFromDictionary:[[NSDictionary alloc] initWithObjectsAndKeys:@"GitX (DEBUG)", @"ApplicationName", nil]];
|
||||
#endif
|
||||
|
||||
[NSApp orderFrontStandardAboutPanelWithOptions:dict];
|
||||
}
|
||||
|
||||
- (IBAction)installCliTool:(id)sender;
|
||||
{
|
||||
BOOL success = NO;
|
||||
|
||||
@@ -886,8 +886,8 @@
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">orderFrontStandardAboutPanel:</string>
|
||||
<reference key="source" ref="519751875"/>
|
||||
<string key="label">showAboutPanel:</string>
|
||||
<reference key="source" ref="859235683"/>
|
||||
<reference key="destination" ref="1039244063"/>
|
||||
</object>
|
||||
<int key="connectionID">142</int>
|
||||
@@ -2278,6 +2278,7 @@
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>installCliTool:</string>
|
||||
<string>openPreferencesWindow:</string>
|
||||
<string>showAboutPanel:</string>
|
||||
<string>saveAction:</string>
|
||||
<string>showHelp:</string>
|
||||
</object>
|
||||
@@ -2287,6 +2288,7 @@
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\nVERSION=$(cd \"$PROJECT_DIR\";git describe)\nLONG_VERSION=$(echo $VERSION | sed -e \"s/\\-/\\./\" -e \"s/^v//\" -e \"s/-.*//\")\nSHORT_VERSION=$(echo $VERSION | sed -e \"s/\\-.*//\" -e \"s/^v//\")\n\necho -n \"#define LONG_VERSION $LONG_VERSION\n#define SHORT_VERSION $SHORT_VERSION\" > \"$PROJECT_TEMP_DIR/revision\"\ntouch Info.plist";
|
||||
shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\nVERSION=$(cd \"$PROJECT_DIR\";git describe)\nLONG_VERSION=$(echo $VERSION | sed -e \"s/\\-/\\./\" -e \"s/^v//\" -e \"s/-.*//\")\nSHORT_VERSION=$(echo $VERSION | sed -e \"s/\\-.*//\" -e \"s/^v//\")\n\necho -n \"#define LONG_VERSION $LONG_VERSION\n#define GIT_VERSION $VERSION\n#define SHORT_VERSION $SHORT_VERSION\" > \"$PROJECT_TEMP_DIR/revision\"\ntouch Info.plist";
|
||||
};
|
||||
F5792DFB0EDB570C001B0C31 /* Compile libgit2 */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
@@ -985,7 +985,7 @@
|
||||
HEADER_SEARCH_PATHS = libgit2/src;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional";
|
||||
INFOPLIST_PREFIX_HEADER = build/revision;
|
||||
INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision;
|
||||
INFOPLIST_PREPROCESS = YES;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
LIBRARY_SEARCH_PATHS = libgit2;
|
||||
@@ -1001,6 +1001,7 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = DEBUG_BUILD;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_PREPROCESS = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
|
||||
};
|
||||
@@ -1016,6 +1017,8 @@
|
||||
GCC_ENABLE_OBJC_GC = required;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision;
|
||||
INFOPLIST_PREPROCESS = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
|
||||
};
|
||||
@@ -1084,6 +1087,7 @@
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
||||
INFOPLIST_PREPROCESS = YES;
|
||||
PRODUCT_NAME = "Generate PList Prefix";
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
|
||||
@@ -50,6 +50,8 @@
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>LONG_VERSION</string>
|
||||
<key>CFBundleGitVersion</key>
|
||||
<string>GIT_VERSION</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SHORT_VERSION</string>
|
||||
<key>NSMainNibFile</key>
|
||||
|
||||
Reference in New Issue
Block a user