-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from hmrc/BDOG-2885
BDOG-2885 Build for Play 3.0
- Loading branch information
Showing
18 changed files
with
162 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,91 @@ | ||
import sbt.Keys._ | ||
import scala.collection.JavaConverters._ | ||
|
||
val scala2_12 = "2.12.15" | ||
val scala2_13 = "2.13.7" | ||
val scala2_12 = "2.12.18" | ||
val scala2_13 = "2.13.12" | ||
|
||
val silencerVersion = "1.7.7" | ||
ThisBuild / majorVersion := 7 | ||
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 playLanguage = (project in file(".")) | ||
.enablePlugins(PlayScala) | ||
.disablePlugins(PlayLayoutPlugin) | ||
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")) | ||
.settings(crossScalaVersions := Seq(scala2_12, scala2_13)) | ||
|
||
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( | ||
majorVersion := 6, | ||
name := "play-language", | ||
scalaVersion := scala2_12, | ||
crossScalaVersions := Seq(scala2_12, scala2_13), | ||
PlayCrossCompilation.playCrossCompilationSettings, | ||
libraryDependencies ++= AppDependencies.all, | ||
isPublicArtefact := true, | ||
scalacOptions += "-P:silencer:pathFilters=views", | ||
libraryDependencies ++= Seq( | ||
compilerPlugin("com.github.ghik" % "silencer-plugin" % silencerVersion cross CrossVersion.full), | ||
"com.github.ghik" % "silencer-lib" % silencerVersion % Provided cross CrossVersion.full | ||
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( | ||
Compile / TwirlKeys.compileTemplates / sourceDirectories += | ||
(Compile / sourceDirectory).value / "scala" | ||
crossScalaVersions := Seq(scala2_13), | ||
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), | ||
libraryDependencies ++= AppDependencies.play30 | ||
) | ||
.settings( | ||
Compile / TwirlKeys.compileTemplates / sourceDirectories ++= | ||
(Compile / unmanagedSourceDirectories).value, | ||
TwirlKeys.templateImports ++= Seq( | ||
"play.api.mvc._", | ||
"play.api.data._", | ||
"play.api.i18n._" | ||
) | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,4 @@ | |
@Html(" | ") | ||
} | ||
} | ||
</p> | ||
</p> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
play-language/src/main/scala/uk/gov/uk/hmrc/play/language/PlayLanguageLibraryHasMoved.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2023 HM Revenue & Customs | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package uk.gov.hmrc.play.language | ||
|
||
/* | ||
* play-language has been replaced with play-language-play-xx. | ||
* See [uk.gov.hmrc.play.language.LanguageController] | ||
*/ | ||
private class PlayLanguageLibraryHasMoved |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.6.2 | ||
sbt.version=1.9.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
repoVisibility: public_0C3F0CE3E6E6448FAD341E7BFA50FCD333E06A20CFF05FCACE61154DDBBADF71 | ||
type: library |