Skip to content

Commit

Permalink
chore: Drop JDK 8 (#1058)
Browse files Browse the repository at this point in the history
  • Loading branch information
patriknw authored Oct 2, 2023
1 parent 8478a6b commit 5366eca
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 21 deletions.
1 change: 0 additions & 1 deletion .github/workflows/check-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ jobs:
fail-fast: false
matrix:
include:
- { jdk: 'adopt:8', container: "cassandra-latest", test: "test" }
- { jdk: 'temurin:1.11.0.17', container: "cassandra-latest", test: "test" }
- { jdk: 'temurin:1.11.0.17', container: "cassandra2", test: "'testOnly -- -l RequiresCassandraThree'"}
- { jdk: 'temurin:1.11.0.17', container: "cassandra3", test: "test" }
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ jobs:
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
fetch-depth: 0

- name: Setup JDK 8
# https://github.com/coursier/setup-action/releases
# v1.3.0
uses: coursier/setup-action@70323223454ac2a9eb2de46f389b4d045cbcdea5
- name: Set up JDK 11
uses: coursier/[email protected]
with:
java-version: adopt:1.8.0-275
jvm: temurin:1.11.0.17

- name: Cache Coursier cache
# https://github.com/coursier/cache-action/releases/
Expand Down
22 changes: 9 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ lazy val endToEndExample = project
.dependsOn(core)
.settings(libraryDependencies ++= Dependencies.exampleDependencies, publish / skip := true)
.settings(
dockerBaseImage := "openjdk:8-jre-alpine",
dockerBaseImage := "docker.io/library/eclipse-temurin:17.0.8.1_1-jre",
dockerCommands :=
dockerCommands.value.flatMap {
case ExecCmd("ENTRYPOINT", args @ _*) => Seq(Cmd("ENTRYPOINT", args.mkString(" ")))
Expand All @@ -46,18 +46,7 @@ lazy val endToEndExample = project
dockerUpdateLatest := true,
// update if deploying to some where that can't see docker hu
//dockerRepository := Some("some-registry"),
dockerCommands ++= Seq(
Cmd("USER", "root"),
Cmd("RUN", "/sbin/apk", "add", "--no-cache", "bash", "bind-tools", "busybox-extras", "curl", "iptables"),
Cmd(
"RUN",
"/sbin/apk",
"add",
"--no-cache",
"jattach",
"--repository",
"http://dl-cdn.alpinelinux.org/alpine/edge/community/"),
Cmd("RUN", "chgrp -R 0 . && chmod -R g=u .")),
dockerCommands ++= Seq(Cmd("USER", "root"), Cmd("RUN", "chgrp -R 0 . && chmod -R g=u .")),
// Docker image is only for running in k8s
Universal / javaOptions ++= Seq("-J-Dconfig.resource=kubernetes.conf"))
.enablePlugins(DockerPlugin, JavaAppPackaging)
Expand Down Expand Up @@ -123,3 +112,10 @@ TaskKey[Unit]("verifyCodeFmt") := {
}

addCommandAlias("verifyCodeStyle", "headerCheckAll; verifyCodeFmt")

val isJdk11orHigher: Boolean = {
val result = VersionNumber(sys.props("java.specification.version")).matchesSemVer(SemanticSelector(">=11"))
if (!result)
throw new IllegalArgumentException("JDK 11 or higher is required")
result
}
12 changes: 11 additions & 1 deletion project/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,17 @@ object Common extends AutoPlugin {
crossVersion := CrossVersion.binary,
crossScalaVersions := Dependencies.Scala2Versions,
scalaVersion := Dependencies.Scala213,
scalacOptions ++= Seq("-encoding", "UTF-8", "-feature", "-unchecked", "-Xlint", "-Ywarn-dead-code", "-deprecation"),
javacOptions ++= Seq("--release", "11"),
scalacOptions ++= Seq(
"-encoding",
"UTF-8",
"-feature",
"-unchecked",
"-Xlint",
"-Ywarn-dead-code",
"-deprecation",
"-release",
"11"),
Compile / console / scalacOptions --= Seq("-deprecation", "-Xfatal-warnings", "-Xlint", "-Ywarn-unused:imports"),
Compile / doc / scalacOptions := scalacOptions.value ++ Seq(
"-doc-title",
Expand Down
2 changes: 1 addition & 1 deletion project/project-info.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project-info {
version: "current"
shared-info {
jdk-versions: ["Adopt OpenJDK 8", "Adopt OpenJDK 11"]
jdk-versions: ["Eclipse Temurin JDK 11", "Eclipse Temurin JDK 17"]
snapshots: {
url: "https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-persistence-cassandra_2.13/"
text: "Snapshots are available from Sonatype"
Expand Down

0 comments on commit 5366eca

Please sign in to comment.