From e3a4e458ea66bbd5cb3440c0b6402c5ad5031e58 Mon Sep 17 00:00:00 2001 From: Stuart Connolly Date: Mon, 20 Jan 2014 20:32:50 +0000 Subject: [PATCH] Set the revision long hash in the Info.plist so we can send it to our crash report system. --- Resources/Plists/Info.plist | 2 ++ Scripts/build-version.pl | 23 ++++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Resources/Plists/Info.plist b/Resources/Plists/Info.plist index d2107a259..7522acc0e 100644 --- a/Resources/Plists/Info.plist +++ b/Resources/Plists/Info.plist @@ -178,6 +178,8 @@ SPVersionShortHash + SPVersionLongHash + FRFeedbackReporter.maxConsoleLogSize 10000 FRFeedbackReporter.targetURL diff --git a/Scripts/build-version.pl b/Scripts/build-version.pl index 27a615c7e..85ea429af 100755 --- a/Scripts/build-version.pl +++ b/Scripts/build-version.pl @@ -52,6 +52,14 @@ sub _get_revision_number return `git log --oneline | wc -l` + $svn2git_migration_compensation; } +# +# Get the rveision long hash from Git. +# +sub _get_revision_long_hash +{ + return `git log -n 1 --pretty=format:%H`; +} + # # Get the revision short hash from Git. # @@ -89,21 +97,26 @@ sub _save_plist } my $version = _get_revision_number(); -my $version_hash = _get_revision_short_hash(); +my $version_long_hash = _get_revision_long_hash(); +my $version_short_hash = _get_revision_short_hash(); -$version_hash =~ s/\n//; +$version_long_hash =~ s/\n//; +$version_short_hash =~ s/\n//; croak "$0: Unable to determine Git revision. Exiting..." unless $version; -croak "$0: Unable to determine Git revision hash. Exiting..." unless $version_hash; +croak "$0: Unable to determine Git revision hash. Exiting..." unless $version_long_hash; +croak "$0: Unable to determine Git revision short hash. Exiting..." unless $version_short_hash; my $info = _get_plist_content($plist_path); $info =~ s/([\t ]+CFBundleVersion<\/key>\n[\t ]+).*?(<\/string>)/$1$version$2/; -$info =~ s/([\t ]+SPVersionShortHash<\/key>\n[\t ]+).*?(<\/string>)/$1$version_hash$2/; +$info =~ s/([\t ]+SPVersionLongHash<\/key>\n[\t ]+).*?(<\/string>)/$1$version_long_hash$2/; +$info =~ s/([\t ]+SPVersionShortHash<\/key>\n[\t ]+).*?(<\/string>)/$1$version_short_hash$2/; _save_plist($info, $plist_path); printf("CFBunderVersion set to $version\n"); -printf("VersionShortHash set to $version_hash"); +printf("SPVersionLongHash set to $version_long_hash\n"); +printf("SPVersionShortHash set to $version_short_hash\n"); exit 0