Skip to content

Commit 469a0e4

Browse files
gkdncopybara-github
authored andcommitted
Make jsinterop_annotation an annotation only target that provides jars.
This avoid cycle between open-source repos and also aligns with the more recent visibility changes that also affected open-source users. PiperOrigin-RevId: 784680899
1 parent c4af07a commit 469a0e4

File tree

3 files changed

+7
-36
lines changed

3 files changed

+7
-36
lines changed

BUILD

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
load("@bazel_skylib//rules:build_test.bzl", "build_test")
66
load("@rules_license//rules:license.bzl", "license")
7-
load("@com_google_j2cl//build_defs:rules.bzl", "j2cl_alias")
87

98
package(
109
default_applicable_licenses = ["//:license"],
@@ -26,7 +25,6 @@ build_test(
2625
name = "rule_test",
2726
targets = [
2827
":jsinterop-annotations",
29-
":jsinterop-annotations-j2cl",
3028
],
3129
)
3230

@@ -35,9 +33,3 @@ alias(
3533
actual = "//java/jsinterop/annotations:annotations",
3634
tags = ["avoid_dep"], # Use //third_party/java/jsinterop_annotations:jsinterop-annotations instead.
3735
)
38-
39-
j2cl_alias(
40-
name = "jsinterop-annotations-j2cl",
41-
actual = "//java/jsinterop/annotations:annotations-j2cl",
42-
tags = ["avoid_dep"], # Use //third_party/java/jsinterop_annotations:jsinterop-annotations-j2cl instead.
43-
)

MODULE.bazel

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@ module(
33
repo_name = "com_google_jsinterop_annotations",
44
)
55

6-
bazel_dep(name = "j2cl", repo_name = "com_google_j2cl", version = "20250630")
7-
8-
# Use head j2cl for testing purposes.
9-
archive_override(
10-
module_name = "j2cl",
11-
strip_prefix = "j2cl-master",
12-
urls = ["https://github.com/google/j2cl/archive/master.zip"],
13-
)
14-
156
bazel_dep(
167
name = "rules_java",
178
version = "8.13.0",
@@ -31,3 +22,9 @@ bazel_dep(
3122
name = "google_bazel_common",
3223
version = "0.0.1",
3324
)
25+
26+
# Bump the rules_python version to workaround https://github.com/bazel-contrib/rules_python/issues/1169
27+
bazel_dep(
28+
name = "rules_python",
29+
version = "1.4.1",
30+
)

java/jsinterop/annotations/BUILD

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
#
44

55
load("@google_bazel_common//tools/javadoc:javadoc.bzl", "javadoc_library")
6-
load("@rules_java//java:defs.bzl", "java_import", "java_library")
7-
load("@com_google_j2cl//build_defs:rules.bzl", "j2cl_import")
6+
load("@rules_java//java:defs.bzl", "java_library")
87

98
package(
109
default_applicable_licenses = ["//:license"],
@@ -26,20 +25,3 @@ javadoc_library(
2625
"notap",
2726
],
2827
)
29-
30-
# Re-import only the output jar, dropping all transitive dependencies in the
31-
# process. This is important for JsInterop Annotations as these are used by
32-
# the J2CL-emulated JRE itself and thus cannot have any dependencies outside of
33-
# toolchain's bootclasspath.
34-
java_import(
35-
name = "annotations-j2cl_jar",
36-
jars = [":libannotations.jar"],
37-
tags = ["incomplete-deps"],
38-
# Grant access to J2CL JRE to include it in the bootclasspath which is a java_library.
39-
visibility = ["@com_google_j2cl//third_party:__pkg__"],
40-
)
41-
42-
j2cl_import(
43-
name = "annotations-j2cl",
44-
jar = ":annotations-j2cl_jar",
45-
)

0 commit comments

Comments
 (0)