Skip to content

Commit

Permalink
Add JDK 21 support and update several things
Browse files Browse the repository at this point in the history
  • Loading branch information
jjudd committed Jul 25, 2024
1 parent a45c893 commit e5c8316
Show file tree
Hide file tree
Showing 9 changed files with 229 additions and 178 deletions.
7 changes: 6 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ common --noenable_bzlmod

common:ci --color=yes

build --java_language_version="21"
build --java_runtime_version="remotejdk_21"
build --tool_java_language_version="21"
build --tool_java_runtime_version="remotejdk_21"

build:ci --verbose_failures
build:ci --sandbox_debug
build:ci --spawn_strategy=standalone
build:ci --genrule_strategy=standalone

test:ci --test_strategy=standalone
test:ci --test_output=errors
test:ci --test_output=all
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bazelbuild/7.1.1
bazelbuild/7.2.1
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ on:

jobs:
build-and-test:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
- uses: bazel-contrib/[email protected].1
- uses: bazel-contrib/[email protected].5
with:
bazelisk-version: 1.19.0
bazelisk-version: 1.20.0
- run: cat .bazelrc.ci >> .bazelrc
- run: ./scripts/format.sh check
- run: ./test/run_all_tests.sh ci

publish:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: build-and-test
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
- uses: bazel-contrib/[email protected].1
- uses: bazel-contrib/[email protected].5
with:
bazelisk-version: 1.19.0
bazelisk-version: 1.20.0
- run: cat .bazelrc.ci >> .bazelrc
- name: Parse Tag
run: |
Expand Down
13 changes: 13 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier", "buildifier_test")
load(
"@rules_java//toolchains:default_java_toolchain.bzl",
"DEFAULT_TOOLCHAIN_CONFIGURATION",
"default_java_toolchain",
)

default_java_toolchain(
name = "repository_default_toolchain_21",
configuration = DEFAULT_TOOLCHAIN_CONFIGURATION,
java_runtime = "@rules_java//toolchains:remotejdk_21",
source_version = "21",
target_version = "21",
)

buildifier(
name = "buildifier",
Expand Down
35 changes: 20 additions & 15 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ workspace(name = "twirl_compiler_cli")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# rules_java
http_archive(
name = "rules_java",
sha256 = "647bb31c0d51882549def6f67ee9078df697043406ed4a5144bbdf3b17f91e33",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/7.8.0/rules_java-7.8.0.tar.gz",
],
)

load("@rules_java//java:repositories.bzl", "rules_java_dependencies")

rules_java_dependencies()

register_toolchains("//:repository_default_toolchain_21_definition")

# rules_jvm_external
rules_jvm_external_version = "6.0"

Expand Down Expand Up @@ -44,14 +59,14 @@ load(
twirl_compiler_cli_test_pinned_maven_install()

# higherkindness/rules_scala
rules_scala_annex_version = "5df571de1c0803736c8e1846fa7a0faa3e21d6c6"
rules_scala_annex_version = "f781c283796f87779f378785640974f05f543bbc"

http_archive(
name = "rules_scala_annex",
sha256 = "47b700e458de2478428348408b403cccfc93cd2c2b47499275b790d514ad9bd2",
integrity = "sha256-D7FHVz5ZzrEdFpII9EW+jb9DMN6/jOjYLsA3twCnWvw=",
strip_prefix = "rules_scala-{}".format(rules_scala_annex_version),
type = "zip",
url = "https://github.com/higherkindness/rules_scala/archive/{}.zip".format(rules_scala_annex_version),
url = "https://github.com/lucidsoftware/rules_scala/archive/{}.zip".format(rules_scala_annex_version),
)

bind(
Expand All @@ -64,10 +79,6 @@ load(
"scala_register_toolchains",
"scala_repositories",
)
load(
"@rules_scala_annex//rules/scala:workspace_3.bzl",
"scala_3_repositories",
)

scala_repositories()

Expand All @@ -77,12 +88,6 @@ annex_pinned_maven_install()

scala_register_toolchains()

scala_3_repositories()

load("@annex_3//:defs.bzl", annex_3_pinned_maven_install = "pinned_maven_install")

annex_3_pinned_maven_install()

# Skylib
skylib_version = "1.5.0" # update this as needed

Expand Down Expand Up @@ -162,11 +167,11 @@ load("@com_github_bazelbuild_buildtools//buildifier:deps.bzl", "buildifier_depen
buildifier_dependencies()

# bazel-common
bazelcommon_version = "5a98ecc1193057db05a19c19a5853f95703749c4"
bazelcommon_version = "3d605944eb8d238ad8eeecb8cb2021900bfb12ae"

http_archive(
name = "bazel-common",
sha256 = "22ebc5e9595b9739ac56cf83ed3ab1b2186ca9413f80dfc1326e70dc40b89e1e",
sha256 = "340197de85263270dd45ab4f9925aa9e3b367abae941208e7bf9a653b31b5b76",
strip_prefix = "bazel-common-{}".format(bazelcommon_version),
type = "zip",
url = "https://github.com/google/bazel-common/archive/{}.zip".format(bazelcommon_version),
Expand Down
3 changes: 1 addition & 2 deletions twirl-compiler/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load("@rules_scala_annex//rules:scala.bzl", "scala_library")
load("@graknlabs_bazel_distribution//maven:rules.bzl", "assemble_maven", "deploy_maven")
load("@env_vars//:env_vars.bzl", "COMPILER_CLI_ARTIFACT_ID")

artifact_id = COMPILER_CLI_ARTIFACT_ID if len(COMPILER_CLI_ARTIFACT_ID) > 0 else "twirl_compiler_cli"
artifact_id = COMPILER_CLI_ARTIFACT_ID if (len(COMPILER_CLI_ARTIFACT_ID) > 0) else "twirl_compiler_cli"

scala_library(
name = "twirl-compiler-lib",
Expand All @@ -13,7 +13,6 @@ scala_library(
"@rules_scala_annex//src/main/scala/higherkindness/rules_scala/common/worker",
"@twirl_compiler_cli_maven//:com_github_scopt_scopt_3",
"@twirl_compiler_cli_maven//:org_playframework_twirl_twirl_compiler_3",
"@twirl_compiler_cli_maven//:org_scala_lang_scala3_library_3",
],
)

Expand Down
Loading

0 comments on commit e5c8316

Please sign in to comment.