Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Compile/run with Java 21
build --java_language_version=21
# Enable Java 21
build --java_runtime_version=21
build --java_language_version=21
build --tool_java_language_version=21
build --tool_java_runtime_version=21

build --experimental_proto_descriptor_sets_include_source_info

# Don't leak PATH and LD_LIBRARY_PATH into the build.
build --incompatible_strict_action_env

Expand Down
61 changes: 56 additions & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module(
# -------------------------------------------------------------------

bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "build_stack_rules_proto", version = "4.1.0")
bazel_dep(name = "build_stack_rules_proto", version = "4.1.1")
bazel_dep(name = "closure-templates", version = "1.0.1")
bazel_dep(name = "google_bazel_common", version = "0.0.1")
bazel_dep(name = "platforms", version = "1.0.0")
Expand All @@ -20,10 +20,18 @@ bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "rules_jvm_external", version = "6.8")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_python", version = "1.5.3")
bazel_dep(name = "rules_tsickle", version = "1.0.0")
bazel_dep(name = "rules_tsickle", version = "1.1.0")
bazel_dep(name = "rules_web_testing_java", version = "0.4.1")
bazel_dep(name = "rules_webtesting", version = "0.4.1")

# google_bazel_common override is needed for @closure-compiler
git_override(
module_name = "google_bazel_common",
# Pin to newer version to fix b/408030907
commit = "2cab52929507935aa43d460a3976d3bedc814d3a",
remote = "https://github.com/google/bazel-common",
)

# -------------------------------------------------------------------
# Overrides
# -------------------------------------------------------------------
Expand All @@ -45,6 +53,21 @@ archive_override(
patch_strip = 1,
)

# Commit: 04fc63fb40bf30d2e5e0b3786028eb41218de979
# Date: 2025-10-09 04:43:15 +0000 UTC
# URL: https://github.com/stackb/rules_proto/commit/04fc63fb40bf30d2e5e0b3786028eb41218de979
#
# Remove lock file for @maven
#
# It is shared by multiple workspaces and seems to cause problems when locked
# Size: 4088796 (4.1 MB)
archive_override(
module_name = "build_stack_rules_proto",
sha256 = "aff21579deef91316c726582bec71c621dde2ae2ec74099a55b637bda8997333",
strip_prefix = "rules_proto-04fc63fb40bf30d2e5e0b3786028eb41218de979",
urls = ["https://github.com/stackb/rules_proto/archive/04fc63fb40bf30d2e5e0b3786028eb41218de979.tar.gz"],
)

# -------------------------------------------------------------------
# additional http dependencies
# -------------------------------------------------------------------
Expand Down Expand Up @@ -121,12 +144,36 @@ platform_http_file(
],
)

# -------------------------------------------------------------------
# java configuration
# -------------------------------------------------------------------

# Compatibility layer
compat = use_extension("@rules_java//java:rules_java_deps.bzl", "compatibility_proxy")
use_repo(compat, "compatibility_proxy")

# -------------------------------------------------------------------
# maven configuration
# -------------------------------------------------------------------

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")

