-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add property to configure dependency prefixing
Signed-off-by: Iacopo Pace <[email protected]>
- Loading branch information
Showing
16 changed files
with
283 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
=== Prefixing dependencies | ||
|
||
By default, your project's distribution task will prefix all your dependencies as follows: | ||
|
||
* Each jar will be prefixed with the library's group name - e.g. `com.typesafe.play-play_2.12-2.6.25.jar` | ||
* Each sub-module's jar, in a multi-module project, will be prefixed with the module's name | ||
The default behavior can be turned off using the `prefixDependencies` configuration. | ||
|
||
[source,groovy] | ||
.build.gradle | ||
---- | ||
include::{samplesCodeDir}/play-2.4/groovy/build.gradle[tag=prefix-dependencies-off] | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...pplication/dependencies/PlayDistributionAppWithDependenciesNoPrefixIntegrationTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.gradle.playframework.application.dependencies | ||
|
||
import org.gradle.playframework.application.PlayDistributionApplicationIntegrationTest | ||
import org.gradle.playframework.fixtures.app.PlayApp | ||
import org.gradle.playframework.fixtures.app.PlayAppWithDependenciesNoPrefix | ||
|
||
class PlayDistributionAppWithDependenciesNoPrefixIntegrationTest extends PlayDistributionApplicationIntegrationTest { | ||
|
||
@Override | ||
PlayApp getPlayApp() { | ||
new PlayAppWithDependenciesNoPrefix(playVersion) | ||
} | ||
|
||
@Override | ||
protected boolean shouldPrefixDependencies() { | ||
return false | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...tures/groovy/org/gradle/playframework/fixtures/app/PlayAppWithDependenciesNoPrefix.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.gradle.playframework.fixtures.app | ||
|
||
import org.gradle.util.VersionNumber | ||
|
||
class PlayAppWithDependenciesNoPrefix extends PlayApp { | ||
PlayAppWithDependenciesNoPrefix(VersionNumber version) { | ||
super(version) | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
...mework/fixtures/app/playappwithdependenciesnoprefix/app/controllers/Application.scala.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* 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 | ||
|
||
<#if playVersion == "2.8" || playVersion == "2.7" || playVersion == "2.6"> | ||
import javax.inject._ | ||
import com.google.common.base.Strings | ||
import play.api._ | ||
import play.api.mvc._ | ||
|
||
@Singleton | ||
class Application @Inject() extends InjectedController { | ||
|
||
def index = Action { | ||
Ok(views.html.index(Strings.nullToEmpty("Your new application is ready."))) | ||
} | ||
|
||
def shutdown = Action { | ||
Runtime.getRuntime().halt(0) | ||
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") | ||
} | ||
} | ||
</#if> |
7 changes: 7 additions & 0 deletions
7
...dle/playframework/fixtures/app/playappwithdependenciesnoprefix/app/views/index.scala.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@(message: String) | ||
|
||
@main("Welcome to Play") { | ||
|
||
<h1>@message</h1> | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
...adle/playframework/fixtures/app/playappwithdependenciesnoprefix/app/views/main.scala.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@(title: String)(content: Html) | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>@title</title> | ||
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")"> | ||
<link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")"> | ||
<script src="@routes.Assets.at("javascripts/hello.js")" type="text/javascript"></script> | ||
</head> | ||
<body> | ||
@content | ||
</body> | ||
</html> |
35 changes: 35 additions & 0 deletions
35
...es/org/gradle/playframework/fixtures/app/playappwithdependenciesnoprefix/build.gradle.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<#if playVersion == "2.8" || 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" | ||
} | ||
|
||
play { | ||
prefixDependencies = false | ||
} | ||
|
||
// 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 | ||
|
||
play { | ||
prefixDependencies = false | ||
} | ||
|
||
</#if> |
21 changes: 21 additions & 0 deletions
21
...ces/org/gradle/playframework/fixtures/app/playappwithdependenciesnoprefix/conf/routes.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<#if playVersion == "2.8" || 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) | ||
|
||
</#if> |
26 changes: 26 additions & 0 deletions
26
...dle/playframework/fixtures/app/playappwithdependenciesnoprefix/test/ApplicationSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import org.junit._ | ||
|
||
class ApplicationSpec { | ||
@Test | ||
def passingTest() { | ||
} | ||
@Test | ||
def passingTest2() { | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...dle/playframework/fixtures/app/playappwithdependenciesnoprefix/test/IntegrationSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import org.junit._ | ||
|
||
class IntegrationSpec { | ||
@Test | ||
def passingTest() { | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
.../org/gradle/playframework/fixtures/app/playappwithdependenciesnoprefix/test/notATest.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: Test | ||
number: 1234 | ||
items: | ||
- name: item1 | ||
description: first item | ||
- name: item2 | ||
description: second item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.