Skip to content

Commit 71bd351

Browse files
authored
Merge pull request #278 from google/fix-build-script
Utilize the package version for the compiler build
2 parents 17e3ca4 + a64400e commit 71bd351

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

build-scripts/build_compiler.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@
3232
"use strict";
3333

3434
const ncp = require("ncp");
35-
const fs = require("fs");
36-
const path = require("path");
3735
const runCommand = require("./run-command");
38-
const childProcess = require("child_process");
36+
const packageInfo = require("../package.json");
37+
const semver = require("semver");
3938

4039
/**
4140
* The compiler version that will be built.
@@ -47,11 +46,7 @@ const childProcess = require("child_process");
4746
*/
4847
const compilerVersion = process.env.COMPILER_NIGHTLY == 'true'
4948
? 'SNAPSHOT-1.0'
50-
: String(
51-
childProcess.execSync('git tag --points-at HEAD', {
52-
cwd: './compiler',
53-
})
54-
).trim();
49+
: `v${semver.major(packageInfo.version)}`;
5550

5651
const compilerTargetName = compilerVersion === 'SNAPSHOT-1.0' || parseInt(compilerVersion.slice(1), 10) > 20221004 ?
5752
'compiler_uberjar_deploy.jar' : 'compiler_unshaded_deploy.jar';

0 commit comments

Comments
 (0)