Skip to content

Commit

Permalink
chore: Drop JDK 8 (#3017)
Browse files Browse the repository at this point in the history
* chore: Drop JDK 8

* fail fast if not JDK 11 or higher
  • Loading branch information
patriknw authored Oct 2, 2023
1 parent 9a00582 commit 5b72468
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 34 deletions.
30 changes: 2 additions & 28 deletions .github/workflows/check-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,32 +43,6 @@ jobs:
- name: "Code style, compile tests, MiMa. Run locally with: sbt \"verifyCodeStyle; +Test/compile; mimaReportBinaryIssues\""
run: sbt "verifyCodeStyle; +Test/compile; mimaReportBinaryIssues"

compile-jdk-8:
name: Compile with JDK 8
runs-on: ubuntu-22.04
env:
JAVA_OPTS: -Xms2G -Xmx2G -Xss2M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8

steps:
- name: Checkout
uses: actions/checkout@v3.1.0
with: # https://github.com/olafurpg/setup-scala#faster-checkout-of-big-repos
fetch-depth: 100

- name: Fetch tags
run: git fetch --depth=100 origin +refs/tags/*:refs/tags/*

- name: Set up JDK 8
uses: coursier/setup-action@v1.3.0
with:
jvm: adopt:1.8.0-275

- name: Cache Coursier cache
uses: coursier/cache-action@v6.4.0

- name: "Compile JDK 8"
run: sbt compile

documentation:
name: ScalaDoc, Documentation with Paradox
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -168,11 +142,11 @@ jobs:
CONNECTOR: ${{ matrix.connector }}
run: ./scripts/gh-detect-changes.sh "${CONNECTOR}"

- name: Set up JDK 8
- name: Set up JDK 11
if: env.execute_build == 'true'
uses: coursier/setup-action@v1.3.0
with:
jvm: temurin:1.8
jvm: temurin:1.11

- name: Cache Coursier cache
if: env.execute_build == 'true'
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ jobs:
- name: Cache Coursier cache
uses: coursier/cache-action@v6.4.0

# Release must be with JDK 8 because --release 8 flag prevents access to com.sun.nio.file.SensitivityWatchEventModifier
- name: Set up JDK 8
- name: Set up JDK 11
uses: coursier/setup-action@v1.3.0
with:
jvm: adopt:1.8.0-275
jvm: temurin:1.11.0.17

- name: Publish artifacts for all Scala versions
env:
Expand Down
7 changes: 7 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -512,3 +512,10 @@ Global / onLoad := (Global / onLoad).value.andThen { s =>
)
s
}

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
}
4 changes: 2 additions & 2 deletions project/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ object Common extends AutoPlugin {
"-Xlint:try",
"-Xlint:unchecked",
"-Xlint:varargs"
// Release must be with JDK 8 because this flag prevents access to com.sun.nio.file.SensitivityWatchEventModifier
// Release must be with JDK 11 because this flag prevents access to com.sun.nio.file.SensitivityWatchEventModifier
// "--release",
// "8"
// "11"
),
compile / javacOptions ++= (scalaVersion.value match {
case Dependencies.Scala213 if insideCI.value && fatalWarnings.value && !Dependencies.CronBuild =>
Expand Down
2 changes: 1 addition & 1 deletion project/project-info.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project-info {
labels: "https://github.com/akka/alpakka/labels/p%3A"
scaladoc: "https://doc.akka.io/api/alpakka/"${project-info.version}"/akka/stream/alpakka/"
shared-info {
jdk-versions: ["Adopt OpenJDK 8", "Adopt OpenJDK 11"]
jdk-versions: ["Eclipse Temurin JDK 11", "Eclipse Temurin JDK 17"]
snapshots: {
url: "other-docs/snapshots.html"
text: "Snapshots are available"
Expand Down

0 comments on commit 5b72468

Please sign in to comment.