diff --git a/.travis.yml b/.travis.yml index 869fdda7..6a01e1c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,13 +4,23 @@ install: true jdk: - openjdk8 -matrix: +jobs: include: - - env: GRADLE_TASK=integrationTest - - env: GRADLE_TASK=docTest + - name: "Play 2.3.10 Integration Tests" + env: GRADLE_TASK=integrationTest PLAY_VERSION=2.3.10 + - name: "Play 2.4.11 Integration Tests" + env: GRADLE_TASK=integrationTest PLAY_VERSION=2.4.11 + - name: "Play 2.5.19 Integration Tests" + env: GRADLE_TASK=integrationTest PLAY_VERSION=2.5.19 + - name: "Play 2.6.25 Integration Tests" + env: GRADLE_TASK=integrationTest PLAY_VERSION=2.6.25 + - name: "Play 2.7.3 Integration Tests" + env: GRADLE_TASK=integrationTest PLAY_VERSION=2.7.3 + - name: "Documentation Tests" + env: GRADLE_TASK=docTest PLAY_VERSION=not_used script: - - ./gradlew $GRADLE_TASK -s --continue + - ./gradlew -Pplayframework.int-test.target.version=$PLAY_VERSION $GRADLE_TASK -s --continue before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock diff --git a/build.gradle.kts b/build.gradle.kts index ef89b4e5..ba279743 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,6 +25,7 @@ dependencies { integTestFixturesImplementation("com.google.guava:guava:23.0") integTestFixturesImplementation("org.hamcrest:hamcrest-library:1.3") integTestFixturesImplementation("org.apache.ant:ant:1.9.3") + integTestFixturesImplementation("org.freemarker:freemarker:2.3.30") docTestImplementation("org.gradle:sample-check:0.7.0") docTestRuntimeOnly("org.slf4j:slf4j-simple:1.7.16") } diff --git a/buildSrc/src/main/kotlin/org/gradle/playframework/TestSetupPlugin.kt b/buildSrc/src/main/kotlin/org/gradle/playframework/TestSetupPlugin.kt index da6282e3..070c2b92 100644 --- a/buildSrc/src/main/kotlin/org/gradle/playframework/TestSetupPlugin.kt +++ b/buildSrc/src/main/kotlin/org/gradle/playframework/TestSetupPlugin.kt @@ -3,6 +3,7 @@ package org.gradle.playframework import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.tasks.testing.Test +import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.kotlin.dsl.withType @@ -11,8 +12,13 @@ class TestSetupPlugin : Plugin { tasks.withType().configureEach { // Log test execution so that Travis CI doesn't time out if (System.getenv("CI") != null) { + // Enable detailed logging when running in Travis CI, + // so that we can understand why a build failed + // From: https://stackoverflow.com/a/47458666 testLogging { - events("started") + events("started", "passed", "skipped", "failed") + showStackTraces = true + exceptionFormat = TestExceptionFormat.FULL } } diff --git a/src/integTest/groovy/org/gradle/playframework/application/PlayApplicationPluginIntegrationTest.groovy b/src/integTest/groovy/org/gradle/playframework/application/PlayApplicationPluginIntegrationTest.groovy index 79321f81..f65f2c78 100644 --- a/src/integTest/groovy/org/gradle/playframework/application/PlayApplicationPluginIntegrationTest.groovy +++ b/src/integTest/groovy/org/gradle/playframework/application/PlayApplicationPluginIntegrationTest.groovy @@ -52,13 +52,23 @@ abstract class PlayApplicationPluginIntegrationTest extends PlayMultiVersionAppl } void verifyJars() { - jar("build/libs/${playApp.name}.jar").containsDescendants( - 'router/Routes.class', - 'views/html/index.class', - 'views/html/main.class', - 'controllers/Application.class', - 'application.conf', - 'logback.xml') + if (playVersion.major == 2 && playVersion.minor == 3) { + jar("build/libs/${playApp.name}.jar").containsDescendants( + 'Routes.class', + 'views/html/index.class', + 'views/html/main.class', + 'controllers/Application.class', + 'application.conf', + 'logback.xml') + } else { + jar("build/libs/${playApp.name}.jar").containsDescendants( + 'router/Routes.class', + 'views/html/index.class', + 'views/html/main.class', + 'controllers/Application.class', + 'application.conf', + 'logback.xml') + } jar("build/libs/${playApp.name}-assets.jar").containsDescendants( 'public/images/favicon.svg', 'public/stylesheets/main.css', diff --git a/src/integTest/groovy/org/gradle/playframework/tasks/AbstractRoutesCompileIntegrationTest.groovy b/src/integTest/groovy/org/gradle/playframework/tasks/AbstractRoutesCompileIntegrationTest.groovy index 87a6d4f0..02464268 100644 --- a/src/integTest/groovy/org/gradle/playframework/tasks/AbstractRoutesCompileIntegrationTest.groovy +++ b/src/integTest/groovy/org/gradle/playframework/tasks/AbstractRoutesCompileIntegrationTest.groovy @@ -4,6 +4,7 @@ import org.gradle.playframework.PlayMultiVersionIntegrationTest import org.gradle.testkit.runner.BuildResult import org.gradle.testkit.runner.TaskOutcome import org.gradle.util.VersionNumber +import org.junit.Assume import static org.gradle.playframework.fixtures.Repositories.playRepositories import static org.gradle.playframework.fixtures.file.FileFixtures.assertContentsHaveChangedSince @@ -242,6 +243,8 @@ GET / ${controllers()}${packageId}.Application.inde } def "can add additional imports"() { + // Play version 2.3 not supported + Assume.assumeTrue(playVersion > VersionNumber.parse("2.3.99")) given: withRoutesTemplate() and: diff --git a/src/integTest/groovy/org/gradle/playframework/tasks/Play24RoutesCompileIntegrationTest.groovy b/src/integTest/groovy/org/gradle/playframework/tasks/Play24RoutesCompileIntegrationTest.groovy index 30b88cda..9b9a0018 100644 --- a/src/integTest/groovy/org/gradle/playframework/tasks/Play24RoutesCompileIntegrationTest.groovy +++ b/src/integTest/groovy/org/gradle/playframework/tasks/Play24RoutesCompileIntegrationTest.groovy @@ -9,28 +9,54 @@ class Play24RoutesCompileIntegrationTest extends AbstractRoutesCompileIntegratio @Override def getJavaRoutesFileName(String packageName, String namespace) { - return "${namespace ? namespace + '/' :''}controllers/${packageName ? packageName + '/' :''}routes.java" + if (playVersion < VersionNumber.parse("2.4")) { + return "${namespace ? namespace + '/' : ''}controllers/${packageName ? packageName + "/" : ''}/routes.java" + } else { + return "${namespace ? namespace + '/' : ''}controllers/${packageName ? packageName + '/' : ''}routes.java" + } } @Override def getReverseRoutesFileName(String packageName, String namespace) { - return "${namespace ? namespace + '/' :''}controllers/${packageName ? packageName + '/' :''}ReverseRoutes.scala" + if (playVersion < VersionNumber.parse("2.4")) { + if (namespace) { + return "${namespace ? namespace + '/' : ''}routes_reverseRouting.scala" + } else { + return "${packageName ? packageName + '/' : ''}routes_reverseRouting.scala" + } + } else { + return "${namespace ? namespace + '/' : ''}controllers/${packageName ? packageName + '/' : ''}ReverseRoutes.scala" + } } @Override def getScalaRoutesFileName(String packageName, String namespace) { - return "${packageName?:'router'}/Routes.scala" + if (playVersion < VersionNumber.parse("2.4")) { + if (namespace) { + return "${namespace ? namespace + '/' : ''}routes_routing.scala" + } else { + return "${packageName ? packageName + '/' : ''}routes_routing.scala" + } + } else { + return "${packageName ?: 'router'}/Routes.scala" + } } @Override def getOtherRoutesFileNames() { - return [ - {packageName, namespace -> "${namespace ? namespace + '/' :''}controllers/${packageName ? packageName + '/' :''}javascript/JavaScriptReverseRoutes.scala" }, - {packageName, namespace -> "${packageName?:'router'}/RoutesPrefix.scala" } - ] + if (playVersion < VersionNumber.parse("2.4")) { + return [] + } else { + return [ + { packageName, namespace -> "${namespace ? namespace + '/' : ''}controllers/${packageName ? packageName + '/' : ''}javascript/JavaScriptReverseRoutes.scala" }, + { packageName, namespace -> "${packageName ?: 'router'}/RoutesPrefix.scala" } + ] + } } def "can specify route compiler type as injected"() { + // Play version 2.3 not supported + Assume.assumeTrue(playVersion > VersionNumber.parse("2.3.99")) given: withRoutesTemplate() withInjectedRoutesController() @@ -48,6 +74,8 @@ play { } def "recompiles when route compiler type is changed"() { + // Play version 2.3 not supported + Assume.assumeTrue(playVersion > VersionNumber.parse("2.3.99")) // Play 2.7+ only has a single route compiler type. Assume.assumeTrue(playVersion < VersionNumber.parse("2.7")) when: diff --git a/src/integTestFixtures/groovy/org/gradle/playframework/fixtures/app/PlayApp.groovy b/src/integTestFixtures/groovy/org/gradle/playframework/fixtures/app/PlayApp.groovy index 1456e810..96abd4c7 100644 --- a/src/integTestFixtures/groovy/org/gradle/playframework/fixtures/app/PlayApp.groovy +++ b/src/integTestFixtures/groovy/org/gradle/playframework/fixtures/app/PlayApp.groovy @@ -16,38 +16,59 @@ package org.gradle.playframework.fixtures.app +import freemarker.cache.ClassTemplateLoader +import freemarker.template.Configuration +import freemarker.template.Template +import freemarker.template.TemplateExceptionHandler +import org.gradle.playframework.extensions.PlayPlatform import org.gradle.util.RelativePathUtil import org.gradle.util.VersionNumber import static org.gradle.playframework.fixtures.Repositories.playRepositories abstract class PlayApp { - boolean oldVersion + final VersionNumber playVersion + final Configuration cfg + final Map model PlayApp() { + this(VersionNumber.parse(PlayPlatform.DEFAULT_PLAY_VERSION)) } PlayApp(VersionNumber version) { - this.oldVersion = version < VersionNumber.parse('2.6.0') + playVersion = version + cfg = new Configuration(Configuration.VERSION_2_3_29) + cfg.setTemplateLoader(new ClassTemplateLoader()) + cfg.setDefaultEncoding("UTF-8") + cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER) + cfg.setLogTemplateExceptions(false) + cfg.setWrapUncheckedExceptions(true) + cfg.setFallbackOnNullLoopVariable(false) + model = new HashMap<>() + model.put("playVersion", playVersion.major + "." + playVersion.minor) } String getName() { getClass().getSimpleName().toLowerCase() } + String getResourcePath(String relativePath) { + String basePath = this.getClass().getCanonicalName().split("\\.").dropRight(1).join("/") + return basePath + "/" + relativePath + } + List getAllFiles() { return appSources + testSources + viewSources + assetSources + confSources + otherSources } SourceFile getGradleBuild() { - def buildFileName = oldVersion ? "build.gradle.old" : "build.gradle" - def gradleBuild = sourceFile("", buildFileName) - def gradleBuildWithRepositories = gradleBuild.content.concat """ + String gradleBuildContent = renderTemplate(getResourcePath(getName() + "/build.gradle.ftl")) + def gradleBuildWithRepositories = gradleBuildContent.concat """ allprojects { ${playRepositories()} } """ - return new SourceFile(gradleBuild.path, "build.gradle", gradleBuildWithRepositories) + return new SourceFile("", "build.gradle", gradleBuildWithRepositories) } List getAssetSources() { @@ -78,9 +99,20 @@ abstract class PlayApp { protected SourceFile sourceFile(String path, String name, String baseDir = getName()) { - URL resource = getClass().getResource("$baseDir/$path/$name") - File file = new File(resource.toURI()) - return new SourceFile(path, name, file.text) + String resourcePath = getResourcePath("$baseDir/$path/$name") + URL resource = getClass().getClassLoader().getResource(resourcePath) + + if(resource == null) { + throw new IllegalStateException("Could not find resource on the classpath: $resourcePath") + } + + File source = new File(resource.toURI()) + if(isTemplate(source)) { + String content = renderTemplate(resourcePath) + return new SourceFile(path, source.name[0..<-4], content) + } else { + return new SourceFile(path, source.name, source.text) + } } void writeSources(File sourceDir) { @@ -90,10 +122,15 @@ abstract class PlayApp { } } + /** + * Generate a list of source files for this app, based on existing files + * in the project. + */ List sourceFiles(String baseDir, String rootDir = getName()) { List sourceFiles = new ArrayList() - URL resource = getClass().getResource("$rootDir/$baseDir") + String resourcePath = "$rootDir/$baseDir" + URL resource = getClass().getResource(resourcePath) if(resource != null){ File baseDirFile = new File(resource.toURI()) baseDirFile.eachFileRecurse { File source -> @@ -103,16 +140,13 @@ abstract class PlayApp { def subpath = RelativePathUtil.relativePath(baseDirFile, source.parentFile) - if(oldVersion) { - if(isOldVersionFile(source)) { - sourceFiles.add(new SourceFile("$baseDir/$subpath", source.name[0..<-4], source.text)) - } else if (!oldVersionFileExists(source)) { - sourceFiles.add(new SourceFile("$baseDir/$subpath", source.name, source.text)) - } + if(isTemplate(source)) { + String content = renderTemplate(getResourcePath(resourcePath + "/" + subpath + "/" + source.name)) + SourceFile file = new SourceFile("$baseDir/$subpath", source.name[0..<-4], content) + sourceFiles.add(file) } else { - if(!isOldVersionFile(source)) { - sourceFiles.add(new SourceFile("$baseDir/$subpath", source.name, source.text)) - } + SourceFile file = new SourceFile("$baseDir/$subpath", source.name, source.text) + sourceFiles.add(file) } } } @@ -120,11 +154,18 @@ abstract class PlayApp { return sourceFiles } - static boolean isOldVersionFile(File file) { - return file.name.endsWith('.old') + static boolean isTemplate(File file) { + return file.name.endsWith('.ftl') } - static boolean oldVersionFileExists(File file) { - return new File(file.parentFile, "${file.name}.old").exists() + String renderTemplate(String templatePath) { + try { + Template tmpl = cfg.getTemplate(templatePath) + StringWriter sw = new StringWriter() + tmpl.process(model, sw) + return sw.toString() + } catch(Exception e) { + throw e + } } } diff --git a/src/integTestFixtures/groovy/org/gradle/playframework/fixtures/app/SourceFile.groovy b/src/integTestFixtures/groovy/org/gradle/playframework/fixtures/app/SourceFile.groovy index c6bb39a6..1e57f49a 100644 --- a/src/integTestFixtures/groovy/org/gradle/playframework/fixtures/app/SourceFile.groovy +++ b/src/integTestFixtures/groovy/org/gradle/playframework/fixtures/app/SourceFile.groovy @@ -49,4 +49,9 @@ class SourceFile { } file.write(content) } + + @Override + String toString() { + return path + File.separator + name + } } diff --git a/src/integTestFixtures/groovy/org/gradle/playframework/fixtures/app/WithFailingTestsApp.groovy b/src/integTestFixtures/groovy/org/gradle/playframework/fixtures/app/WithFailingTestsApp.groovy index 6c9dc988..18486a1c 100644 --- a/src/integTestFixtures/groovy/org/gradle/playframework/fixtures/app/WithFailingTestsApp.groovy +++ b/src/integTestFixtures/groovy/org/gradle/playframework/fixtures/app/WithFailingTestsApp.groovy @@ -12,7 +12,7 @@ class WithFailingTestsApp extends PlayApp { @Override SourceFile getGradleBuild() { - def gradleBuild = sourceFile("", "build.gradle", "basicplayapp") + def gradleBuild = sourceFile("", "build.gradle.ftl", "basicplayapp") def gradleBuildWithRepositories = gradleBuild.content.concat """ allprojects { ${playRepositories()} diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/Application.scala.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/Application.scala.ftl similarity index 66% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/Application.scala.old rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/Application.scala.ftl index 12506bb1..3d757f70 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/Application.scala.old +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/Application.scala.ftl @@ -16,7 +16,26 @@ package controllers +<#if playVersion == "2.7" || playVersion == "2.6"> +import javax.inject._ +import play.api._ +import play.api.mvc._ +import models._ +@Singleton +class Application @Inject() extends InjectedController { + def index = Action { + Ok(views.html.index("Your new application is ready.")) + } + def root = Action { + Ok(views.html.awesome.index(java.util.Arrays.asList(new DataType("bar", 2)))) + } + def shutdown = Action { + Runtime.getRuntime().halt(0) + Ok("shutdown") + } +} +<#else> import play.api._ import play.api.mvc._ import models._ @@ -32,4 +51,5 @@ object Application extends Controller { System.exit(0) Ok("shutdown") } -} \ No newline at end of file +} + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/jva/PureJava.java b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/jva/PureJava.java.ftl similarity index 92% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/jva/PureJava.java rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/jva/PureJava.java.ftl index 5d3e89a2..fa02fed1 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/jva/PureJava.java +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/jva/PureJava.java.ftl @@ -21,7 +21,11 @@ public class PureJava extends Controller { +<#if playVersion == "2.7"> + public Result index() { +<#else> public static Result index() { + return ok(index.render("Your new application is ready.")); } diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/scla/MixedJava.java b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/scla/MixedJava.java.ftl similarity index 93% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/scla/MixedJava.java rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/scla/MixedJava.java.ftl index f4d9e7dc..38dae35c 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/scla/MixedJava.java +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/scla/MixedJava.java.ftl @@ -22,7 +22,11 @@ public class MixedJava extends Controller { +<#if playVersion == "2.7"> + public Result index() { +<#else> public static Result index() { + System.out.println(new models.ScalaClass("Java can also reference Scala files")); return ok(index.render("Your new mixed application is ready.")); } diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/special/strangename/Application.scala b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/special/strangename/Application.scala.ftl similarity index 78% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/special/strangename/Application.scala rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/special/strangename/Application.scala.ftl index 5bfda207..d153a2e2 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/special/strangename/Application.scala +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/special/strangename/Application.scala.ftl @@ -15,6 +15,8 @@ */ package special.strangename + +<#if playVersion == "2.7" || playVersion == "2.6"> import javax.inject._ import play.api._ import play.api.mvc._ @@ -25,3 +27,12 @@ class Application @Inject() extends InjectedController { Ok(views.html.index("Your new application is ready.")) } } +<#else> +import play.api._ +import play.api.mvc._ +object Application extends Controller { + def index = Action { + Ok(views.html.index("Your new application is ready.")) + } +} + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/special/strangename/Application.scala.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/special/strangename/Application.scala.old deleted file mode 100644 index 06077252..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/special/strangename/Application.scala.old +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2014 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package special.strangename -import play.api._ -import play.api.mvc._ -object Application extends Controller { - def index = Action { - Ok(views.html.index("Your new application is ready.")) - } -} \ No newline at end of file diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/build.gradle b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/build.gradle.ftl similarity index 88% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/build.gradle rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/build.gradle.ftl index fa5fc707..f740dfff 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/build.gradle +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/build.gradle.ftl @@ -14,7 +14,9 @@ sourceSets { } } +<#if 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" } + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/build.gradle.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/build.gradle.old deleted file mode 100644 index 094ee193..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/build.gradle.old +++ /dev/null @@ -1,15 +0,0 @@ -plugins { - id 'org.gradle.playframework' -} - -// repositories added in PlayApp class - -sourceSets { - main { - twirl { - defaultImports = org.gradle.playframework.sourcesets.TwirlImports.JAVA - srcDir "templates" - include "jva/**/*" - } - } -} diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/routes b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/routes deleted file mode 100644 index 078bf728..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/routes +++ /dev/null @@ -1,10 +0,0 @@ -# Routes -GET / @controllers.Application.index -GET /root @controllers.Application.root -GET /shutdown @controllers.Application.shutdown - --> /scala scala.Routes --> /java jva.Routes - -# Map static resources from the /public folder to the /assets URL path -GET /assets/*file @controllers.Assets.at(path="/public", file) diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/routes.ftl b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/routes.ftl new file mode 100644 index 00000000..4682b520 --- /dev/null +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/routes.ftl @@ -0,0 +1,25 @@ +<#if playVersion == "2.7" || playVersion == "2.6"> +# Routes +GET / @controllers.Application.index +GET /root @controllers.Application.root +GET /shutdown @controllers.Application.shutdown + +-> /scala scala.Routes +-> /java jva.Routes + +# Map static resources from the /public folder to the /assets URL path +GET /assets/*file @controllers.Assets.at(path="/public", file) + +<#else> +# Routes +GET / controllers.Application.index +GET /root controllers.Application.root +GET /shutdown controllers.Application.shutdown + +-> /scala scala.Routes +-> /java jva.Routes + +# Map static resources from the /public folder to the /assets URL path +GET /assets/*file controllers.Assets.at(path="/public", file) + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/routes.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/routes.old deleted file mode 100644 index d63c4f3f..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/routes.old +++ /dev/null @@ -1,10 +0,0 @@ -# Routes -GET / controllers.Application.index -GET /root controllers.Application.root -GET /shutdown controllers.Application.shutdown - --> /scala scala.Routes --> /java jva.Routes - -# Map static resources from the /public folder to the /assets URL path -GET /assets/*file controllers.Assets.at(path="/public", file) \ No newline at end of file diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/scala.routes b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/scala.routes deleted file mode 100644 index 36db0de8..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/scala.routes +++ /dev/null @@ -1,2 +0,0 @@ -GET /one controllers.scla.MixedJava.index -POST /two @special.strangename.Application.index diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/scala.routes.ftl b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/scala.routes.ftl new file mode 100644 index 00000000..b369cf96 --- /dev/null +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/scala.routes.ftl @@ -0,0 +1,9 @@ +<#if playVersion == "2.7" || playVersion == "2.6"> +GET /one controllers.scla.MixedJava.index +POST /two @special.strangename.Application.index + +<#else> +GET /one controllers.scla.MixedJava.index +POST /two special.strangename.Application.index + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/scala.routes.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/scala.routes.old deleted file mode 100644 index 9681abfb..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/conf/scala.routes.old +++ /dev/null @@ -1,2 +0,0 @@ -GET /one controllers.scla.MixedJava.index -POST /two special.strangename.Application.index diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/app/controllers/Application.scala b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/app/controllers/Application.scala deleted file mode 100644 index 401adbf6..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/app/controllers/Application.scala +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2014 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package controllers - -import javax.inject._ -import play.api._ -import play.api.mvc._ - -@Singleton -class Application @Inject() extends InjectedController { - - def index = Action { - Ok(views.html.index("Your new application is ready.")) - } - - def shutdown = Action { - Runtime.getRuntime().halt(0) - Ok("shutdown") - } -} diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/Application.scala b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/app/controllers/Application.scala.ftl similarity index 75% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/Application.scala rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/app/controllers/Application.scala.ftl index df0a3507..39db1edb 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/advancedplayapp/app/controllers/Application.scala +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/app/controllers/Application.scala.ftl @@ -16,21 +16,38 @@ package controllers +<#if playVersion == "2.7" || playVersion == "2.6"> import javax.inject._ import play.api._ import play.api.mvc._ -import models._ @Singleton class Application @Inject() extends InjectedController { + def index = Action { Ok(views.html.index("Your new application is ready.")) } - def root = Action { - Ok(views.html.awesome.index(java.util.Arrays.asList(new DataType("bar", 2)))) - } + def shutdown = Action { Runtime.getRuntime().halt(0) Ok("shutdown") } } + +<#else> +import play.api._ +import play.api.mvc._ + +object Application extends Controller { + + def index = Action { + Ok(views.html.index("Your new application is ready.")) + } + + def shutdown = Action { + System.exit(0) + Ok("shutdown") + } +} + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/app/controllers/Application.scala.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/app/controllers/Application.scala.old deleted file mode 100644 index 0d6bc74e..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/app/controllers/Application.scala.old +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2014 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package controllers - -import play.api._ -import play.api.mvc._ - -object Application extends Controller { - - def index = Action { - Ok(views.html.index("Your new application is ready.")) - } - - def shutdown = Action { - System.exit(0) - Ok("shutdown") - } -} \ No newline at end of file diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/build.gradle b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/build.gradle deleted file mode 100644 index 53a51e73..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -plugins { - id 'org.gradle.playframework' -} - -// repositories added in PlayApp class -dependencies { - implementation "com.typesafe.play:play-guice_2.12:2.6.15" - implementation "ch.qos.logback:logback-classic:1.2.3" -} diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/build.gradle b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/build.gradle.ftl similarity index 59% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/build.gradle rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/build.gradle.ftl index fb323b75..3664629d 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/build.gradle +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/build.gradle.ftl @@ -1,12 +1,19 @@ +<#if playVersion == "2.7" || playVersion == "2.6"> plugins { id 'org.gradle.playframework' } +// repositories added in PlayApp class dependencies { - implementation "com.google.guava:guava:17.0" implementation "com.typesafe.play:play-guice_2.12:2.6.15" implementation "ch.qos.logback:logback-classic:1.2.3" - testImplementation "commons-lang:commons-lang:2.6" +} + +<#else> +plugins { + id 'org.gradle.playframework' } // repositories added in PlayApp class + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/build.gradle.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/build.gradle.old deleted file mode 100644 index fcd36b68..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/build.gradle.old +++ /dev/null @@ -1,5 +0,0 @@ -plugins { - id 'org.gradle.playframework' -} - -// repositories added in PlayApp class diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/conf/routes b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/conf/routes deleted file mode 100644 index 1d2ec1b4..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/conf/routes +++ /dev/null @@ -1,9 +0,0 @@ -# Routes -# Home page -GET / @controllers.Application.index - -GET /shutdown @controllers.Application.shutdown - -# Map static resources from the /public folder to the /assets URL path -GET /assets/*file @controllers.Assets.at(path="/public", file) - diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/conf/routes.ftl b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/conf/routes.ftl new file mode 100644 index 00000000..6d724563 --- /dev/null +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/conf/routes.ftl @@ -0,0 +1,21 @@ +<#if playVersion == "2.7" || playVersion == "2.6"> +# Routes +# Home page +GET / @controllers.Application.index + +GET /shutdown @controllers.Application.shutdown + +# Map static resources from the /public folder to the /assets URL path +GET /assets/*file @controllers.Assets.at(path="/public", file) + +<#else> +# Routes +# Home page +GET / controllers.Application.index + +GET /shutdown controllers.Application.shutdown + +# Map static resources from the /public folder to the /assets URL path +GET /assets/*file controllers.Assets.at(path="/public", file) + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/conf/routes.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/conf/routes.old deleted file mode 100644 index 784cdbe5..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/basicplayapp/conf/routes.old +++ /dev/null @@ -1,9 +0,0 @@ -# Routes -# Home page -GET / controllers.Application.index - -GET /shutdown controllers.Application.shutdown - -# Map static resources from the /public folder to the /assets URL path -GET /assets/*file controllers.Assets.at(path="/public", file) - diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/app/controllers/Application.scala b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/app/controllers/Application.scala.ftl similarity index 73% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/app/controllers/Application.scala rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/app/controllers/Application.scala.ftl index a5ea459f..a13bd84c 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/app/controllers/Application.scala +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/app/controllers/Application.scala.ftl @@ -16,6 +16,7 @@ package controllers +<#if playVersion == "2.7" || playVersion == "2.6"> import javax.inject._ import com.google.common.base.Strings import play.api._ @@ -33,3 +34,20 @@ class Application @Inject() extends InjectedController { Ok("shutdown") } } +<#else> +import com.google.common.base.Strings +import play.api._ +import play.api.mvc._ + +object Application extends Controller { + + def index = Action { + Ok(views.html.index(Strings.nullToEmpty("Your new application is ready."))) + } + + def shutdown = Action { + System.exit(0) + Ok("shutdown") + } +} + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/app/controllers/Application.scala.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/app/controllers/Application.scala.old deleted file mode 100644 index b984a170..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/app/controllers/Application.scala.old +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2014 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package controllers - -import com.google.common.base.Strings -import play.api._ -import play.api.mvc._ - -object Application extends Controller { - - def index = Action { - Ok(views.html.index(Strings.nullToEmpty("Your new application is ready."))) - } - - def shutdown = Action { - System.exit(0) - Ok("shutdown") - } -} \ No newline at end of file diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/build.gradle.ftl b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/build.gradle.ftl new file mode 100644 index 00000000..39aafe74 --- /dev/null +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/build.gradle.ftl @@ -0,0 +1,27 @@ +<#if playVersion == "2.7" || playVersion == "2.6"> +plugins { + id 'org.gradle.playframework' +} + +dependencies { + implementation "com.google.guava:guava:17.0" + implementation "com.typesafe.play:play-guice_2.12:2.6.15" + implementation "ch.qos.logback:logback-classic:1.2.3" + testImplementation "commons-lang:commons-lang:2.6" +} + +// repositories added in PlayApp class + +<#else> +plugins { + id 'org.gradle.playframework' +} + +dependencies { + implementation "com.google.guava:guava:17.0" + testImplementation "commons-lang:commons-lang:2.6" +} + +// repositories added in PlayApp class + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/build.gradle.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/build.gradle.old deleted file mode 100644 index 52731a42..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/build.gradle.old +++ /dev/null @@ -1,10 +0,0 @@ -plugins { - id 'org.gradle.playframework' -} - -dependencies { - implementation "com.google.guava:guava:17.0" - testImplementation "commons-lang:commons-lang:2.6" -} - -// repositories added in PlayApp class diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/conf/routes b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/conf/routes deleted file mode 100644 index 1d2ec1b4..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/conf/routes +++ /dev/null @@ -1,9 +0,0 @@ -# Routes -# Home page -GET / @controllers.Application.index - -GET /shutdown @controllers.Application.shutdown - -# Map static resources from the /public folder to the /assets URL path -GET /assets/*file @controllers.Assets.at(path="/public", file) - diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/conf/routes.ftl b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/conf/routes.ftl new file mode 100644 index 00000000..6d724563 --- /dev/null +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/conf/routes.ftl @@ -0,0 +1,21 @@ +<#if playVersion == "2.7" || playVersion == "2.6"> +# Routes +# Home page +GET / @controllers.Application.index + +GET /shutdown @controllers.Application.shutdown + +# Map static resources from the /public folder to the /assets URL path +GET /assets/*file @controllers.Assets.at(path="/public", file) + +<#else> +# Routes +# Home page +GET / controllers.Application.index + +GET /shutdown controllers.Application.shutdown + +# Map static resources from the /public folder to the /assets URL path +GET /assets/*file controllers.Assets.at(path="/public", file) + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/conf/routes.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/conf/routes.old deleted file mode 100644 index 784cdbe5..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playappwithdependencies/conf/routes.old +++ /dev/null @@ -1,9 +0,0 @@ -# Routes -# Home page -GET / controllers.Application.index - -GET /shutdown controllers.Application.shutdown - -# Map static resources from the /public folder to the /assets URL path -GET /assets/*file controllers.Assets.at(path="/public", file) - diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/app/controllers/Application.scala b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/app/controllers/Application.scala.ftl similarity index 51% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/app/controllers/Application.scala rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/app/controllers/Application.scala.ftl index 427a93be..6d69a2f2 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/app/controllers/Application.scala +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/app/controllers/Application.scala.ftl @@ -1,5 +1,6 @@ package controllers +<#if playVersion == "2.7" || playVersion == "2.6"> import javax.inject._ import play.api._ import play.api.mvc._ @@ -18,3 +19,23 @@ class Application @Inject() extends InjectedController { Ok("shutdown") } } + +<#else> +import play.api._ +import play.api.mvc._ + +import org.test.Util + +object Application extends Controller { + + def index = Action { + Ok(Util.fullStop("Your new application is ready")) + } + + def shutdown = Action { + System.exit(0) + Ok("shutdown") + } +} + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/app/controllers/Application.scala.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/app/controllers/Application.scala.old deleted file mode 100644 index adf8f9c4..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/app/controllers/Application.scala.old +++ /dev/null @@ -1,18 +0,0 @@ -package controllers - -import play.api._ -import play.api.mvc._ - -import org.test.Util - -object Application extends Controller { - - def index = Action { - Ok(Util.fullStop("Your new application is ready")) - } - - def shutdown = Action { - System.exit(0) - Ok("shutdown") - } -} diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/build.gradle.ftl b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/build.gradle.ftl new file mode 100644 index 00000000..47d52b96 --- /dev/null +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/build.gradle.ftl @@ -0,0 +1,21 @@ +<#if playVersion == "2.7" || playVersion == "2.6"> +plugins { + id 'org.gradle.playframework' +} + +dependencies { + implementation "org.my:java-lib:1.0" + implementation "com.typesafe.play:play-guice_2.12:2.6.15" + implementation "ch.qos.logback:logback-classic:1.2.3" +} + +<#else> +plugins { + id 'org.gradle.playframework' +} + +dependencies { + implementation "org.my:java-lib:1.0" +} + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/build.gradle.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/build.gradle.old deleted file mode 100644 index d875fe41..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/build.gradle.old +++ /dev/null @@ -1,7 +0,0 @@ -plugins { - id 'org.gradle.playframework' -} - -dependencies { - implementation "org.my:java-lib:1.0" -} diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/conf/routes b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/conf/routes deleted file mode 100644 index cd77fa21..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/conf/routes +++ /dev/null @@ -1,4 +0,0 @@ -GET / @controllers.Application.index -GET /shutdown @controllers.Application.shutdown -GET /assets/*file @controllers.Assets.at(path="/public", file) - diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/conf/routes.ftl b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/conf/routes.ftl new file mode 100644 index 00000000..dbba7a04 --- /dev/null +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/conf/routes.ftl @@ -0,0 +1,11 @@ +<#if playVersion == "2.7" || playVersion == "2.6"> +GET / @controllers.Application.index +GET /shutdown @controllers.Application.shutdown +GET /assets/*file @controllers.Assets.at(path="/public", file) + +<#else> +GET / controllers.Application.index +GET /shutdown controllers.Application.shutdown +GET /assets/*file controllers.Assets.at(path="/public", file) + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/conf/routes.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/conf/routes.old deleted file mode 100644 index d5f789b5..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/conf/routes.old +++ /dev/null @@ -1,4 +0,0 @@ -GET / controllers.Application.index -GET /shutdown controllers.Application.shutdown -GET /assets/*file controllers.Assets.at(path="/public", file) - diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/build.gradle b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/build.gradle.ftl similarity index 61% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/build.gradle rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/build.gradle.ftl index f0eace12..a6708b50 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/build.gradle +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/build.gradle.ftl @@ -1,3 +1,4 @@ +<#if playVersion == "2.7" || playVersion == "2.6"> plugins { id 'org.gradle.playframework' } @@ -6,3 +7,10 @@ dependencies { implementation "com.typesafe.play:play-guice_2.12:2.6.15" implementation "ch.qos.logback:logback-classic:1.2.3" } + +<#else> +plugins { + id 'org.gradle.playframework' +} + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/build.gradle.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/build.gradle.old deleted file mode 100644 index c7c4dfce..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/build.gradle.old +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - id 'org.gradle.playframework' -} diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/app/controllers/Application.scala b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/app/controllers/Application.scala.ftl similarity index 51% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/app/controllers/Application.scala rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/app/controllers/Application.scala.ftl index 427a93be..6d69a2f2 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/app/controllers/Application.scala +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/app/controllers/Application.scala.ftl @@ -1,5 +1,6 @@ package controllers +<#if playVersion == "2.7" || playVersion == "2.6"> import javax.inject._ import play.api._ import play.api.mvc._ @@ -18,3 +19,23 @@ class Application @Inject() extends InjectedController { Ok("shutdown") } } + +<#else> +import play.api._ +import play.api.mvc._ + +import org.test.Util + +object Application extends Controller { + + def index = Action { + Ok(Util.fullStop("Your new application is ready")) + } + + def shutdown = Action { + System.exit(0) + Ok("shutdown") + } +} + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/app/controllers/Application.scala.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/app/controllers/Application.scala.old deleted file mode 100644 index f3124eb1..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/app/controllers/Application.scala.old +++ /dev/null @@ -1,18 +0,0 @@ -package controllers - -import play.api._ -import play.api.mvc._ - -import org.test.Util - -object Application extends Controller { - - def index = Action { - Ok(Util.fullStop("Your new application is ready")) - } - - def shutdown = Action { - System.exit(0) - Ok("shutdown") - } -} \ No newline at end of file diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/build.gradle b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/build.gradle.ftl similarity index 55% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/build.gradle rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/build.gradle.ftl index 54ba168d..83d9f8f1 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/build.gradle +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/build.gradle.ftl @@ -1,3 +1,4 @@ +<#if playVersion == "2.7" || playVersion == "2.6"> plugins { id 'org.gradle.playframework' } @@ -8,3 +9,15 @@ dependencies { implementation "com.typesafe.play:play-guice_2.12:2.6.15" implementation "ch.qos.logback:logback-classic:1.2.3" } + +<#else> +plugins { + id 'org.gradle.playframework' +} + +dependencies { + implementation project(":submodule") + implementation project(":javalibrary") +} + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/build.gradle.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/build.gradle.old deleted file mode 100644 index 4cc00ef9..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/build.gradle.old +++ /dev/null @@ -1,8 +0,0 @@ -plugins { - id 'org.gradle.playframework' -} - -dependencies { - implementation project(":submodule") - implementation project(":javalibrary") -} diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/application.conf b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/application.conf deleted file mode 100644 index 228d7786..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/application.conf +++ /dev/null @@ -1,2 +0,0 @@ -# https://www.playframework.com/documentation/2.6.x/ApplicationSecret -play.http.secret.key="somethingsecret" diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/application.conf.ftl b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/application.conf.ftl new file mode 100644 index 00000000..2a307aea --- /dev/null +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/application.conf.ftl @@ -0,0 +1,18 @@ +<#if playVersion == "2.7" || playVersion == "2.6"> +# https://www.playframework.com/documentation/2.6.x/ApplicationSecret +play.http.secret.key="somethingsecret" + +<#else> +application.secret="changeme" +application.langs="en" + +# Root logger: +logger.root=ERROR + +# Logger used by the framework: +logger.play=INFO + +# Logger provided to your application: +logger.application=DEBUG + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/application.conf.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/application.conf.old deleted file mode 100644 index f16d74c9..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/application.conf.old +++ /dev/null @@ -1,11 +0,0 @@ -application.secret="changeme" -application.langs="en" - -# Root logger: -logger.root=ERROR - -# Logger used by the framework: -logger.play=INFO - -# Logger provided to your application: -logger.application=DEBUG \ No newline at end of file diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/routes b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/routes deleted file mode 100644 index c9b89dc3..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/routes +++ /dev/null @@ -1,5 +0,0 @@ -GET / @controllers.Application.index -GET /shutdown @controllers.Application.shutdown -GET /submodule @controllers.submodule.Application.index -GET /assets/*file @controllers.Assets.at(path="/public", file) - diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/routes.ftl b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/routes.ftl new file mode 100644 index 00000000..8c47ca18 --- /dev/null +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/routes.ftl @@ -0,0 +1,13 @@ +<#if playVersion == "2.7" || playVersion == "2.6"> +GET / @controllers.Application.index +GET /shutdown @controllers.Application.shutdown +GET /submodule @controllers.submodule.Application.index +GET /assets/*file @controllers.Assets.at(path="/public", file) + +<#else> +GET / controllers.Application.index +GET /shutdown controllers.Application.shutdown +GET /submodule controllers.submodule.Application.index +GET /assets/*file controllers.Assets.at(path="/public", file) + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/routes.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/routes.old deleted file mode 100644 index 286027e9..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/primary/conf/routes.old +++ /dev/null @@ -1,5 +0,0 @@ -GET / controllers.Application.index -GET /shutdown controllers.Application.shutdown -GET /submodule controllers.submodule.Application.index -GET /assets/*file controllers.Assets.at(path="/public", file) - diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/app/controllers/submodule/Application.scala b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/app/controllers/submodule/Application.scala.ftl similarity index 51% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/app/controllers/submodule/Application.scala rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/app/controllers/submodule/Application.scala.ftl index 3328b4b4..1a367dc6 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/app/controllers/submodule/Application.scala +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/app/controllers/submodule/Application.scala.ftl @@ -1,5 +1,6 @@ package controllers.submodule +<#if playVersion == "2.7" || playVersion == "2.6"> import javax.inject._ import play.api._ import play.api.mvc._ @@ -12,3 +13,16 @@ class Application @Inject() extends InjectedController { } } +<#else> +import play.api._ +import play.api.mvc._ + +object Application extends Controller { + + def index = Action { + Ok("Submodule page") + } + +} + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/app/controllers/submodule/Application.scala.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/app/controllers/submodule/Application.scala.old deleted file mode 100644 index 5a0a6a4d..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/app/controllers/submodule/Application.scala.old +++ /dev/null @@ -1,12 +0,0 @@ -package controllers.submodule - -import play.api._ -import play.api.mvc._ - -object Application extends Controller { - - def index = Action { - Ok("Submodule page") - } - -} \ No newline at end of file diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/build.gradle b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/build.gradle deleted file mode 100644 index f0eace12..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ -plugins { - id 'org.gradle.playframework' -} - -dependencies { - implementation "com.typesafe.play:play-guice_2.12:2.6.15" - implementation "ch.qos.logback:logback-classic:1.2.3" -} diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/build.gradle b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/build.gradle.ftl similarity index 61% rename from src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/build.gradle rename to src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/build.gradle.ftl index 38455c09..a6708b50 100644 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playcompositebuild/build.gradle +++ b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/build.gradle.ftl @@ -1,9 +1,16 @@ +<#if playVersion == "2.7" || playVersion == "2.6"> plugins { id 'org.gradle.playframework' } dependencies { - implementation "org.my:java-lib:1.0" implementation "com.typesafe.play:play-guice_2.12:2.6.15" implementation "ch.qos.logback:logback-classic:1.2.3" } + +<#else> +plugins { + id 'org.gradle.playframework' +} + + diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/build.gradle.old b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/build.gradle.old deleted file mode 100644 index ed5cc055..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/playmultiproject/submodule/build.gradle.old +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - id 'org.gradle.playframework' -} \ No newline at end of file diff --git a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/shared/conf/application.conf b/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/shared/conf/application.conf deleted file mode 100644 index 965882f7..00000000 --- a/src/integTestFixtures/resources/org/gradle/playframework/fixtures/app/shared/conf/application.conf +++ /dev/null @@ -1 +0,0 @@ -play.http.secret.key="TY9[b`xw2MeXUt;M +play.http.secret.key="TY9[b`xw2MeXUt;M application.secret="TY9[b`xw2MeXUt;M