diff --git a/src/docTest/groovy/org/gradle/playframework/InDepthUserGuideSamplesIntegrationTest.groovy b/src/docTest/groovy/org/gradle/playframework/InDepthUserGuideSamplesIntegrationTest.groovy index badc5f36..86fe8bd1 100644 --- a/src/docTest/groovy/org/gradle/playframework/InDepthUserGuideSamplesIntegrationTest.groovy +++ b/src/docTest/groovy/org/gradle/playframework/InDepthUserGuideSamplesIntegrationTest.groovy @@ -130,8 +130,8 @@ class InDepthUserGuideSamplesIntegrationTest extends Specification { then: distributionArchives(sample.dir)*.containsDescendants( - "main/README.md", - "main/bin/runPlayBinaryAsUser.sh" + "custom-distribution/README.md", + "custom-distribution/bin/runPlayBinaryAsUser.sh" ) where: @@ -201,7 +201,7 @@ class InDepthUserGuideSamplesIntegrationTest extends Specification { } List distributionArchives(File sampleDir) { - [new ZipTestFixture(new File(sampleDir, "build/distributions/main.zip")), - new TarTestFixture(new File(sampleDir, "build/distributions/main.tar"))] + [new ZipTestFixture(new File(sampleDir, "build/distributions/custom-distribution.zip")), + new TarTestFixture(new File(sampleDir, "build/distributions/custom-distribution.tar"))] } } diff --git a/src/integTest/groovy/org/gradle/playframework/application/PlayDistributionApplicationIntegrationTest.groovy b/src/integTest/groovy/org/gradle/playframework/application/PlayDistributionApplicationIntegrationTest.groovy index 17719e41..6ce001ef 100644 --- a/src/integTest/groovy/org/gradle/playframework/application/PlayDistributionApplicationIntegrationTest.groovy +++ b/src/integTest/groovy/org/gradle/playframework/application/PlayDistributionApplicationIntegrationTest.groovy @@ -54,20 +54,20 @@ abstract class PlayDistributionApplicationIntegrationTest extends PlayMultiVersi } List archives() { - [ zip("build/distributions/main.zip"), tar("build/distributions/main.tar") ] + [ zip("build/distributions/${playApp.name}.zip"), tar("build/distributions/${playApp.name}.tar") ] } void verifyArchives() { archives()*.containsDescendants( - "main/lib/${playApp.name}.jar", - "main/lib/${playApp.name}-assets.jar", - "main/bin/main", - "main/bin/main.bat", - "main/conf/application.conf", - "main/README") + "${playApp.name}/lib/${playApp.name}.jar", + "${playApp.name}/lib/${playApp.name}-assets.jar", + "${playApp.name}/bin/main", + "${playApp.name}/bin/main.bat", + "${playApp.name}/conf/application.conf", + "${playApp.name}/README") } void verifyStagedFiles() { - File stageMainDir = file("build/stage/main") + File stageMainDir = file("build/stage/${playApp.name}") [ "lib/${playApp.name}.jar", "lib/${playApp.name}-assets.jar", @@ -92,7 +92,7 @@ abstract class PlayDistributionApplicationIntegrationTest extends PlayMultiVersi // Verify that the Class-Path attribute contains the correct runtime classpath def classpath = mainJar.manifest.mainAttributes.getValue("Class-Path") def classpathAsFilenames = Arrays.asList(classpath.split(" ")) - def dependencies = file("build/stage/main/lib/").listFiles().collect { it.name } - [ mainJar.file.name ] + def dependencies = file("build/stage/${playApp.name}/lib/").listFiles().collect { it.name } - [ mainJar.file.name ] assert dependencies.size() == classpathAsFilenames.size() assert classpathAsFilenames.containsAll(dependencies) } diff --git a/src/integTest/groovy/org/gradle/playframework/application/advanced/PlayDistributionAdvancedAppIntegrationTest.groovy b/src/integTest/groovy/org/gradle/playframework/application/advanced/PlayDistributionAdvancedAppIntegrationTest.groovy index b8913c99..d97a559f 100644 --- a/src/integTest/groovy/org/gradle/playframework/application/advanced/PlayDistributionAdvancedAppIntegrationTest.groovy +++ b/src/integTest/groovy/org/gradle/playframework/application/advanced/PlayDistributionAdvancedAppIntegrationTest.groovy @@ -20,15 +20,15 @@ class PlayDistributionAdvancedAppIntegrationTest extends PlayDistributionApplica super.verifyArchives() archives()*.containsDescendants( - "main/conf/jva.routes", - "main/conf/scala.routes") + "${playApp.name}/conf/jva.routes", + "${playApp.name}/conf/scala.routes") } @Override void verifyStagedFiles() { super.verifyStagedFiles() - File stageMainDir = file("build/stage/main") + File stageMainDir = file("build/stage/${playApp.name}") [ "conf/jva.routes", "conf/scala.routes" diff --git a/src/integTest/groovy/org/gradle/playframework/tasks/DistributionZipIntegrationTest.groovy b/src/integTest/groovy/org/gradle/playframework/tasks/DistributionZipIntegrationTest.groovy index 277420d9..28b9a66a 100644 --- a/src/integTest/groovy/org/gradle/playframework/tasks/DistributionZipIntegrationTest.groovy +++ b/src/integTest/groovy/org/gradle/playframework/tasks/DistributionZipIntegrationTest.groovy @@ -32,6 +32,6 @@ class DistributionZipIntegrationTest extends AbstractIntegrationTest { build "dist" then: - zip("build/distributions/main.zip").containsDescendants("main/additionalFile.txt") + zip("build/distributions/dist-play-app.zip").containsDescendants("dist-play-app/additionalFile.txt") } } diff --git a/src/main/java/org/gradle/playframework/plugins/PlayDistributionPlugin.java b/src/main/java/org/gradle/playframework/plugins/PlayDistributionPlugin.java index f4685580..4ed3ef8b 100644 --- a/src/main/java/org/gradle/playframework/plugins/PlayDistributionPlugin.java +++ b/src/main/java/org/gradle/playframework/plugins/PlayDistributionPlugin.java @@ -140,7 +140,7 @@ private void createDistributionZipTasks(Project project, Distribution distributi final String capitalizedDistName = capitalizeDistributionName(distribution.getName()); final String stageTaskName = "stage" + capitalizedDistName + "Dist"; final File stageDir = new File(project.getBuildDir(), "stage"); - final String baseName = (distribution.getBaseName() != null && "".equals(distribution.getBaseName())) ? distribution.getBaseName() : distribution.getName(); + final String baseName = (distribution.getBaseName() != null && !distribution.getBaseName().isEmpty()) ? distribution.getBaseName() : distribution.getName(); TaskProvider stageSyncTask = project.getTasks().register(stageTaskName, Sync.class, sync -> { sync.setDescription("Copies the '" + distribution.getName() + "' distribution to a staging directory.");