Skip to content

Commit

Permalink
Fix tests under Java 17 (Guice upgrade via Play)
Browse files Browse the repository at this point in the history
After #93 we found that
unfortunately the Release workflow failed while running the tests:

* The Release workflow uses Java 17 for all builds
* The Atom Maker library uses Play with Guice for Dependency Injection
* Guice gained Java 17 & 21 support with Guice v6:
  https://github.com/google/guice/wiki/Guice600
* Play only updated to Guice v6 (and gained general Java 17 support)
  with Play v2.9:
  playframework/playframework#11808
  playframework/playframework@10ca54d#diff-3dc52110c1c1c453c2e9740ac58fe7e90d53121875a034ef3109c34ab030c29e
  • Loading branch information
rtyley committed Jan 18, 2024
1 parent 5006764 commit b4d55b3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8', '11']
java: [ '11', '17']
name: Run Tests (Java ${{ matrix.java }})
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion atom-manager-play-lib/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name := "atom-manager-play"
libraryDependencies ++= Seq(
"com.typesafe.play" %% "play" % playVersion,
"com.gu" %% "content-atom-model" % contentAtomVersion,
"org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0" % Test,
"org.scalatestplus.play" %% "scalatestplus-play" % "6.0.1" % Test,
"com.amazonaws" % "aws-java-sdk-dynamodb" % awsVersion,
"org.mockito" % "mockito-core" % mockitoVersion % Test,
"com.typesafe.play" %% "play-test" % playVersion % Test,
Expand Down
6 changes: 2 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ name := "atom-maker-lib"

lazy val artifactProductionSettings = Seq(
organization := "com.gu",
scalaVersion := "2.12.18",
crossScalaVersions := Seq(scalaVersion.value, "2.13.12"),
scalaVersion := "2.13.12",
licenses := Seq(License.Apache2),
scalacOptions := Seq("-deprecation", "-feature", "-release:8")
scalacOptions := Seq("-deprecation", "-feature", "-release:11")
)

lazy val atomPublisher = (project in file("./atom-publisher-lib"))
Expand All @@ -32,7 +31,6 @@ lazy val atomLibraries = (project in file("."))
.aggregate(atomPublisher, atomManagerPlay).settings(
publish / skip := true,
releaseVersion := ReleaseVersion.fromAggregatedAssessedCompatibilityWithLatestRelease().value,
releaseCrossBuild := true, // true if you cross-build the project for multiple Scala versions
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
Expand Down
4 changes: 2 additions & 2 deletions project/BuildVars.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ object BuildVars {
lazy val awsVersion = "1.11.8"
lazy val contentAtomVersion = "4.0.0"
lazy val scroogeVersion = "22.1.0"
lazy val playVersion = "2.8.8"
lazy val mockitoVersion = "4.8.0"
lazy val playVersion = "2.9.1"
lazy val mockitoVersion = "4.11.0"
}
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.8")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.9.1")

addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.10.0")
Expand Down

0 comments on commit b4d55b3

Please sign in to comment.