Skip to content

Commit

Permalink
Add Play 2.8.x compatibility
Browse files Browse the repository at this point in the history
Play's 2.8 changelog does not mention much actually needing
to change from the build pipeline perspective, so an easy
string replacement for the integration test fixtures to verify
and test should be enough to verify.

Based on the previous PR from #133, this
expands the changes to ensure the integration tests pass as
well.

Signed-off-by: Gabriel Harris-Rouquette <[email protected]>
  • Loading branch information
gabizou committed Oct 20, 2020
1 parent ddbc171 commit 432efec
Show file tree
Hide file tree
Showing 30 changed files with 35 additions and 30 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
env: GRADLE_TASK=integrationTest PLAY_VERSION=2.6.25
- name: "Play 2.7.5 Integration Tests"
env: GRADLE_TASK=integrationTest PLAY_VERSION=2.7.5
- name: "Play 2.8.2 Integration Tests"
env: GRADLE_TASK=integrationTest PLAY_VERSION=2.8.2
- name: "Documentation Tests"
env: GRADLE_TASK=docTest PLAY_VERSION=not_used

Expand Down
2 changes: 1 addition & 1 deletion src/docs/asciidoc/00-intro.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The Play plugin defines the following requirements for a consuming build.

* The build has to be run with Java 8 or higher.
* The build has to use Gradle 5.0 or higher.
* The supported Play versions are 2.4.x, 2.5.x, 2.6.x, and 2.7.x.
* The supported Play versions are 2.4.x, 2.5.x, 2.6.x, 2.7.x, and 2.8.x.

=== Limitations

Expand Down
4 changes: 4 additions & 0 deletions src/docs/asciidoc/11-play-framework.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ The following versions of Play and Scala are supported:
|===
| Play | Scala | Java

| 2.8.x
| 2.12 and 2.13
| 1.8

| 2.7.x
| 2.11, 2.12 and 2.13
| 1.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ final class PlayCoverage {
VersionNumber.parse('2.4.11'),
VersionNumber.parse('2.5.19'),
VersionNumber.parse('2.7.5'),
// Not supported yet
// VersionNumber.parse('2.8.0'),
VersionNumber.parse('2.8.0'),
DEFAULT
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package controllers

<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
import javax.inject._
import play.api._
import play.api.mvc._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import jva.html.*;

public class PureJava extends Controller {

<#if playVersion == "2.7">
<#if playVersion == "2.8" || playVersion == "2.7">
public Result index() {
<#else>
public static Result index() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import views.html.*;

public class MixedJava extends Controller {

<#if playVersion == "2.7">
<#if playVersion == "2.8" || playVersion == "2.7">
public Result index() {
<#else>
public static Result index() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package special.strangename

<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
import javax.inject._
import play.api._
import play.api.mvc._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sourceSets {
}
}

<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
dependencies {
implementation "com.typesafe.play:play-guice_2.12:2.6.15"
implementation "ch.qos.logback:logback-classic:1.2.3"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
# Routes
GET / @controllers.Application.index
GET /root @controllers.Application.root
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
GET /one controllers.scla.MixedJava.index
POST /two @special.strangename.Application.index

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package controllers

<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
import javax.inject._
import play.api._
import play.api.mvc._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
plugins {
id 'org.gradle.playframework'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
# Routes
# Home page
GET / @controllers.Application.index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package controllers

<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
import javax.inject._
import com.google.common.base.Strings
import play.api._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
plugins {
id 'org.gradle.playframework'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
# Routes
# Home page
GET / @controllers.Application.index
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package controllers

<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
import javax.inject._
import play.api._
import play.api.mvc._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
plugins {
id 'org.gradle.playframework'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
GET / @controllers.Application.index
GET /shutdown @controllers.Application.shutdown
GET /assets/*file @controllers.Assets.at(path="/public", file)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
plugins {
id 'org.gradle.playframework'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package controllers

<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
import javax.inject._
import play.api._
import play.api.mvc._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
plugins {
id 'org.gradle.playframework'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
# https://www.playframework.com/documentation/2.6.x/ApplicationSecret
play.http.secret.key="somethingsecret"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
GET / @controllers.Application.index
GET /shutdown @controllers.Application.shutdown
GET /submodule @controllers.submodule.Application.index
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package controllers.submodule

<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
import javax.inject._
import play.api._
import play.api.mvc._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
plugins {
id 'org.gradle.playframework'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#if playVersion == "2.7" || playVersion == "2.6">
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6">
play.http.secret.key="TY9[b`xw2MeXUt;M<i_B0kUKm8/?PD1cS1WhFYyZ[1^6`Apew34q6DyNL=UqG/1l"
<#else>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ public enum PlayMajorVersion {
PLAY_2_4_X("2.4.x", true, "2.11", "2.10"),
PLAY_2_5_X("2.5.x", true,"2.11"),
PLAY_2_6_X("2.6.x", true, "2.12", "2.11"),
PLAY_2_7_X("2.7.x", false, "2.13", "2.12", "2.11");
// Not supported yet
// PLAY_2_8_X("2.8.x", false, "2.13", "2.12");
PLAY_2_7_X("2.7.x", false, "2.13", "2.12", "2.11"),
PLAY_2_8_X("2.8.x", false, "2.13", "2.12");

private final String name;
private final boolean supportForStaticRoutes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public static VersionedRoutesCompilerAdapter createAdapter(PlayPlatform playPlat
case PLAY_2_6_X:
return new RoutesCompilerAdapterV24X(playVersion, scalaVersion);
case PLAY_2_7_X:
case PLAY_2_8_X:
default:
return new RoutesCompilerAdapterV27X(playVersion, scalaVersion);
}
Expand Down

0 comments on commit 432efec

Please sign in to comment.