Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,14 @@ jobs:
name: Binary Compatibility
uses: playframework/.github/.github/workflows/binary-check.yml@v4

check-docs-8:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ I removed it because the combo Java 8 and Scala 2.13 doesn't work

Exception in thread "specs2-3" java.lang.BootstrapMethodError: java.lang.UnsupportedClassVersionError: play/api/test/WithApplication has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

This because our setup for Scala 2.13 pulls Play 3.x which requires Java 11+.

As we're gonna baseline on Java 17 soon ( #708 ), I don't feel it's worth making it work by changing the Play version targeted.

Actually I'm not even sure what was the purpose of this double pipeline in Java 8 & 11 but not testing all Scala version for Java 8. Anyway, as I said, we're dropping Java 8.

name: Docs Java 8
uses: playframework/.github/.github/workflows/cmd.yml@v4
with:
java: 8
scala: 2.12.x
cmd: sbt ++$MATRIX_SCALA docs/test

check-docs-11:
name: Docs
uses: playframework/.github/.github/workflows/cmd.yml@v4
with:
java: 11
scala: 2.12.x, 2.13.x, 3.x
scala: 2.13.x, 3.x
cmd: sbt ++$MATRIX_SCALA docs/test

tests-8:
name: Tests
needs:
- "check-code-style"
- "check-binary-compatibility"
- "check-docs-8"
uses: playframework/.github/.github/workflows/cmd.yml@v4
with:
java: 8
scala: 2.12.x
cmd: sbt ++$MATRIX_SCALA publishLocal test

tests-11:
name: Tests
needs:
Expand All @@ -60,13 +40,12 @@ jobs:
uses: playframework/.github/.github/workflows/cmd.yml@v4
with:
java: 11
scala: 2.12.x, 2.13.x, 3.x
scala: 2.13.x, 3.x
cmd: sbt ++$MATRIX_SCALA publishLocal test

finish:
name: Finish
if: github.event_name == 'pull_request'
needs: # Should be last
- "tests-8"
- "tests-11"
uses: playframework/.github/.github/workflows/rtm.yml@v4
9 changes: 0 additions & 9 deletions akka/src/test/scala-2.13-/AkkaCompat.scala

This file was deleted.

125 changes: 13 additions & 112 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -225,42 +225,6 @@ lazy val `anorm-core` = project
)
.dependsOn(`anorm-tokenizer`)

lazy val `anorm-iteratee` = project
.in(file("iteratee"))
.settings(
Seq(
sourceDirectory := {
val v = scalaBinaryVersion.value

if (v == "3" || v == "2.13") new java.io.File("/no/sources")
else sourceDirectory.value
},
mimaPreviousArtifacts := {
val v = scalaBinaryVersion.value

if (v == "3" || v == "2.13") Set.empty[ModuleID]
else Set(organization.value %% name.value % "2.6.10")
},
publish / skip := {
val v = scalaBinaryVersion.value

v == "3" || v == "2.13"
},
libraryDependencies ++= {
val v = scalaBinaryVersion.value

if (v == "3" || v == "2.13") Seq.empty[ModuleID]
else
Seq(
"com.typesafe.play" %% "play-iteratees" % "2.6.1",
"org.scala-lang.modules" %% "scala-xml" % xmlVer % Test,
acolyte
) ++ specs2Test
}
) ++ licensing
)
.dependsOn(`anorm-core`)

// ---

lazy val akkaVer = Def.setting[String] {
Expand Down Expand Up @@ -291,80 +255,27 @@ lazy val `anorm-akka` = project
"org.scala-lang.modules" %% "scala-xml" % xmlVer % Test,
("com.typesafe.akka" %% "akka-stream-testkit" % akkaVer.value % Test).exclude("org.scala-lang.modules", "*")
) ++ specs2Test,
scalacOptions ++= Seq("-Wconf:msg=.*(onDownstreamFinish|ActorMaterializer).*:s"),
Test / unmanagedSourceDirectories += {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n < 13 =>
(Test / sourceDirectory).value / "scala-2.13-"

case _ =>
(Test / sourceDirectory).value / "scala-2.13+"

}
}
scalacOptions ++= Seq("-Wconf:msg=.*(onDownstreamFinish|ActorMaterializer).*:s")
) ++ licensing
)
.dependsOn(`anorm-core`)

lazy val pekkoVer = Def.setting[String]("1.6.0")

lazy val pekkoEnabled = Def.setting[Boolean] {
val v = scalaBinaryVersion.value

v != "2.12"
}

