Skip to content

Commit

Permalink
Merge pull request #167 from hmrc/PLATUI-1736_cross_compile_scala
Browse files Browse the repository at this point in the history
PLATUI-1736: Cross build for Scala 2.13
  • Loading branch information
kyle-bowden committed May 30, 2022
2 parents b2c6360 + 712dc02 commit 53124d2
Show file tree
Hide file tree
Showing 100 changed files with 141 additions and 110 deletions.
17 changes: 8 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import uk.gov.hmrc.playcrosscompilation.PlayVersion

val scala2_12 = "2.12.15"
val scala2_13 = "2.13.7"

val appName = "play-ui"
val silencerVersion = "1.4.4"
val silencerVersion = "1.7.7"

lazy val root = Project(appName, file("."))
.enablePlugins(SbtAutoBuildPlugin, SbtGitVersioning, SbtTwirl)
.enablePlugins(SbtTwirl)
.disablePlugins(JUnitXmlReportPlugin) // Required to prevent https://github.com/scalatest/scalatest/issues/1427
.settings(
majorVersion := 9,
scalaVersion := "2.12.10",
crossScalaVersions := List("2.12.10"),
libraryDependencies ++= LibDependencies.libDependencies,
resolvers :=
Seq(
"typesafe-releases" at "https://repo.typesafe.com/typesafe/releases/"
)
scalaVersion := scala2_12,
crossScalaVersions := Seq(scala2_12, scala2_13),
libraryDependencies ++= LibDependencies.libDependencies
)
.settings(
TwirlKeys.templateImports := Seq(
Expand Down
32 changes: 32 additions & 0 deletions docs/maintainers/0001-scala-cross-compilation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# play-ui scala 2.13 cross compilation

* Status: accepted
* Date: 2022-05-30

## Context and Problem Statement

The need to allow scala cross compilation for scala version 2.13

## Decision Drivers

* as new scala versions are released we are in the process of allowing cross compilation between these new scala versions,
for all our libraries and services so when service teams that use our libraries/services update their scala versions our libraries/services will support it.
* we don't want new services to start using play-ui
* we want to be able to easily change our mind if we need to

## Considered Options

* Do not allow scala cross compilation for scala version 2.13
* Add scala cross compilation for scala version 2.13

## Decision Outcome

Chosen option "Add scala cross compilation" because contact-frontend has a dependency on play-ui for its partial views and contact-frontend supports scala cross compilation for scala v2.13.
### Positive Consequences

* We are able to support our contact-frontend service as it has scala cross compilation and has play-ui as a dependency.

### Negative Consequences

* As adding scala cross compilation for version 2.13 would be implicitly supporting this deprecated library, we would not want to give service teams that are still using this library the wrong impression that we are still actively supporting it.
* By adding scala cross compilation for version 2.13, we could be creating more work for ourselves as there could be issues when service teams still actively using this library upgrade there scala version to 2.13. We would end up supporting those queries which we shouldn't do as we do not actively support this deprecated library anymore.
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# limitations under the License.
#

sbt.version=1.4.6
sbt.version=1.5.8
7 changes: 3 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ resolvers += MavenRepository("HMRC-open-artefacts-maven2", "https://open.artefac
resolvers += Resolver.url("HMRC-open-artefacts-ivy2", url("https://open.artefacts.tax.service.gov.uk/ivy2"))(
Resolver.ivyStylePatterns
)
resolvers += Resolver.typesafeRepo("releases")

addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.0.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.6.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.3.15")
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.5.1")

addSbtPlugin("uk.gov.hmrc" % "sbt-play-cross-compilation" % "2.2.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-play-cross-compilation" % "2.3.0")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0")
2 changes: 1 addition & 1 deletion src/main/resources/reference.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 HM Revenue & Customs
# Copyright 2022 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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/uk/gov/hmrc/play/binders/ContinueUrl.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/uk/gov/hmrc/play/binders/Origin.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/uk/gov/hmrc/play/binders/QueryBinders.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/uk/gov/hmrc/play/config/AssetsConfig.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/uk/gov/hmrc/play/config/GTMConfig.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/uk/gov/hmrc/play/mappers/DateTuple.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand All @@ -15,6 +15,7 @@
*@

@import uk.gov.hmrc.play.views.helpers.FormField
@import scala.language.postfixOps

@this(dateFieldsInline: DateFieldsInline, dropdown: Dropdown)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/twirl/uk/gov/hmrc/play/views/helpers/model.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@*
* Copyright 2021 HM Revenue & Customs
* Copyright 2022 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.
Expand Down
Loading

0 comments on commit 53124d2

Please sign in to comment.