Skip to content

Commit

Permalink
Merge branch 'pu/jg/describe'
Browse files Browse the repository at this point in the history
* pu/jg/describe:
  About-Panel: Show git-describe using Info.plist
  • Loading branch information
pieter committed Sep 6, 2009
2 parents b86d2c4 + 0b81911 commit 5fc5990
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
1 change: 1 addition & 0 deletions ApplicationController.h
Expand Up @@ -28,6 +28,7 @@
- (NSManagedObjectContext *)managedObjectContext;

- (IBAction)openPreferencesWindow:(id)sender;
- (IBAction)showAboutPanel:(id)sender;

- (IBAction)installCliTool:(id)sender;

Expand Down
14 changes: 14 additions & 0 deletions ApplicationController.m
Expand Up @@ -92,6 +92,20 @@ - (IBAction)openPreferencesWindow:(id)sender
[[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;
Expand Down
6 changes: 4 additions & 2 deletions English.lproj/MainMenu.xib
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -2287,6 +2288,7 @@
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
Expand Down
8 changes: 6 additions & 2 deletions GitX.xcodeproj/project.pbxproj
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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";
};
Expand All @@ -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";
};
Expand Down Expand Up @@ -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;
};
Expand Down
2 changes: 2 additions & 0 deletions Info.plist
Expand Up @@ -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>
Expand Down

0 comments on commit 5fc5990

Please sign in to comment.