Skip to content

Commit

Permalink
Disable bench project on java 8.
Browse files Browse the repository at this point in the history
mrdziuban committed Oct 27, 2023
1 parent 5ba07ff commit e5dee9e
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ lazy val play = playProj(projectMatrix.in(file("play")), "play")(axis => _ => _.
.dependsOn(core % "compile->compile;test->test")

lazy val bench = http4sProj(projectMatrix.in(file("bench")), "bench", _ => List(Platform.Jvm))(
_ => sjsNowarnGlobalECSettings,
_ => platform => proj => fakeJava8Settings(platform)(sjsNowarnGlobalECSettings(platform)(proj)),
modScalaVersions = _ => _ => _.filterNot(_.startsWith("2.12")),
)
.settings(noPublishSettings)
23 changes: 13 additions & 10 deletions project/Build.scala
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ object Build {
def nativeProj(f: Project => Project): Project => Project =
f.andThen(_.enablePlugins(scala.scalanative.sbtplugin.ScalaNativePlugin))

val sjsNowarnGlobalECSettings: Platform => Project => Project =
val sjsNowarnGlobalECSettings: ProjSettings =
_ match {
case Platform.Js => _.settings(scalacOptions += "-P:scalajs:nowarnGlobalExecutionContext")
case Platform.Jvm | Platform.Native => identity
@@ -157,6 +157,15 @@ object Build {
}
}

val fakeJava8Settings: ProjSettings =
_ => proj =>
if (System.getProperty("java.version").startsWith("1.8"))
proj.settings(
Compile / scalaSource := (ThisBuild / baseDirectory).value / "fake" / "src" / "main" / "scala",
Test / scalaSource := (ThisBuild / baseDirectory).value / "fake" / "src" / "test" / "scala",
)
else proj

def simpleProj(
matrix: ProjectMatrix,
nme: String,
@@ -248,15 +257,9 @@ object Build {
defaultHttp4sScalaVersions,
)

val defaultPlaySettings = (axis: PlayAxis.Value) => (_: Platform) => axis match {
case PlayAxis.v2_8 => identity[Project] _
case PlayAxis.v2_9 | PlayAxis.v3_0 => (proj: Project) =>
if (System.getProperty("java.version").startsWith("1.8"))
proj.settings(
Compile / scalaSource := (ThisBuild / baseDirectory).value / "fake-play" / "src" / "main" / "scala",
Test / scalaSource := (ThisBuild / baseDirectory).value / "fake-play" / "src" / "test" / "scala",
)
else proj
val defaultPlaySettings = (axis: PlayAxis.Value) => axis match {
case PlayAxis.v2_8 => (_: Platform) => identity[Project] _
case PlayAxis.v2_9 | PlayAxis.v3_0 => fakeJava8Settings
}
val defaultPlayPlatforms = (_: PlayAxis.Value) => List(Platform.Jvm)
val defaultPlayScalaVersions = (axis: PlayAxis.Value) => (_: Platform) => axis match {

0 comments on commit e5dee9e

Please sign in to comment.