Skip to content

Commit

Permalink
Update Play! test app to 3.0.3 (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
Malax authored May 23, 2024
1 parent 31b04d5 commit 0d93da6
Show file tree
Hide file tree
Showing 29 changed files with 90 additions and 64 deletions.
1 change: 0 additions & 1 deletion buildpacks/sbt/test-apps/play-framework-2.8.19/Procfile

This file was deleted.

11 changes: 0 additions & 11 deletions buildpacks/sbt/test-apps/play-framework-2.8.19/build.sc

This file was deleted.

40 changes: 0 additions & 40 deletions buildpacks/sbt/test-apps/play-framework-2.8.19/conf/logback.xml

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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:
/*
Expand Down
12 changes: 12 additions & 0 deletions buildpacks/sbt/test-apps/play-framework-3.0.3/.g8/form/conf/routes
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions buildpacks/sbt/test-apps/play-framework-3.0.3/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: target/universal/stage/bin/play-scala-seed -Dhttp.port=${PORT}
Original file line number Diff line number Diff line change
@@ -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._"
11 changes: 11 additions & 0 deletions buildpacks/sbt/test-apps/play-framework-3.0.3/build.sc
Original file line number Diff line number Diff line change
@@ -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
}
50 changes: 50 additions & 0 deletions buildpacks/sbt/test-apps/play-framework-3.0.3/conf/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!-- https://www.playframework.com/documentation/latest/SettingsLogger -->

<!DOCTYPE configuration>

<configuration>
<import class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"/>
<import class="ch.qos.logback.classic.AsyncAppender"/>
<import class="ch.qos.logback.core.FileAppender"/>
<import class="ch.qos.logback.core.ConsoleAppender"/>

<appender name="FILE" class="FileAppender">
<file>${application.home:-.}/logs/application.log</file>
<encoder class="PatternLayoutEncoder">
<charset>UTF-8</charset>
<pattern>%d{yyyy-MM-dd HH:mm:ss} %highlight(%-5level) %cyan(%logger{36}) %magenta(%X{pekkoSource}) %msg%n</pattern>
</encoder>
</appender>

<appender name="STDOUT" class="ConsoleAppender">
<!--
On Windows, enabling Jansi is recommended to benefit from color code interpretation on DOS command prompts,
which otherwise risk being sent ANSI escape sequences that they cannot interpret.
See https://logback.qos.ch/manual/layouts.html#coloring
-->
<!-- <withJansi>true</withJansi> -->
<encoder class="PatternLayoutEncoder">
<charset>UTF-8</charset>
<pattern>%d{yyyy-MM-dd HH:mm:ss} %highlight(%-5level) %cyan(%logger{36}) %magenta(%X{pekkoSource}) %msg%n</pattern>
</encoder>
</appender>

<appender name="ASYNCFILE" class="AsyncAppender">
<appender-ref ref="FILE"/>
</appender>

<appender name="ASYNCSTDOUT" class="AsyncAppender">
<appender-ref ref="STDOUT"/>
</appender>

<logger name="play" level="INFO"/>
<logger name="application" level="DEBUG"/>

<root level="WARN">
<appender-ref ref="ASYNCFILE"/>
<appender-ref ref="ASYNCSTDOUT"/>
</root>

</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.10.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.3")
addSbtPlugin("org.foundweekends.giter8" % "sbt-giter8-scaffold" % "0.16.2")
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java.runtime.version = 17
4 changes: 2 additions & 2 deletions buildpacks/sbt/tests/integration/smoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!",
);
Expand Down

0 comments on commit 0d93da6

Please sign in to comment.