@@ -37,21 +37,38 @@ const path = require("path");
37
37
const runCommand = require ( "./run-command" ) ;
38
38
const childProcess = require ( "child_process" ) ;
39
39
40
- const compilerTargetName = "compiler_unshaded_deploy.jar" ;
40
+ /**
41
+ * The compiler version that will be built.
42
+ *
43
+ * For release builds, this is of the form: "vYYYYMMDD"
44
+ * For nightly builds, this is "1.0-SNAPSHOT"
45
+ *
46
+ * @type {string }
47
+ */
48
+ const compilerVersion = process . env . COMPILER_NIGHTLY == 'true'
49
+ ? 'SNAPSHOT-1.0'
50
+ : String (
51
+ childProcess . execSync ( 'git tag --points-at HEAD' , {
52
+ cwd : './compiler' ,
53
+ } )
54
+ ) . trim ( ) ;
55
+
56
+ const compilerTargetName = compilerVersion === 'SNAPSHOT-1.0' || parseInt ( compilerVersion . slice ( 1 ) , 10 ) > 20221004 ?
57
+ 'compiler_uber_deploy.jar' : 'compiler_unshaded_deploy.jar' ;
41
58
const compilerJavaBinaryPath = `./compiler/bazel-bin/${ compilerTargetName } ` ;
42
59
43
60
async function main ( ) {
44
61
console . log ( process . platform , process . arch , compilerVersion ) ;
45
62
46
63
const { exitCode } = await runCommand (
47
- " bazelisk" ,
64
+ ' bazelisk' ,
48
65
[
49
- " build" ,
50
- " --color=yes" ,
66
+ ' build' ,
67
+ ' --color=yes' ,
51
68
`//:${ compilerTargetName } ` ,
52
69
`--define=COMPILER_VERSION=${ compilerVersion } ` ,
53
70
] ,
54
- { cwd : " ./compiler" }
71
+ { cwd : ' ./compiler' }
55
72
) ;
56
73
if ( exitCode !== 0 ) {
57
74
throw new Error ( exitCode ) ;
@@ -60,40 +77,24 @@ async function main() {
60
77
return Promise . all ( [
61
78
copy (
62
79
compilerJavaBinaryPath ,
63
- " ./packages/google-closure-compiler-java/compiler.jar"
80
+ ' ./packages/google-closure-compiler-java/compiler.jar'
64
81
) ,
65
82
copy (
66
83
compilerJavaBinaryPath ,
67
- " ./packages/google-closure-compiler-linux/compiler.jar"
84
+ ' ./packages/google-closure-compiler-linux/compiler.jar'
68
85
) ,
69
86
copy (
70
87
compilerJavaBinaryPath ,
71
- " ./packages/google-closure-compiler-osx/compiler.jar"
88
+ ' ./packages/google-closure-compiler-osx/compiler.jar'
72
89
) ,
73
90
copy (
74
91
compilerJavaBinaryPath ,
75
- " ./packages/google-closure-compiler-windows/compiler.jar"
92
+ ' ./packages/google-closure-compiler-windows/compiler.jar'
76
93
) ,
77
- copy ( " ./compiler/contrib" , " ./packages/google-closure-compiler/contrib" ) ,
94
+ copy ( ' ./compiler/contrib' , ' ./packages/google-closure-compiler/contrib' ) ,
78
95
] ) ;
79
96
}
80
97
81
- /**
82
- * The compiler version that will be built.
83
- *
84
- * For release builds, this is of the form: "vYYYYMMDD"
85
- * For nightly builds, this is "1.0-SNAPSHOT"
86
- *
87
- * @type {string }
88
- */
89
- const compilerVersion = process . env . COMPILER_NIGHTLY == 'true'
90
- ? "SNAPSHOT-1.0"
91
- : String (
92
- childProcess . execSync ( "git tag --points-at HEAD" , {
93
- cwd : "./compiler" ,
94
- } )
95
- ) . trim ( ) ;
96
-
97
98
/**
98
99
* @param {string } src path to source file or folder
99
100
* @param {string } dest path to destination file or folder
0 commit comments