Skip to content

Commit

Permalink
Expose java stub template through @bazel_tools
Browse files Browse the repository at this point in the history
Currently rules_kotlin downloads this via raw.githubusercontent.com:

https://github.com/bazelbuild/rules_kotlin/blob/96c70d1d3cc788b03406f7db6a659c78d311c3d8/kotlin/internal/repositories/release_repositories.bzl#L55-L62

https://github.com/bazelbuild/rules_kotlin/blob/96c70d1d3cc788b03406f7db6a659c78d311c3d8/kotlin/internal/jvm/jvm.bzl#L135-L138

This will allow rules_kotlin to point at a file from Bazel proper,
rather than downloading it via the internet.

Closes bazelbuild#12994.

PiperOrigin-RevId: 368823466
  • Loading branch information
illicitonion authored and copybara-github committed Apr 16, 2021
1 parent 381a519 commit 8ace6db
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ filegroup(
visibility = ["//src:__subpackages__"],
)

exports_files(["java_stub_template.txt"])

java_library(
name = "java",
srcs = glob(
Expand Down
1 change: 1 addition & 0 deletions tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ filegroup(
"//tools/cpp:embedded_tools",
"//tools/genrule:srcs",
"//tools/java:embedded_tools",
"//tools/java:java_stub_template.txt",
"//tools/j2objc:srcs",
"//tools/jdk:package-srcs",
"//tools/jdk:srcs",
Expand Down
10 changes: 10 additions & 0 deletions tools/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ filegroup(
visibility = ["//tools:__pkg__"],
)

genrule(
name = "copy_java_stub_template",
srcs = [
"//src/main/java/com/google/devtools/build/lib/bazel/rules/java:java_stub_template.txt",
],
outs = ["java_stub_template.txt"],
cmd = "cp $< $@",
visibility = ["//tools:__pkg__"],
)

filegroup(
name = "embedded_tools",
srcs = ["//tools/java/runfiles:embedded_tools"],
Expand Down

0 comments on commit 8ace6db

Please sign in to comment.