Skip to content

Commit 7a625ca

Browse files
fmeumrules_java Copybara
authored andcommitted
Add JDK 25 (#319)
Closes #319 COPYBARA_INTEGRATE_REVIEW=#319 from fmeum:jdk-25 ddc4341 PiperOrigin-RevId: 810016900 Change-Id: Icecc0ee3056f1ac357ad92b46c5509403c42adb1
1 parent 0423b07 commit 7a625ca

5 files changed

Lines changed: 81 additions & 2 deletions

File tree

MODULE.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ JDKS = {
9999
"win",
100100
"win_arm64",
101101
],
102+
"25": [
103+
"linux",
104+
"linux_aarch64",
105+
"macos",
106+
"macos_aarch64",
107+
"win",
108+
"win_arm64",
109+
],
102110
}
103111

104112
REMOTE_JDK_REPOS = [(("remote_jdk" if version == "8" else "remotejdk") + version + "_" + platform) for version in JDKS for platform in JDKS[version]]

java/bazel/repositories_util.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ _RELEASE_CONFIGS = {
8686
},
8787
},
8888
},
89+
"25": {
90+
"zulu": {
91+
"release": "25.28.85-ca-jdk25.0.0",
92+
"platforms": {
93+
"linux": ["aarch64", "x86_64"],
94+
"macos": ["aarch64", "x86_64"],
95+
"windows": ["arm64", "x86_64"],
96+
},
97+
},
98+
},
8999
}
90100

91101
_STRIP_PREFIX_OVERRIDES = {

java/extensions.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ load(
2121
"remote_jdk11_repos",
2222
"remote_jdk17_repos",
2323
"remote_jdk21_repos",
24+
"remote_jdk25_repos",
2425
"remote_jdk8_repos",
2526
)
2627
load("//toolchains:extensions.bzl", _java_repository = "java_repository")
@@ -32,6 +33,7 @@ def _toolchains_impl(module_ctx):
3233
remote_jdk11_repos()
3334
remote_jdk17_repos()
3435
remote_jdk21_repos()
36+
remote_jdk25_repos()
3537

3638
if bazel_features.external_deps.extension_metadata_has_reproducible:
3739
return module_ctx.extension_metadata(reproducible = True)

java/repositories.bzl

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,54 @@ _REMOTE_JDK_CONFIGS_LIST = [
325325
urls = ["https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.6+7/OpenJDK21U-jdk_s390x_linux_hotspot_21.0.6_7.tar.gz", "https://mirror.bazel.build/github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.6+7/OpenJDK21U-jdk_s390x_linux_hotspot_21.0.6_7.tar.gz"],
326326
version = "21",
327327
),
328+
struct(
329+
name = "remotejdk25_linux_aarch64",
330+
target_compatible_with = ["@platforms//os:linux", "@platforms//cpu:aarch64"],
331+
sha256 = "b60eb9d54c97ba4159547834a98cc5d016281dd2b3e60e7475cba4911324bcb4",
332+
strip_prefix = "zulu25.28.85-ca-jdk25.0.0-linux_aarch64",
333+
urls = ["https://cdn.azul.com/zulu/bin/zulu25.28.85-ca-jdk25.0.0-linux_aarch64.tar.gz", "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu25.28.85-ca-jdk25.0.0-linux_aarch64.tar.gz"],
334+
version = "25",
335+
),
336+
struct(
337+
name = "remotejdk25_linux",
338+
target_compatible_with = ["@platforms//os:linux", "@platforms//cpu:x86_64"],
339+
sha256 = "164d901e5a240b8c18516f5ab55bc11fc9689ab6e829045aea8467356dcdb340",
340+
strip_prefix = "zulu25.28.85-ca-jdk25.0.0-linux_x64",
341+
urls = ["https://cdn.azul.com/zulu/bin/zulu25.28.85-ca-jdk25.0.0-linux_x64.tar.gz", "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu25.28.85-ca-jdk25.0.0-linux_x64.tar.gz"],
342+
version = "25",
343+
),
344+
struct(
345+
name = "remotejdk25_macos_aarch64",
346+
target_compatible_with = ["@platforms//os:macos", "@platforms//cpu:aarch64"],
347+
sha256 = "73f64f6bad7c3df31fba740fbcbbbef7c1a5cedeffbb5df386dd79bc72aba9b6",
348+
strip_prefix = "zulu25.28.85-ca-jdk25.0.0-macosx_aarch64",
349+
urls = ["https://cdn.azul.com/zulu/bin/zulu25.28.85-ca-jdk25.0.0-macosx_aarch64.tar.gz", "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu25.28.85-ca-jdk25.0.0-macosx_aarch64.tar.gz"],
350+
version = "25",
351+
),
352+
struct(
353+
name = "remotejdk25_macos",
354+
target_compatible_with = ["@platforms//os:macos", "@platforms//cpu:x86_64"],
355+
sha256 = "c2cde1d313d904b793c3760214eefa207ecca7df04e7c4084abdf1f6bbebc27a",
356+
strip_prefix = "zulu25.28.85-ca-jdk25.0.0-macosx_x64",
357+
urls = ["https://cdn.azul.com/zulu/bin/zulu25.28.85-ca-jdk25.0.0-macosx_x64.tar.gz", "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu25.28.85-ca-jdk25.0.0-macosx_x64.tar.gz"],
358+
version = "25",
359+
),
360+
struct(
361+
name = "remotejdk25_win_arm64",
362+
target_compatible_with = ["@platforms//os:windows", "@platforms//cpu:arm64"],
363+
sha256 = "f5f6d8a913695649e8e2607fe0dc79c81953b2583013ac1fb977c63cb4935bfb",
364+
strip_prefix = "zulu25.28.85-ca-jdk25.0.0-win_aarch64",
365+
urls = ["https://cdn.azul.com/zulu/bin/zulu25.28.85-ca-jdk25.0.0-win_aarch64.zip", "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu25.28.85-ca-jdk25.0.0-win_aarch64.zip"],
366+
version = "25",
367+
),
368+
struct(
369+
name = "remotejdk25_win",
370+
target_compatible_with = ["@platforms//os:windows", "@platforms//cpu:x86_64"],
371+
sha256 = "5efcf4e6a613cae06c8041de8a3695b7346aad0307d397b66bf55281cf1a5cb6",
372+
strip_prefix = "zulu25.28.85-ca-jdk25.0.0-win_x64",
373+
urls = ["https://cdn.azul.com/zulu/bin/zulu25.28.85-ca-jdk25.0.0-win_x64.zip", "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu25.28.85-ca-jdk25.0.0-win_x64.zip"],
374+
version = "25",
375+
),
328376
]
329377

