Skip to content

Commit e4461f9

Browse files
committed
checkpoint
1 parent 408ec75 commit e4461f9

128 files changed

Lines changed: 258 additions & 168 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelrc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
# Compile/run with Java 21
2-
build --java_language_version=21
1+
# Enable Java 21
32
build --java_runtime_version=21
3+
build --java_language_version=21
44
build --tool_java_language_version=21
55
build --tool_java_runtime_version=21
66

7-
build --experimental_proto_descriptor_sets_include_source_info
8-
97
# Don't leak PATH and LD_LIBRARY_PATH into the build.
108
build --incompatible_strict_action_env
119

MODULE.bazel

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,24 @@ bazel_dep(name = "rules_tsickle", version = "1.0.0")
2424
bazel_dep(name = "rules_web_testing_java", version = "0.4.1")
2525
bazel_dep(name = "rules_webtesting", version = "0.4.1")
2626

27+
# google_bazel_common override is needed for @closure-compiler
28+
git_override(
29+
module_name = "google_bazel_common",
30+
# Pin to newer version to fix b/408030907
31+
commit = "2cab52929507935aa43d460a3976d3bedc814d3a",
32+
remote = "https://github.com/google/bazel-common",
33+
)
34+
35+
local_path_override(
36+
module_name = "rules_tsickle",
37+
path = "/Users/pcj/go/src/github.com/stackb/rules_tsickle",
38+
)
39+
40+
# local_path_override(
41+
# module_name = "closure-compiler",
42+
# path = "/Users/pcj/go/src/github.com/google/closure-compiler",
43+
# )
44+
2745
# -------------------------------------------------------------------
2846
# Overrides
2947
# -------------------------------------------------------------------
@@ -136,6 +154,14 @@ platform_http_file(
136154
],
137155
)
138156

157+
# -------------------------------------------------------------------
158+
# java configuration
159+
# -------------------------------------------------------------------
160+
161+
# Compatibility layer
162+
compat = use_extension("@rules_java//java:rules_java_deps.bzl", "compatibility_proxy")
163+
use_repo(compat, "compatibility_proxy")
164+
139165
# -------------------------------------------------------------------
140166
# maven configuration
141167
# -------------------------------------------------------------------
@@ -175,7 +201,8 @@ maven.artifact(
175201
name = "maven_rules_closure",
176202
artifact = "closure-compiler",
177203
group = "com.google.javascript",
178-
version = "v20250402", # Using maven.artifact here because the version number vxxxxx cannot parsed correctly.
204+
# version = "v20250402", # Using maven.artifact here because the version number vxxxxx cannot parsed correctly.
205+
version = "v20250820", # Using maven.artifact here because the version number vxxxxx cannot parsed correctly.
179206
)
180207
maven.override(
181208
name = "maven_rules_closure",

README.md

Lines changed: 6 additions & 6 deletions

closure/compiler/closure_js_library.bzl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ load(
2525
"ClosureJsLibraryInfo",
2626
"JS_FILE_TYPE",
2727
"JS_LANGUAGE_IN",
28+
"JS_OR_ZIP_FILE_TYPE",
2829
"collect_js",
2930
"collect_runfiles",
3031
"convert_path_to_es6_module_name",
@@ -72,6 +73,9 @@ def create_closure_js_library(
7273
but also propagate up to closure_js_binary.
7374
lenient: makes the library lenient which suppresses handful of checkings in
7475
one shot.
76+
convention: naming convention for the library (default: "CLOSURE")
77+
internal_descriptors: depset of protobuf descriptor files
78+
artifact_suffix: suffix to append to generated artifact names
7579
7680
Returns:
7781
A closure_js_library metadata struct with exports and closure_js_library attribute
@@ -202,10 +206,6 @@ def _closure_js_library_impl(
202206
args.add("--output_ijs_file", ijs_file)
203207
args.add("--convention", convention)
204208

205-
# Because JsChecker is an edge in the build graph, we need to declare all of
206-
# its input vertices.
207-
inputs = []
208-
209209
# We want to test the failure conditions of this rule from within Bazel,
210210
# rather than from a meta-system like shell scripts. In order to do that, we
211211
# need a way to toggle the return status of the process.
@@ -375,12 +375,14 @@ def _closure_js_library(ctx):
375375
if not ctx.files.srcs and (ctx.attr.suppress or ctx.attr.lenient):
376376
fail("'srcs' must be set when using 'suppress' or 'lenient'")
377377
if ctx.attr.language:
378+
# buildifier: disable=print
378379
print("The closure_js_library 'language' attribute is now removed and " +
379380
"is always set to " + JS_LANGUAGE_IN)
380381

381382
# Create a list of the sources defined by this specific rule.
382383
srcs = ctx.files.srcs
383384
if ctx.files.externs:
385+
# buildifier: disable=print
384386
print("closure_js_library 'externs' is deprecated; just use 'srcs'")
385387
srcs = ctx.files.externs + srcs
386388

@@ -438,7 +440,7 @@ closure_js_library = rule(
438440
),
439441
"includes": attr.string_list(),
440442
"no_closure_library": attr.bool(),
441-
"srcs": attr.label_list(allow_files = JS_FILE_TYPE),
443+
"srcs": attr.label_list(allow_files = JS_OR_ZIP_FILE_TYPE),
442444
"suppress": attr.string_list(),
443445
"lenient": attr.bool(),
444446

closure/compiler/test/app/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ load(
88
"closure_js_template_library",
99
"web_library",
1010
)
11-
load("@io_bazel_rules_closure//closure/protobuf:defs.bzl", "closure_jspb_library")
11+
load("//closure/protobuf:defs.bzl", "closure_jspb_library")
1212

1313
package(default_testonly = True)
1414

closure/goog/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# They are too different to attempt a copybara transform between them.
33
# This file is used in the closure-library repo by external Bazel users (via io_bazel_rules_closure)
44

5-
load("@io_bazel_rules_closure//closure/compiler:closure_base_js_library.bzl", "closure_base_js_library")
5+
load("//closure/compiler:closure_base_js_library.bzl", "closure_base_js_library")
66

77
package(default_visibility = ["//visibility:public"])
88

closure/goog/a11y/aria/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
1+
load("//closure:defs.bzl", "closure_js_library")
22

33
package(default_visibility = ["//visibility:public"])
44

closure/goog/array/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
1+
load("//closure:defs.bzl", "closure_js_library")
22

33
package(default_visibility = ["//visibility:public"])
44

closure/goog/asserts/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
1+
load("//closure:defs.bzl", "closure_js_library")
22

33
package(default_visibility = ["//visibility:public"])
44

closure/goog/async/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
1+
load("//closure:defs.bzl", "closure_js_library")
22

33
package(default_visibility = ["//visibility:public"])
44

0 commit comments

Comments
 (0)