lazy val `anorm-pekko` = project
.in(file("pekko"))
.settings(
Seq(
mimaPreviousArtifacts := Set.empty,
sourceDirectory := {
if (!pekkoEnabled.value) new java.io.File("/no/sources")
else sourceDirectory.value
libraryDependencies ++= Seq("pekko-testkit", "pekko-stream").map { m =>
("org.apache.pekko" %% m % pekkoVer.value % Provided).exclude("org.scala-lang.modules", "*")
},
publishArtifact := pekkoEnabled.value,
publish := Def.taskDyn {
val ver = scalaBinaryVersion.value
val go = publish.value

Def.task {
if (pekkoEnabled.value) {
go
}
}
}.value,
libraryDependencies ++= {
if (pekkoEnabled.value) {
Seq("pekko-testkit", "pekko-stream").map { m =>
("org.apache.pekko" %% m % pekkoVer.value % Provided).exclude("org.scala-lang.modules", "*")
}
} else {
Seq.empty
}
},
libraryDependencies ++= {
if (pekkoEnabled.value) {
Seq(
acolyte,
"org.scala-lang.modules" %% "scala-xml" % xmlVer % Test,
"org.apache.pekko" %% "pekko-stream-testkit" % pekkoVer.value % Test
) ++ specs2Test
} else {
Seq.empty
}
},
scalacOptions ++= Seq("-Wconf:cat=deprecation&msg=.*(onDownstreamFinish|ActorMaterializer).*:s"),
Test / unmanagedSourceDirectories ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n < 13 =>
Seq((Test / sourceDirectory).value / "scala-2.13-")

case _ =>
Seq((Test / sourceDirectory).value / "scala-2.13+")

}
}
libraryDependencies ++= Seq(
acolyte,
"org.scala-lang.modules" %% "scala-xml" % xmlVer % Test,
"org.apache.pekko" %% "pekko-stream-testkit" % pekkoVer.value % Test
) ++ specs2Test,
scalacOptions ++= Seq("-Wconf:cat=deprecation&msg=.*(onDownstreamFinish|ActorMaterializer).*:s")
) ++ licensing
)
.dependsOn(`anorm-core`)
Expand Down Expand Up @@ -422,7 +333,6 @@ lazy val `anorm-parent` = project
.aggregate(
`anorm-tokenizer`,
`anorm-core`,
`anorm-iteratee`,
`anorm-akka`,
`anorm-pekko`,
`anorm-postgres`,
Expand Down Expand Up @@ -452,19 +362,10 @@ lazy val docs = project

(manualDir / "javaGuide" ** "code").get ++ (manualDir / "scalaGuide" ** "code").get
},
libraryDependencies ++= {
if (scalaBinaryVersion.value == "2.12") {
Seq(
"com.typesafe.play" %% "play-jdbc" % "2.8.22" % Test,
"com.typesafe.play" %% "play-specs2" % "2.8.22" % Test
)
} else {
Seq(
"org.playframework" %% "play-jdbc" % "3.0.10" % Test,
"org.playframework" %% "play-specs2" % "3.0.10" % Test
)
}
},
libraryDependencies ++= Seq(
"org.playframework" %% "play-jdbc" % "3.0.10" % Test,
"org.playframework" %% "play-specs2" % "3.0.10" % Test
),
libraryDependencies ++= Seq(
"com.h2database" % "h2" % "1.4.199"
),
Expand Down
42 changes: 0 additions & 42 deletions core/src/main/scala-2.13-/Compat.scala

This file was deleted.

26 changes: 0 additions & 26 deletions docs/manual/working/scalaGuide/main/sql/ScalaAnorm.md
Original file line number Diff line number Diff line change
Expand Up @@ -1016,32 +1016,6 @@ def source(implicit m: Materializer, connection: Connection): Source[String, Fut
})
```

#### Iteratee

It's possible to use Anorm along with [Play Iteratees](https://www.playframework.com/documentation/latest/Iteratees), using the following dependencies.

```scala
libraryDependencies ++= Seq(
"org.playframework.anorm" %% "anorm-iteratee" % "ANORM_VERSION",
"com.typesafe.play" %% "play-iteratees" % "ITERATEES_VERSION")
```

> For a Play application, as `play-iteratees` is provided there is no need to add this dependency.

> Since Scala 2.13, `play-iteratees` is no longer available.

Then the parsed results from Anorm can be turned into [`Enumerator`](https://www.playframework.com/documentation/latest/api/scala/index.html#play.api.libs.iteratee.Enumerator).

```scala
import java.sql.Connection
import scala.concurrent.ExecutionContext.Implicits.global
import anorm._
import play.api.libs.iteratee._

def resultAsEnumerator(implicit con: Connection): Enumerator[String] =
Iteratees.from(SQL"SELECT * FROM Test", SqlParser.scalar[String])
```

### Retrieving data along with execution context

Moreover data, query execution involves context information like SQL warnings that may be raised (and may be fatal or not), especially when working with stored SQL procedure.
Expand Down
69 changes: 0 additions & 69 deletions iteratee/src/main/scala/anorm/Iteratees.scala

This file was deleted.

Loading
Loading