Skip to content

Commit e3a4e45

Browse files
committed
Set the revision long hash in the Info.plist so we can send it to our crash report system.
1 parent 0d1e518 commit e3a4e45

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

Resources/Plists/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@
178178
<string></string>
179179
<key>SPVersionShortHash</key>
180180
<string></string>
181+
<key>SPVersionLongHash</key>
182+
<string></string>
181183
<key>FRFeedbackReporter.maxConsoleLogSize</key>
182184
<integer>10000</integer>
183185
<key>FRFeedbackReporter.targetURL</key>

Scripts/build-version.pl

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ sub _get_revision_number
5252
return `git log --oneline | wc -l` + $svn2git_migration_compensation;
5353
}
5454

55+
#
56+
# Get the rveision long hash from Git.
57+
#
58+
sub _get_revision_long_hash
59+
{
60+
return `git log -n 1 --pretty=format:%H`;
61+
}
62+
5563
#
5664
# Get the revision short hash from Git.
5765
#
@@ -89,21 +97,26 @@ sub _save_plist
8997
}
9098

9199
my $version = _get_revision_number();
92-
my $version_hash = _get_revision_short_hash();
100+
my $version_long_hash = _get_revision_long_hash();
101+
my $version_short_hash = _get_revision_short_hash();
93102

94-
$version_hash =~ s/\n//;
103+
$version_long_hash =~ s/\n//;
104+
$version_short_hash =~ s/\n//;
95105

96106
croak "$0: Unable to determine Git revision. Exiting..." unless $version;
97-
croak "$0: Unable to determine Git revision hash. Exiting..." unless $version_hash;
107+
croak "$0: Unable to determine Git revision hash. Exiting..." unless $version_long_hash;
108+
croak "$0: Unable to determine Git revision short hash. Exiting..." unless $version_short_hash;
98109

99110
my $info = _get_plist_content($plist_path);
100111

101112
$info =~ s/([\t ]+<key>CFBundleVersion<\/key>\n[\t ]+<string>).*?(<\/string>)/$1$version$2/;
102-
$info =~ s/([\t ]+<key>SPVersionShortHash<\/key>\n[\t ]+<string>).*?(<\/string>)/$1$version_hash$2/;
113+
$info =~ s/([\t ]+<key>SPVersionLongHash<\/key>\n[\t ]+<string>).*?(<\/string>)/$1$version_long_hash$2/;
114+
$info =~ s/([\t ]+<key>SPVersionShortHash<\/key>\n[\t ]+<string>).*?(<\/string>)/$1$version_short_hash$2/;
103115

104116
_save_plist($info, $plist_path);
105117

106118
printf("CFBunderVersion set to $version\n");
107-
printf("VersionShortHash set to $version_hash");
119+
printf("SPVersionLongHash set to $version_long_hash\n");
120+
printf("SPVersionShortHash set to $version_short_hash\n");
108121

109122
exit 0

0 commit comments

Comments
 (0)