Skip to content

Commit

Permalink
Update play to 2.9.1 (#20)
Browse files Browse the repository at this point in the history
* Upgrade bazel to 7.0.2

* Update dependencies

* Update scala version

* Update play version

* Update java version

* Update ubuntu version
  • Loading branch information
coreywoodfield authored Feb 12, 2024
1 parent 5102bd3 commit bd6e0a1
Show file tree
Hide file tree
Showing 14 changed files with 3,667 additions and 5,489 deletions.
7 changes: 7 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
startup --expand_configs_in_place

common --noenable_bzlmod

common:ci --color=yes

build:ci --verbose_failures
Expand All @@ -9,3 +11,8 @@ build:ci --genrule_strategy=standalone

test:ci --test_strategy=standalone
test:ci --test_output=errors

build --java_language_version="11"
build --java_runtime_version="remotejdk_11"
build --tool_java_language_version="11"
build --tool_java_runtime_version="remotejdk_11"
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bazelbuild/3.4.1
bazelbuild/7.0.2
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build-and-test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand All @@ -20,7 +20,7 @@ jobs:
publish:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: build-and-test
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand Down
9 changes: 9 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain", "DEFAULT_JAVACOPTS")

default_java_toolchain(
name = "java_toolchain",
# some of the default options make scala compilation fail in the test package
misc = [opt for opt in DEFAULT_JAVACOPTS if not opt.startswith("-Xep")],
source_version = "11",
target_version = "11",
)
20 changes: 11 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ workspace(name = "play_routes_compiler_cli")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# rules_jvm_external
RULES_JVM_EXTERNAL_TAG = "3.3"
RULES_JVM_EXTERNAL_TAG = "d716bbe2dbaa068e495d25aeb1dcaa699f134eed"
http_archive(
name = "rules_jvm_external",
sha256 = "d85951a92c0908c80bd8551002d66cb23c3434409c814179c0ff026b53544dab",
sha256 = "d2bab2d2aefbadb2207ada5b82a7da99b7ff3f03ae565cbc194f124752d8bd06",
strip_prefix = "rules_jvm_external-{}".format(RULES_JVM_EXTERNAL_TAG),
type = "zip",
url = "https://github.com/bazelbuild/rules_jvm_external/archive/{}.zip".format(RULES_JVM_EXTERNAL_TAG),
Expand All @@ -24,13 +24,13 @@ play_routes_compiler_cli_test_pinned_maven_install()


# higherkindness/rules_scala
rules_scala_annex_version = "ff423d8bdd0e5383f8f2c048ffd7704bb51a91bf" # update this as needed
rules_scala_annex_version = "lucid_2023-12-13" # update this as needed
http_archive(
name = "rules_scala_annex",
sha256 = "ae53e9ed5fecadc7baf4637b88109471602be73dda4e5ff6b4bf1767932703c0",
integrity = "sha256-cr+XAL/P6b1sgGi3FBEmqMgzScvu+3kAEmwz68lKei4=",
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 @@ -44,11 +44,13 @@ load("@annex//:defs.bzl", annex_pinned_maven_install = "pinned_maven_install")
annex_pinned_maven_install()
scala_register_toolchains()

register_toolchains("//:java_toolchain_definition")

# Protobuf
protobuf_version = "3.9.0"
protobuf_version = "25.1"
http_archive(
name = "com_google_protobuf",
sha256 = "8eb5ca331ab8ca0da2baea7fc0607d86c46c80845deca57109a5d637ccb93bb4",
sha256 = "eaafa4e19a6619c15df4c30d7213efbfd0f33ad16021cc5f72bbc5d0877346b5",
strip_prefix = "protobuf-{}".format(protobuf_version),
type = "zip",
url = "https://github.com/protocolbuffers/protobuf/archive/v{}.zip".format(protobuf_version),
Expand All @@ -58,10 +60,10 @@ load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()

####################### For Maven Publishing ############################
skylib_version = "1.0.3"
skylib_version = "1.4.1"
http_archive(
name = "bazel_skylib",
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7",
type = "tar.gz",
url = "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{}/bazel-skylib-{}.tar.gz".format(skylib_version, skylib_version),
)
Expand Down
2 changes: 1 addition & 1 deletion play-routes-compiler/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ scala_library(
visibility = ["//visibility:public"],
deps = [
"@play_routes_compiler_cli_maven//:com_github_scopt_scopt_2_13",
"@play_routes_compiler_cli_maven//:com_typesafe_play_routes_compiler_2_13",
"@play_routes_compiler_cli_maven//:com_typesafe_play_play_routes_compiler_2_13",
"@play_routes_compiler_cli_maven//:org_scala_lang_scala_reflect",
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ object CommandLinePlayRoutesCompiler {
// The generated Routes files include non-reproducible headers
// We need to remove these for Bazel caching to work
private def stripHeader(path: String): Unit = {
val lines = Source.fromFile(path).getLines
val lines = Source.fromFile(path).getLines()
val sansHeader = lines.span(line => line.matches("^(//.*|\\s*)$"))._2.toList
Files.write(Paths.get(path), sansHeader.asJava)
}
Expand Down
Loading

0 comments on commit bd6e0a1

Please sign in to comment.