-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.sbt
87 lines (78 loc) · 3.28 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import sbt.Keys._
val scala2_13 = "2.13.12"
val scala3 = "3.3.3"
ThisBuild / majorVersion := 8
ThisBuild / isPublicArtefact := true
ThisBuild / scalaVersion := scala2_13
ThisBuild / scalacOptions += "-Wconf:src=views/.*:s"
ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always // required since we're cross building for Play 2.8 which isn't compatible with sbt 1.9
lazy val projects: Seq[ProjectReference] =
sys.env.get("PLAY_VERSION") match {
case Some("2.8") => Seq(playLanguage, playLanguagePlay28)
case Some("2.9") => Seq(playLanguagePlay29)
case _ => Seq(playLanguagePlay30)
}
lazy val library = (project in file("."))
.settings(publish / skip := true)
.aggregate(
projects: _*
)
// empty artefact, exists to ensure eviction of previous play-language jar which has now moved into play-language-play-28
lazy val playLanguage = Project("play-language", file("play-language"))
def copySources(module: Project) = Seq(
Compile / scalaSource := (module / Compile / scalaSource).value,
Compile / resourceDirectory := (module / Compile / resourceDirectory).value,
Test / scalaSource := (module / Test / scalaSource).value,
Test / resourceDirectory := (module / Test / resourceDirectory).value
)
lazy val playLanguagePlay28 = Project("play-language-play-28", file("play-language-play-28"))
.enablePlugins(
SbtTwirl
) // previously used play sbt-plugin and enabled PlayScala and disabled PlayLayout - this was overkill to add templateImports, and added lots of unnecessary dependencies to created binary (incl. Main-Class config in Manifest)
.disablePlugins(JUnitXmlReportPlugin) //Required to prevent https://github.com/scalatest/scalatest/issues/1427
.settings(copySources(playLanguagePlay30))
.settings(
libraryDependencies ++= AppDependencies.play28
)
.settings(
Compile / TwirlKeys.compileTemplates / sourceDirectories ++=
(Compile / unmanagedSourceDirectories).value,
TwirlKeys.templateImports ++= Seq(
"play.api.mvc._",
"play.api.data._",
"play.api.i18n._"
)
)
.dependsOn(playLanguage)
lazy val playLanguagePlay29 = Project("play-language-play-29", file("play-language-play-29"))
.enablePlugins(SbtTwirl)
.disablePlugins(JUnitXmlReportPlugin) //Required to prevent https://github.com/scalatest/scalatest/issues/1427
.settings(copySources(playLanguagePlay30))
.settings(
libraryDependencies ++= AppDependencies.play29
)
.settings(
Compile / TwirlKeys.compileTemplates / sourceDirectories ++=
(Compile / unmanagedSourceDirectories).value,
TwirlKeys.templateImports ++= Seq(
"play.api.mvc._",
"play.api.data._",
"play.api.i18n._"
)
)
lazy val playLanguagePlay30 = Project("play-language-play-30", file("play-language-play-30"))
.enablePlugins(SbtTwirl)
.disablePlugins(JUnitXmlReportPlugin) //Required to prevent https://github.com/scalatest/scalatest/issues/1427
.settings(
crossScalaVersions := Seq(scala2_13, scala3),
libraryDependencies ++= AppDependencies.play30
)
.settings(
Compile / TwirlKeys.compileTemplates / sourceDirectories ++=
(Compile / unmanagedSourceDirectories).value,
TwirlKeys.templateImports ++= Seq(
"play.api.mvc._",
"play.api.data._",
"play.api.i18n._"
)
)