# NOTE: even though we isolate OUR maven deps into a separate namespace, we
# still need the ones from other contributing modules. That is why this
# maven.install() declaration exists, and I am surprised bzlmod /
# rules_jvm_external works this way.
maven.install(
name = "maven",
known_contributing_modules = [
"build_stack_rules_proto",
"grpc-java",
"io_bazel_rules_closure",
"protobuf",
"rules_web_testing_java",
],
)
maven.install(
name = "maven_rules_closure",
artifacts = [
"args4j:args4j:2.33",
"com.google.closure-stylesheets:closure-stylesheets:1.5.0",
Expand All @@ -138,14 +185,18 @@ maven.install(
"org.seleniumhq.selenium:selenium-api:4.27.0",
"org.seleniumhq.selenium:selenium-support:4.27.0",
],
lock_file = "//:maven_rules_closure_install.json",
)
maven.artifact(
name = "maven_rules_closure",
artifact = "closure-compiler",
group = "com.google.javascript",
version = "v20250402", # Using maven.artifact here because the version number vxxxxx cannot parsed correctly.
# version = "v20250402", # Using maven.artifact here because the version number vxxxxx cannot parsed correctly.
version = "v20250820", # Using maven.artifact here because the version number vxxxxx cannot parsed correctly.
)
maven.override(
name = "maven_rules_closure",
coordinates = "javacc:javacc",
target = "@maven//:net_java_dev_javacc_javacc", # javacc:javacc was not updated since 2008 and relocated to net.java.dev.javacc
target = "@maven_rules_closure//:net_java_dev_javacc_javacc", # javacc:javacc was not updated since 2008 and relocated to net.java.dev.javacc
)
use_repo(maven, "maven")
use_repo(maven, "maven_rules_closure")
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Please see the test directories within this project for concrete examples of usa
## closure\_js\_library

```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")
closure_js_library(name, srcs, data, deps, exports, suppress, convention,
no_closure_library)
```
Expand Down Expand Up @@ -206,7 +206,7 @@ This rule can be referenced as though it were the following:
## closure\_js\_binary

```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_binary")
load("//closure:defs.bzl", "closure_js_binary")
closure_js_binary(name, deps, css, debug, language, entry_points,
dependency_mode, compilation_level, formatting,
output_wrapper, property_renaming_report, defs)
Expand Down Expand Up @@ -340,7 +340,7 @@ closure_js_binary(
## closure\_js\_test

```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_test")
load("//closure:defs.bzl", "closure_js_test")
closure_js_test(name, srcs, data, deps, css, html, language, suppress,
compilation_level, entry_points, defs)
```
Expand Down Expand Up @@ -412,7 +412,7 @@ This rule can be referenced as though it were the following:
## phantomjs\_test

```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "phantomjs_test")
load("//closure:defs.bzl", "phantomjs_test")
phantomjs_test(name, data, deps, html, harness, runner)
```

Expand Down Expand Up @@ -460,7 +460,7 @@ This rule can be referenced as though it were the following:
## closure\_css\_library

```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_css_library")
load("//closure:defs.bzl", "closure_css_library")
closure_css_library(name, srcs, data, deps)
```

Expand Down Expand Up @@ -523,7 +523,7 @@ This rule can be referenced as though it were the following:
## closure\_css\_binary

```starlark
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_css_binary")
load("//closure:defs.bzl", "closure_css_binary")
closure_css_binary(name, deps, renaming, debug, defs)
```

Expand Down
2 changes: 1 addition & 1 deletion closure/compiler/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ licenses(["notice"])

java_library(
name = "compiler",
exports = ["@maven//:com_google_javascript_closure_compiler"],
exports = ["@maven_rules_closure//:com_google_javascript_closure_compiler"],
)

bzl_library(
Expand Down
12 changes: 7 additions & 5 deletions closure/compiler/closure_js_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ load(
"ClosureJsLibraryInfo",
"JS_FILE_TYPE",
"JS_LANGUAGE_IN",
"JS_OR_ZIP_FILE_TYPE",
"collect_js",
"collect_runfiles",
"convert_path_to_es6_module_name",
Expand Down Expand Up @@ -72,6 +73,9 @@ def create_closure_js_library(
but also propagate up to closure_js_binary.
lenient: makes the library lenient which suppresses handful of checkings in
one shot.
convention: naming convention for the library (default: "CLOSURE")
internal_descriptors: depset of protobuf descriptor files
artifact_suffix: suffix to append to generated artifact names

Returns:
A closure_js_library metadata struct with exports and closure_js_library attribute
Expand Down Expand Up @@ -202,10 +206,6 @@ def _closure_js_library_impl(
args.add("--output_ijs_file", ijs_file)
args.add("--convention", convention)

# Because JsChecker is an edge in the build graph, we need to declare all of
# its input vertices.
inputs = []

# We want to test the failure conditions of this rule from within Bazel,
# rather than from a meta-system like shell scripts. In order to do that, we
# need a way to toggle the return status of the process.
Expand Down Expand Up @@ -375,12 +375,14 @@ def _closure_js_library(ctx):
if not ctx.files.srcs and (ctx.attr.suppress or ctx.attr.lenient):
fail("'srcs' must be set when using 'suppress' or 'lenient'")
if ctx.attr.language:
# buildifier: disable=print
print("The closure_js_library 'language' attribute is now removed and " +
"is always set to " + JS_LANGUAGE_IN)

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

Expand Down Expand Up @@ -438,7 +440,7 @@ closure_js_library = rule(
),
"includes": attr.string_list(),
"no_closure_library": attr.bool(),
"srcs": attr.label_list(allow_files = JS_FILE_TYPE),
"srcs": attr.label_list(allow_files = JS_OR_ZIP_FILE_TYPE),
"suppress": attr.string_list(),
"lenient": attr.bool(),

Expand Down
4 changes: 2 additions & 2 deletions closure/compiler/test/app/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")
load(
"@io_bazel_rules_closure//closure:defs.bzl",
"//closure:defs.bzl",
"closure_css_binary",
"closure_css_library",
"closure_js_binary",
"closure_js_library",
"closure_js_template_library",
"web_library",
)
load("@io_bazel_rules_closure//closure/protobuf:defs.bzl", "closure_jspb_library")
load("//closure/protobuf:defs.bzl", "closure_jspb_library")

package(default_testonly = True)

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# They are too different to attempt a copybara transform between them.
# This file is used in the closure-library repo by external Bazel users (via io_bazel_rules_closure)

load("@io_bazel_rules_closure//closure/compiler:closure_base_js_library.bzl", "closure_base_js_library")
load("//closure/compiler:closure_base_js_library.bzl", "closure_base_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/a11y/aria/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/array/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/asserts/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/async/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/bootstrap/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/collections/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/color/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/crypt/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/cssom/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/cssom/iframe/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/date/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/db/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/debug/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/debug/devcss/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/delegate/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/disposable/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/dom/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/dom/animationframe/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/dom/browserrange/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/editor/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/editor/plugins/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
2 changes: 1 addition & 1 deletion closure/goog/events/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
load("//closure:defs.bzl", "closure_js_library")

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

Expand Down
Loading