-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove
bootstrap
attribute & fix $(location) expansions i…
…n nodejs_binary templated_args BREAKING CHANGE: bootstrap attribute in nodejs_binary, nodejs_test & jasmine_node_test removed This can be replaced with the `--node_options=--require=$(location label)` argument such as, ``` nodejs_test( name = "bootstrap_test", templated_args = ["--node_options=--require=$(rlocation $(location :bootstrap.js))"], entry_point = ":bootstrap.spec.js", data = ["bootstrap.js"], ) ``` or ``` jasmine_node_test( name = "bootstrap_test", srcs = ["bootstrap.spec.js"], templated_args = ["--node_options=--require=$(rlocation $(location :bootstrap.js))"], data = ["bootstrap.js"], ) ``` `templated_args` `$(location)` and `$(locations)` are now correctly expanded when there is no space before ` $(location` such as `templated_args = ["--node_options=--require=$(rlocation $(location :bootstrap.js))"]`. Path is returned in runfiles manifest path format such as `repo/path/to/file`. This differs from how $(location) and $(locations) expansion behaves in expansion the `args` attribute of a *_binary or *_test which returns the runfiles short path of the format `./path/to/file` for user repo and `../external_repo/path/to/file` for external repositories. We may change this behavior in the future with $(mlocation) and $(mlocations) used to expand to the runfiles manifest path. See https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes-binaries.
- Loading branch information
1 parent
f938ab7
commit 1860a6a
Showing
12 changed files
with
161 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ exports_files([ | |
"common.bazelrc", | ||
"tsconfig.json", | ||
"package.json", | ||
"bootstrap.js", | ||
]) | ||
|
||
bzl_library( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
console.log('here') | ||
global.bootstrapped = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
console.log('here') | ||
global.bootstrapped = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
if (!global.bootstrapped) { | ||
console.error('should run bootstrap script first'); | ||
process.exitCode = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
global.bootstrapped = global.bootstrapped ? global.bootstrapped + 1 : 1; | ||
global.last_bootstrap = 'bootstrap1'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
global.bootstrapped = global.bootstrapped ? global.bootstrapped + 1 : 1; | ||
global.last_bootstrap = 'bootstrap2'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
if (global.bootstrapped !== 2) { | ||
console.error('should run 2 boostrap scripts'); | ||
process.exitCode = 1; | ||
} | ||
|
||
if (global.last_bootstrap !== 'bootstrap2') { | ||
console.error('should run bootstrap scripts in order'); | ||
process.exitCode = 1; | ||
} |