330378
def _make_version_to_remote_jdks():
@@ -369,6 +417,10 @@ def remote_jdk21_repos():
369417
"""Imports OpenJDK 21 repositories."""
370418
_remote_jdk_repos_for_version("21")
371419

420+
def remote_jdk25_repos():
421+
"""Imports OpenJDK 25 repositories."""
422+
_remote_jdk_repos_for_version("25")
423+
372424
def rules_java_dependencies():
373425
"""DEPRECATED: No-op, kept for backwards compatibility"""
374426
print("DEPRECATED: use rules_java_dependencies() from rules_java_deps.bzl") # buildifier: disable=print
@@ -384,6 +436,7 @@ def rules_java_toolchains(name = "toolchains"):
384436
remote_jdk11_repos()
385437
remote_jdk17_repos()
386438
remote_jdk21_repos()
439+
remote_jdk25_repos()
387440
java_tools_repos()
388441

389442
native.register_toolchains(

toolchains/BUILD

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,12 @@ alias(
353353
actual = ":toolchain",
354354
)
355355

356-
RELEASES = (8, 9, 10, 11, 17, 21)
356+
RELEASES = (8, 9, 10, 11, 17, 21, 25)
357357

358358
[
359359
default_java_toolchain(
360360
name = ("toolchain_java%d" if release <= 11 else "toolchain_jdk_%d") % release,
361-
configuration = DEFAULT_TOOLCHAIN_CONFIGURATION,
361+
configuration = DEFAULT_TOOLCHAIN_CONFIGURATION if release <= 21 else DEFAULT_TOOLCHAIN_CONFIGURATION | {"java_runtime": ":remotejdk_%d" % release},
362362
source_version = "%s" % release,
363363
target_version = "%s" % release,
364364
)
@@ -390,6 +390,12 @@ java_runtime_version_alias(
390390
visibility = ["//visibility:public"],
391391
)
392392

393+
java_runtime_version_alias(
394+
name = "remotejdk_25",
395+
runtime_version = "remotejdk_25",
396+
visibility = ["//visibility:public"],
397+
)
398+
393399
java_runtime_version_alias(
394400
name = "jdk_8",
395401
runtime_version = "8",

0 commit comments

Comments
 (0)