Skip to content

Commit

Permalink
Updating play 3.0 support. Fixes ReactiveMongo#564
Browse files Browse the repository at this point in the history
* Removing local constant
* Keep scala 2.12 as lower default
* Formatting
* Revert project name to Play2-ReactiveMongo
* Add test to the pipeline
  • Loading branch information
tardigradeus committed Apr 30, 2024
1 parent 1738d22 commit d93a860
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 26 deletions.
71 changes: 71 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,26 @@ jobs:
- store_test_results:
path: test-reports

jdk11_scala213_play29:
docker:
- image: cchantep/circleci-openjdk:11-jdk

working_directory: ~/repo

environment:
RELEASE_SUFFIX: play29
PLAY_VERSION: 2.9.1
SCALA_VERSION: 2.13.11

steps:
- checkout
- setup_sbt
- setup_integration
- build_n_tests
- collect_test_reports
- store_test_results:
path: test-reports

jdk11_scala32_play29:
docker:
- image: cchantep/circleci-openjdk:11-jdk
Expand All @@ -215,6 +235,46 @@ jobs:
- store_test_results:
path: test-reports

jdk11_scala213_play30:
docker:
- image: cchantep/circleci-openjdk:11-jdk

working_directory: ~/repo

environment:
RELEASE_SUFFIX: play30
PLAY_VERSION: 3.0.2
SCALA_VERSION: 2.13.11

steps:
- checkout
- setup_sbt
- setup_integration
- build_n_tests
- collect_test_reports
- store_test_results:
path: test-reports

jdk11_scala32_play30:
docker:
- image: cchantep/circleci-openjdk:11-jdk

working_directory: ~/repo

environment:
RELEASE_SUFFIX: play30
PLAY_VERSION: 3.0.2
SCALA_VERSION: 3.3.3

steps:
- checkout
- setup_sbt
- setup_integration
- build_n_tests
- collect_test_reports
- store_test_results:
path: test-reports

publish_snapshots:
docker:
- image: cchantep/circleci-openjdk:8-jdk
Expand Down Expand Up @@ -254,6 +314,11 @@ jobs:
play_version: 2.9.1
scala_versions: 2.13.11 3.3.3

- publish_snapshots:
release_suffix: play30
play_version: 3.0.2
scala_versions: 2.13.11 3.3.3

- save_cache:
paths:
- ~/.ivy2
Expand All @@ -280,7 +345,10 @@ workflows:
- jdk8_scala212_play26
- jdk10_scala213_play27
- jdk11_scala213_play28
- jdk11_scala213_play29
- jdk11_scala32_play29
- jdk11_scala213_play30
- jdk11_scala32_play30

- publish_snapshots:
filters:
Expand All @@ -292,6 +360,9 @@ workflows:
- jdk10_scala213_play27
- jdk11_scala213_play28
- jdk11_scala32_play29
- jdk11_scala213_play29
- jdk11_scala32_play30
- jdk11_scala213_play30

- trigger_dependent_builds:
filters:
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ val playDependencies = Def.setting[Seq[ModuleID]] {
baseDeps
}

lazy val reactivemongo = Project("Play-ReactiveMongo", file(".")).settings(
lazy val reactivemongo = Project("Play2-ReactiveMongo", file(".")).settings(
Seq(
resolvers ++= Resolver.sonatypeOssRepos({
if (version.value endsWith "-SNAPSHOT") "snapshots"
Expand Down
32 changes: 10 additions & 22 deletions project/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ object Common extends AutoPlugin {
driverVersion := {
val ver = (ThisBuild / version).value
val suffix = {
val noshaded = "noshaded"
val pekko = "pekko"
(useShaded.value, playVer.value startsWith "2.") match {
case (false, false) => s"$noshaded.$pekko"
case (true, false) => pekko
case (false, true) => noshaded
case (false, false) => "noshaded.pekko"
case (true, false) => "pekko"
case (false, true) => "noshaded"
case (true, true) => ""
}
}

if (suffix.isEmpty) {
ver
} else {
Expand All @@ -53,22 +50,13 @@ object Common extends AutoPlugin {
}
}
},
// Play 3 not supported in 2.11/2.12
scalaVersion := "2.13.11",
crossScalaVersions := {
val baseVersions = if (playVer.value startsWith "2.") {
Seq("2.11.12",
"2.12.17")
} else {
Seq.empty
}

baseVersions ++
Seq(
scalaVersion.value,
"3.2.2"
)
},
scalaVersion := "2.12.17",
crossScalaVersions := Seq(
"2.11.12",
scalaVersion.value,
"2.13.11",
"3.3.3"
),
crossVersion := CrossVersion.binary,
Compile / compile / javacOptions ++= Seq(
"-source",
Expand Down
10 changes: 7 additions & 3 deletions project/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -e

S2_12="2.12.17"
S2_11="2.11.12"
S2_13="2.13.10"
S3_2="3.2.2"
S2_13="2.13.11"
S3_3="3.3.3"

unset REACTIVEMONGO_SHADED

Expand All @@ -27,4 +27,8 @@ sbt $SBT_OPTS ++${S2_12} makePom packageBin packageSrc packageDoc \

export RELEASE_SUFFIX=play29 PLAY_VERSION=2.9.1
sbt $SBT_OPTS ++${S2_13} makePom packageBin packageSrc packageDoc \
++${S3_2} makePom packageBin packageSrc packageDoc
++${S3_3} makePom packageBin packageSrc packageDoc

export RELEASE_SUFFIX=play30 PLAY_VERSION=3.0.2
sbt $SBT_OPTS ++${S2_13} makePom packageBin packageSrc packageDoc \
++${S3_3} makePom packageBin packageSrc packageDoc

0 comments on commit d93a860

Please sign in to comment.