Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit bfbd289

Browse files
committed
Add build identifer to revbuild.h
This commit adds MC_BUILD_IDENTIFIER to revbuild.h as a concatenation of the build number and commit hash.
1 parent 0e53aca commit bfbd289

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

engine/engine-common.gyp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
[
3131
'<@(perl)',
3232
'../util/encode_version.pl',
33+
'-<(git_revision)',
3334
'.',
3435
'<(SHARED_INTERMEDIATE_DIR)',
3536
],

engine/include/revbuild.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
3232
#define MC_BUILD_FILE_SHORT_VERSION MC_BUILD_ENGINE_SHORT_VERSION
3333
#define MC_BUILD_FILE_LONG_VERSION MC_BUILD_ENGINE_LONG_VERSION
3434

35+
#define MC_BUILD_IDENTIFIER "$BUILD_REVISION$GIT_REVISION"
3536
#endif

util/encode_version.pl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ sub trim
99
return $trimmed;
1010
}
1111

12-
my $inputDir = $ARGV[0];
13-
my $outputDir = $ARGV[1];
12+
my $gitRevision = $ARGV[0];
13+
my $inputDir = $ARGV[1];
14+
my $outputDir = $ARGV[2];
1415

1516
# Open the file containing the variables
1617
open VARIABLES, "<" . $inputDir . "/../version"
@@ -36,6 +37,8 @@ sub trim
3637
$output =~ s/\$${varName}/${varValue}/g;
3738
}
3839

40+
$output =~ s/\$GIT_REVISION/${gitRevision}/g;
41+
3942
# Create the output file
4043
open OUTPUT, ">" . $outputDir . "/include/revbuild.h"
4144
or die "Could not open output file: $!";

0 commit comments

Comments
 (0)