From 0d93da68fbe78797f045b32b68ac8c9a956397af Mon Sep 17 00:00:00 2001 From: Manuel Fuchs Date: Thu, 23 May 2024 14:04:30 +0200 Subject: [PATCH] Update Play! test app to 3.0.3 (#670) --- .../test-apps/play-framework-2.8.19/Procfile | 1 - .../test-apps/play-framework-2.8.19/build.sc | 11 ---- .../play-framework-2.8.19/conf/logback.xml | 40 -------------- .../project/build.properties | 1 - .../play-framework-2.8.19/project/plugins.sbt | 2 - .../$model__Camel$Controller.scala | 3 ++ .../app/views/$model__camel$/form.scala.html | 0 .../play-framework-3.0.3/.g8/form/conf/routes | 12 +++++ .../.g8/form/default.properties | 0 .../$model__Camel$ControllerSpec.scala | 0 .../.gitignore | 0 .../test-apps/play-framework-3.0.3/Procfile | 1 + .../app/controllers/HomeController.scala | 0 .../app/views/index.scala.html | 0 .../app/views/main.scala.html | 0 .../build.sbt | 12 ++--- .../test-apps/play-framework-3.0.3/build.sc | 11 ++++ .../conf/application.conf | 0 .../play-framework-3.0.3/conf/logback.xml | 50 ++++++++++++++++++ .../conf/messages | 0 .../conf/routes | 2 +- .../project/build.properties | 1 + .../play-framework-3.0.3/project/plugins.sbt | 2 + .../public/images/favicon.png | Bin .../public/javascripts/main.js | 0 .../public/stylesheets/main.css | 0 .../play-framework-3.0.3/system.properties | 1 + .../test/controllers/HomeControllerSpec.scala | 0 buildpacks/sbt/tests/integration/smoke.rs | 4 +- 29 files changed, 90 insertions(+), 64 deletions(-) delete mode 100644 buildpacks/sbt/test-apps/play-framework-2.8.19/Procfile delete mode 100644 buildpacks/sbt/test-apps/play-framework-2.8.19/build.sc delete mode 100644 buildpacks/sbt/test-apps/play-framework-2.8.19/conf/logback.xml delete mode 100644 buildpacks/sbt/test-apps/play-framework-2.8.19/project/build.properties delete mode 100644 buildpacks/sbt/test-apps/play-framework-2.8.19/project/plugins.sbt rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/.g8/form/app/controllers/$model__Camel$Controller.scala (92%) rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/.g8/form/app/views/$model__camel$/form.scala.html (100%) create mode 100644 buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/conf/routes rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/.g8/form/default.properties (100%) rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/.g8/form/test/controllers/$model__Camel$ControllerSpec.scala (100%) rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/.gitignore (100%) create mode 100644 buildpacks/sbt/test-apps/play-framework-3.0.3/Procfile rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/app/controllers/HomeController.scala (100%) rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/app/views/index.scala.html (100%) rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/app/views/main.scala.html (100%) rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/build.sbt (52%) create mode 100644 buildpacks/sbt/test-apps/play-framework-3.0.3/build.sc rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/conf/application.conf (100%) create mode 100644 buildpacks/sbt/test-apps/play-framework-3.0.3/conf/logback.xml rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/conf/messages (100%) rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/conf/routes (88%) create mode 100644 buildpacks/sbt/test-apps/play-framework-3.0.3/project/build.properties create mode 100644 buildpacks/sbt/test-apps/play-framework-3.0.3/project/plugins.sbt rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/public/images/favicon.png (100%) rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/public/javascripts/main.js (100%) rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/public/stylesheets/main.css (100%) create mode 100644 buildpacks/sbt/test-apps/play-framework-3.0.3/system.properties rename buildpacks/sbt/test-apps/{play-framework-2.8.19 => play-framework-3.0.3}/test/controllers/HomeControllerSpec.scala (100%) diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/Procfile b/buildpacks/sbt/test-apps/play-framework-2.8.19/Procfile deleted file mode 100644 index e40fcacd..00000000 --- a/buildpacks/sbt/test-apps/play-framework-2.8.19/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: target/universal/stage/bin/play-framework-2-8-19 -Dhttp.port=${PORT} diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/build.sc b/buildpacks/sbt/test-apps/play-framework-2.8.19/build.sc deleted file mode 100644 index 22918bf1..00000000 --- a/buildpacks/sbt/test-apps/play-framework-2.8.19/build.sc +++ /dev/null @@ -1,11 +0,0 @@ -import mill._ -import $ivy.`com.lihaoyi::mill-contrib-playlib:`, mill.playlib._ - -object testapp extends PlayModule with SingleModule { - - def scalaVersion = "2.13.10" - def playVersion = "2.8.19" - def twirlVersion = "1.5.1" - - object test extends PlayTests -} diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/conf/logback.xml b/buildpacks/sbt/test-apps/play-framework-2.8.19/conf/logback.xml deleted file mode 100644 index a73d2016..00000000 --- a/buildpacks/sbt/test-apps/play-framework-2.8.19/conf/logback.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - ${application.home:-.}/logs/application.log - - UTF-8 - - %d{yyyy-MM-dd HH:mm:ss} %highlight(%-5level) %cyan(%logger{36}) %magenta(%X{akkaSource}) %msg%n - - - - - - true - - UTF-8 - - %d{yyyy-MM-dd HH:mm:ss} %highlight(%-5level) %cyan(%logger{36}) %magenta(%X{akkaSource}) %msg%n - - - - - - - - - - - - - - - - - - - - - diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/project/build.properties b/buildpacks/sbt/test-apps/play-framework-2.8.19/project/build.properties deleted file mode 100644 index 563a014d..00000000 --- a/buildpacks/sbt/test-apps/play-framework-2.8.19/project/build.properties +++ /dev/null @@ -1 +0,0 @@ -sbt.version=1.7.2 diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/project/plugins.sbt b/buildpacks/sbt/test-apps/play-framework-2.8.19/project/plugins.sbt deleted file mode 100644 index 8846622e..00000000 --- a/buildpacks/sbt/test-apps/play-framework-2.8.19/project/plugins.sbt +++ /dev/null @@ -1,2 +0,0 @@ -addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.19") -addSbtPlugin("org.foundweekends.giter8" % "sbt-giter8-scaffold" % "0.13.1") diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/.g8/form/app/controllers/$model__Camel$Controller.scala b/buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/app/controllers/$model__Camel$Controller.scala similarity index 92% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/.g8/form/app/controllers/$model__Camel$Controller.scala rename to buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/app/controllers/$model__Camel$Controller.scala index 6977727b..92a5f1dd 100644 --- a/buildpacks/sbt/test-apps/play-framework-2.8.19/.g8/form/app/controllers/$model__Camel$Controller.scala +++ b/buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/app/controllers/$model__Camel$Controller.scala @@ -7,6 +7,9 @@ import play.api.data._ import play.api.data.Forms._ case class $model;format="Camel"$Data(name: String, age: Int) +object $model;format="Camel"$Data { + def unapply(data: $model;format="Camel"$Data): Option[(String, Int)] = Some((data.name, data.age)) +} // NOTE: Add the following to conf/routes to enable compilation of this class: /* diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/.g8/form/app/views/$model__camel$/form.scala.html b/buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/app/views/$model__camel$/form.scala.html similarity index 100% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/.g8/form/app/views/$model__camel$/form.scala.html rename to buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/app/views/$model__camel$/form.scala.html diff --git a/buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/conf/routes b/buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/conf/routes new file mode 100644 index 00000000..8bbbe144 --- /dev/null +++ b/buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/conf/routes @@ -0,0 +1,12 @@ +# Routes +# This file defines all application routes (Higher priority routes first) +# https://www.playframework.com/documentation/latest/ScalaRouting +# ~~~~ + +# An example controller showing a sample home page +GET / controllers.HomeController.index() +GET /$model;format="camel"$ controllers.$model;format="Camel"$Controller.$model;format="camel"$Get() +POST /$model;format="camel"$ controllers.$model;format="Camel"$Controller.$model;format="camel"$Post() + +# Map static resources from the /public folder to the /assets URL path +GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset) diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/.g8/form/default.properties b/buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/default.properties similarity index 100% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/.g8/form/default.properties rename to buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/default.properties diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/.g8/form/test/controllers/$model__Camel$ControllerSpec.scala b/buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/test/controllers/$model__Camel$ControllerSpec.scala similarity index 100% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/.g8/form/test/controllers/$model__Camel$ControllerSpec.scala rename to buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/test/controllers/$model__Camel$ControllerSpec.scala diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/.gitignore b/buildpacks/sbt/test-apps/play-framework-3.0.3/.gitignore similarity index 100% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/.gitignore rename to buildpacks/sbt/test-apps/play-framework-3.0.3/.gitignore diff --git a/buildpacks/sbt/test-apps/play-framework-3.0.3/Procfile b/buildpacks/sbt/test-apps/play-framework-3.0.3/Procfile new file mode 100644 index 00000000..24344ee2 --- /dev/null +++ b/buildpacks/sbt/test-apps/play-framework-3.0.3/Procfile @@ -0,0 +1 @@ +web: target/universal/stage/bin/play-scala-seed -Dhttp.port=${PORT} diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/app/controllers/HomeController.scala b/buildpacks/sbt/test-apps/play-framework-3.0.3/app/controllers/HomeController.scala similarity index 100% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/app/controllers/HomeController.scala rename to buildpacks/sbt/test-apps/play-framework-3.0.3/app/controllers/HomeController.scala diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/app/views/index.scala.html b/buildpacks/sbt/test-apps/play-framework-3.0.3/app/views/index.scala.html similarity index 100% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/app/views/index.scala.html rename to buildpacks/sbt/test-apps/play-framework-3.0.3/app/views/index.scala.html diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/app/views/main.scala.html b/buildpacks/sbt/test-apps/play-framework-3.0.3/app/views/main.scala.html similarity index 100% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/app/views/main.scala.html rename to buildpacks/sbt/test-apps/play-framework-3.0.3/app/views/main.scala.html diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/build.sbt b/buildpacks/sbt/test-apps/play-framework-3.0.3/build.sbt similarity index 52% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/build.sbt rename to buildpacks/sbt/test-apps/play-framework-3.0.3/build.sbt index 10ca03bc..4c097424 100644 --- a/buildpacks/sbt/test-apps/play-framework-2.8.19/build.sbt +++ b/buildpacks/sbt/test-apps/play-framework-3.0.3/build.sbt @@ -1,17 +1,17 @@ -name := """play-framework-2.8.19""" -organization := "com.heroku" +name := """play-scala-seed""" +organization := "com.example" version := "1.0-SNAPSHOT" lazy val root = (project in file(".")).enablePlugins(PlayScala) -scalaVersion := "2.13.10" +scalaVersion := "2.13.14" libraryDependencies += guice -libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "5.0.0" % Test +libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "7.0.0" % Test // Adds additional packages into Twirl -//TwirlKeys.templateImports += "com.heroku.controllers._" +//TwirlKeys.templateImports += "com.example.controllers._" // Adds additional packages into conf/routes -// play.sbt.routes.RoutesKeys.routesImport += "com.heroku.binders._" +// play.sbt.routes.RoutesKeys.routesImport += "com.example.binders._" diff --git a/buildpacks/sbt/test-apps/play-framework-3.0.3/build.sc b/buildpacks/sbt/test-apps/play-framework-3.0.3/build.sc new file mode 100644 index 00000000..c648af53 --- /dev/null +++ b/buildpacks/sbt/test-apps/play-framework-3.0.3/build.sc @@ -0,0 +1,11 @@ +import mill._ +import $ivy.`com.lihaoyi::mill-contrib-playlib:`, mill.playlib._ + +object playscalaseed extends PlayModule with SingleModule { + + def scalaVersion = "2.13.14" + def playVersion = "3.0.3" + def twirlVersion = "2.0.1" + + object test extends PlayTests +} diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/conf/application.conf b/buildpacks/sbt/test-apps/play-framework-3.0.3/conf/application.conf similarity index 100% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/conf/application.conf rename to buildpacks/sbt/test-apps/play-framework-3.0.3/conf/application.conf diff --git a/buildpacks/sbt/test-apps/play-framework-3.0.3/conf/logback.xml b/buildpacks/sbt/test-apps/play-framework-3.0.3/conf/logback.xml new file mode 100644 index 00000000..ab6c2b12 --- /dev/null +++ b/buildpacks/sbt/test-apps/play-framework-3.0.3/conf/logback.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + ${application.home:-.}/logs/application.log + + UTF-8 + %d{yyyy-MM-dd HH:mm:ss} %highlight(%-5level) %cyan(%logger{36}) %magenta(%X{pekkoSource}) %msg%n + + + + + + + + UTF-8 + %d{yyyy-MM-dd HH:mm:ss} %highlight(%-5level) %cyan(%logger{36}) %magenta(%X{pekkoSource}) %msg%n + + + + + + + + + + + + + + + + + + + + diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/conf/messages b/buildpacks/sbt/test-apps/play-framework-3.0.3/conf/messages similarity index 100% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/conf/messages rename to buildpacks/sbt/test-apps/play-framework-3.0.3/conf/messages diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/conf/routes b/buildpacks/sbt/test-apps/play-framework-3.0.3/conf/routes similarity index 88% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/conf/routes rename to buildpacks/sbt/test-apps/play-framework-3.0.3/conf/routes index 78423e73..60e8169b 100644 --- a/buildpacks/sbt/test-apps/play-framework-2.8.19/conf/routes +++ b/buildpacks/sbt/test-apps/play-framework-3.0.3/conf/routes @@ -3,7 +3,7 @@ # https://www.playframework.com/documentation/latest/ScalaRouting # ~~~~ -# An heroku controller showing a sample home page +# An example controller showing a sample home page GET / controllers.HomeController.index() # Map static resources from the /public folder to the /assets URL path diff --git a/buildpacks/sbt/test-apps/play-framework-3.0.3/project/build.properties b/buildpacks/sbt/test-apps/play-framework-3.0.3/project/build.properties new file mode 100644 index 00000000..081fdbbc --- /dev/null +++ b/buildpacks/sbt/test-apps/play-framework-3.0.3/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.10.0 diff --git a/buildpacks/sbt/test-apps/play-framework-3.0.3/project/plugins.sbt b/buildpacks/sbt/test-apps/play-framework-3.0.3/project/plugins.sbt new file mode 100644 index 00000000..6a36a90a --- /dev/null +++ b/buildpacks/sbt/test-apps/play-framework-3.0.3/project/plugins.sbt @@ -0,0 +1,2 @@ +addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.3") +addSbtPlugin("org.foundweekends.giter8" % "sbt-giter8-scaffold" % "0.16.2") diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/public/images/favicon.png b/buildpacks/sbt/test-apps/play-framework-3.0.3/public/images/favicon.png similarity index 100% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/public/images/favicon.png rename to buildpacks/sbt/test-apps/play-framework-3.0.3/public/images/favicon.png diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/public/javascripts/main.js b/buildpacks/sbt/test-apps/play-framework-3.0.3/public/javascripts/main.js similarity index 100% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/public/javascripts/main.js rename to buildpacks/sbt/test-apps/play-framework-3.0.3/public/javascripts/main.js diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/public/stylesheets/main.css b/buildpacks/sbt/test-apps/play-framework-3.0.3/public/stylesheets/main.css similarity index 100% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/public/stylesheets/main.css rename to buildpacks/sbt/test-apps/play-framework-3.0.3/public/stylesheets/main.css diff --git a/buildpacks/sbt/test-apps/play-framework-3.0.3/system.properties b/buildpacks/sbt/test-apps/play-framework-3.0.3/system.properties new file mode 100644 index 00000000..88e47604 --- /dev/null +++ b/buildpacks/sbt/test-apps/play-framework-3.0.3/system.properties @@ -0,0 +1 @@ +java.runtime.version = 17 diff --git a/buildpacks/sbt/test-apps/play-framework-2.8.19/test/controllers/HomeControllerSpec.scala b/buildpacks/sbt/test-apps/play-framework-3.0.3/test/controllers/HomeControllerSpec.scala similarity index 100% rename from buildpacks/sbt/test-apps/play-framework-2.8.19/test/controllers/HomeControllerSpec.scala rename to buildpacks/sbt/test-apps/play-framework-3.0.3/test/controllers/HomeControllerSpec.scala diff --git a/buildpacks/sbt/tests/integration/smoke.rs b/buildpacks/sbt/tests/integration/smoke.rs index b1f2b979..379390f1 100644 --- a/buildpacks/sbt/tests/integration/smoke.rs +++ b/buildpacks/sbt/tests/integration/smoke.rs @@ -10,10 +10,10 @@ use buildpacks_jvm_shared_test::{smoke_test, DEFAULT_INTEGRATION_TEST_BUILDER}; #[test] #[ignore = "integration test"] -fn smoke_test_play_framework_2_8_19() { +fn smoke_test_play_framework_3_0_3() { smoke_test( DEFAULT_INTEGRATION_TEST_BUILDER, - "test-apps/play-framework-2.8.19", + "test-apps/play-framework-3.0.3", default_buildpacks(), "Welcome to Play!", );