Skip to content

Commit

Permalink
Remove hidden naming convention based dependency to _transpile_gen an…
Browse files Browse the repository at this point in the history
…d make it an explicit attribute.

PiperOrigin-RevId: 570781951
  • Loading branch information
gkdn authored and copybara-github committed Oct 4, 2023
1 parent d7dd370 commit e493f5c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def j2cl_generate_jsunit_suite(name, test_class, deps, tags = []):
# files.)
out_jar = ":lib" + name + "_lib.jar"
native.genrule(
name = name + "_transpile_gen",
name = name,
outs = [name + ".js.zip"],
cmd = "\n".join([
"unzip -q $(location %s) *.testsuite *.json -d zip_out/" % out_jar,
Expand Down
6 changes: 3 additions & 3 deletions build_defs/internal_do_not_use/j2cl_js_common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ J2CL_TEST_DEFS = []
# buildifier: disable=function-docstring-args
def j2cl_web_test(
name,
src,
deps,
browsers,
data,
Expand All @@ -124,15 +125,14 @@ def j2cl_web_test(

# unzip generated_suite.js.zip and take 1 testsuite js file
# fail if multiple testsuites or suiteclasses are provided
out_zip = ":%s_generated_suite.js.zip" % name
native.genrule(
name = "gen" + name + "_test.js",
srcs = [out_zip],
srcs = [src],
outs = [
testsuite_file_name,
],
cmd = "\n".join([
"unzip -q -o $(locations %s) *.js -d zip_out/" % out_zip,
"unzip -q -o $(locations %s) *.js -d zip_out/" % src,
"cd zip_out/",
"mkdir -p ../$(RULEDIR)",
"if [ $$(find . -name *.js | wc -l) -ne 1 ]; then",
Expand Down
1 change: 1 addition & 0 deletions build_defs/internal_do_not_use/j2cl_test_common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ def j2cl_test_common(

j2cl_web_test(
name = name,
src = ":" + generated_suite_name,
deps = deps,
browsers = browsers,
data = data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def j2wasm_generate_jsunit_suite(
processed_wasm_path = wasm_path.replace("/", "\\/")

native.genrule(
name = name + "_transpile_gen",
name = name,
srcs = [out_jar],
outs = [name + ".js.zip"],
cmd = "\n".join([
Expand Down

0 comments on commit e493f5c

Please sign in to comment.