Skip to content

Commit 7170aea

Browse files
hvadehrarules_java Copybara
authored andcommitted
Release rules_java v8.5.0-rc1
We now use a custom release notes generator because the one from `@rules_pkg` isn't suitable anymore for the new `WORKSPACE` setup PiperOrigin-RevId: 698036411 Change-Id: I73f6d6464c51abae4bbfc87fbfd71732839993f8
1 parent bc4a03f commit 7170aea

File tree

3 files changed

+49
-7
lines changed

3 files changed

+49
-7
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module(
22
name = "rules_java",
3-
version = "8.4.0",
3+
version = "8.5.0-rc1",
44
bazel_compatibility = [">=6.3.0"],
55
compatibility_level = 1,
66
)

distro/BUILD.bazel

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
2-
load("@rules_pkg//pkg/releasing:defs.bzl", "print_rel_notes")
2+
load(":relnotes.bzl", "print_rel_notes")
33

44
package(default_visibility = ["//visibility:private"])
55

@@ -18,10 +18,6 @@ pkg_tar(
1818

1919
print_rel_notes(
2020
name = "relnotes",
21-
outs = ["relnotes.txt"],
22-
deps_method = "rules_java_dependencies",
23-
repo = "rules_java",
24-
setup_file = "java:repositories.bzl",
25-
toolchains_method = "rules_java_toolchains",
21+
archive = ":rules_java-%s" % module_version(),
2622
version = module_version(),
2723
)

distro/relnotes.bzl

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
"""Release notes generator"""
2+
3+
def print_rel_notes(*, name, version, archive):
4+
native.genrule(
5+
name = name,
6+
outs = [name + ".txt"],
7+
cmd = """
8+
last_rel=$$(curl -s https://api.github.com/repos/bazelbuild/rules_java/releases/latest | grep 'tag_name' | cut -d: -f2 | tr -cd '[:alnum:].')
9+
changelog=$$(/usr/bin/git log tags/$$last_rel..origin/master --format=oneline --)
10+
sha=$$(/usr/bin/sha256sum $(SRCS) | cut -d ' ' -f1)
11+
cat > $@ <<EOF
12+
**Changes since $$last_rel
13+
$$changelog
14+
15+
**MODULE.bazel setup**
16+
~~~
17+
bazel_dep(name = "rules_java", version = "{VERSION}")
18+
~~~
19+
20+
**WORKSPACE setup**
21+
~~~
22+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
23+
http_archive(
24+
name = "rules_java",
25+
urls = [
26+
"https://github.com/bazelbuild/rules_java/releases/download/{VERSION}/rules_java-{VERSION}.tar.gz",
27+
],
28+
sha256 = "$$sha",
29+
)
30+
31+
load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
32+
rules_java_dependencies()
33+
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features") # buildifier: disable=bzl-visibility
34+
proto_bazel_features(name = "proto_bazel_features")
35+
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
36+
rules_java_toolchains()
37+
~~~
38+
39+
**Using the rules**
40+
See [the source](https://github.com/bazelbuild/rules_java/tree/{VERSION}).
41+
42+
EOF
43+
""".format(ARCHIVE = archive, VERSION = version),
44+
srcs = [archive],
45+
tags = ["local", "manual"],
46+
)

0 commit comments

Comments
 (0)