Skip to content

Commit

Permalink
Merge pull request #12559 from mkurz/twirl_2.0.5
Browse files Browse the repository at this point in the history
[3.0.x] Twirl 2.0.5
  • Loading branch information
mkurz committed Apr 26, 2024
2 parents 90f5ecd + 6917173 commit a112362
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion documentation/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.8.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")

// Required for Tutorial
addSbtPlugin("org.playframework.twirl" % "sbt-twirl" % "2.0.4") // sync with project/plugins.sbt
addSbtPlugin("org.playframework.twirl" % "sbt-twirl" % "2.0.5") // sync with project/plugins.sbt

// Required for IDE docs
addSbtPlugin("com.github.sbt" % "sbt-eclipse" % "6.2.0")
34 changes: 34 additions & 0 deletions project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,40 @@ object BuildSettings {
(organization.value %% moduleName.value % version).cross(cross)
}.toSet,
mimaBinaryIssueFilters ++= Seq(
// Upgrade to Twirl 2.0.5:
// It's not necessary to mixin the Template[0-22] trait(s) into a Twirl template anymore when using Scala 3.
// In Scala 2 this is just done to raise a meaningful exception when more than 22 arguments were passed to the template (which Scala 2 does not support).
// Since Scala 3 does support more than 22 args, we can just remove the trait(s) from the generated Twirl Scala code.
// See https://github.com/playframework/twirl/pull/747
// Again, this binary incompatibility only affects Scala 3 artifacts, but in real life, this should have no effect anyway
// because either Twirl templates will be regenerated or the missing trait should not affect on how the template is called anyway.
// For the record, the error message MiMa came up with was:
// "the type hierarchy of object views.html.[defaultpages|helper].<page> is different in current version. Missing types {play.twirl.api.Template[1-4]}"
ProblemFilters.exclude[MissingTypesProblem]("views.html.defaultpages.badRequest$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.defaultpages.devError$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.defaultpages.devNotFound$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.defaultpages.error$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.defaultpages.notFound$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.defaultpages.todo$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.defaultpages.unauthorized$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.checkbox$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.defaultFieldConstructor$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.form$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.input$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.inputCheckboxGroup$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.inputDate$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.inputFile$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.inputPassword$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.inputRadioGroup$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.inputText$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.javascriptRouter$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.jsloader$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.requireJs$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.script$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.select$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.style$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.helper.textarea$"),
ProblemFilters.exclude[MissingTypesProblem]("views.html.play20.manual$"),
),
(Compile / unmanagedSourceDirectories) += {
val suffix = CrossVersion.partialVersion(scalaVersion.value) match {
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ val sbtJmh = "0.4.7"
val webjarsLocatorCore = "0.58"
val sbtHeader = "5.8.0"
val scalafmt = "2.4.6"
val sbtTwirl: String = sys.props.getOrElse("twirl.version", "2.0.4") // sync with documentation/project/plugins.sbt
val sbtTwirl: String = sys.props.getOrElse("twirl.version", "2.0.5") // sync with documentation/project/plugins.sbt

buildInfoKeys := Seq[BuildInfoKey](
"sbtNativePackagerVersion" -> sbtNativePackager,
Expand Down

0 comments on commit a112362

Please sign in to comment.