You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2014/03/28 22:39:25 UTC

[2/2] git commit: Simplify dependency overrides

Simplify dependency overrides


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/e75f6447
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/e75f6447
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/e75f6447

Branch: refs/heads/master
Commit: e75f64479fe27f5d983663196260dcf067c1cf84
Parents: ba8b352
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Fri Mar 28 13:23:26 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Fri Mar 28 14:39:21 2014 -0700

----------------------------------------------------------------------
 build.gradle | 45 ++++++++++++++++++---------------------------
 1 file changed, 18 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/e75f6447/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 9305312..e19890c 100755
--- a/build.gradle
+++ b/build.gradle
@@ -165,7 +165,7 @@ subprojects {
     idea.module {
         scopes.PROVIDED.plus += configurations.provided
     }
-    
+
     eclipse.classpath.plusConfigurations += configurations.provided
 
     dependencies {
@@ -265,32 +265,23 @@ subprojects {
     // Prefer this version, because it has source artifacts available.
     def servletAPI = 'org.mortbay.jetty:servlet-api-2.5:6.1.11'
 
-    def versionOverrides = [
-        "antlr:antlr": "2.7.7",
-        "cglib:cglib-nodep": "2.2",
-        "commons-codec:commons-codec": "1.8",
-        "commons-io:commons-io": "2.4",
-        "commons-logging:commons-logging": "1.1.3",
-        "hsqldb:hsqldb": "2.2.8",
-        "org.antlr:antlr-runtime": "3.4",
-        "org.apache.tomcat:dbcp": "6.0.32",
-        // "org.apache.tomcat:servlet-api": "6.0.30",
-        "org.hamcrest:hamcrest-core": "1.3",
-        "org.json:json": "20140107",
-        "org.yaml:snakeyaml": "1.8",
-        "xml-apis:xml-apis": "1.4.01"
-    ]
-
     configurations.all {
 
-        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
+        resolutionStrategy.force "antlr:antlr:2.7.7",
+            "cglib:cglib-nodep:2.2",
+            "commons-codec:commons-codec:1.8",
+            "commons-io:commons-io:2.4",
+            "commons-logging:commons-logging:1.1.3",
+            "hsqldb:hsqldb:2.2.8",
+            "org.antlr:antlr-runtime:3.4",
+            "org.apache.tomcat:dbcp:6.0.32",
+            "org.hamcrest:hamcrest-core:1.3",
+            "org.json:json:20140107",
+            "org.yaml:snakeyaml:1.8",
+            "xml-apis:xml-apis:1.4.01"
 
-            def overrideVersion = versionOverrides[details.requested.group + ":" + details.requested.name]
+        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
 
-            if (overrideVersion != null && details.requested.version != overrideVersion) {
-                logger.info "Overriding dependency ${details.requested.group}:${details.requested.name} version ${details.requested.version} --> $overrideVersion"
-                details.useVersion overrideVersion
-            }
 
             if (details.requested.name.startsWith("servlet-api")) {
                 logger.info "Overriding dependency ${details.requested.group}:${details.requested.name}:${details.requested.version} --> $servletAPI"
@@ -375,7 +366,7 @@ task coffeeScriptDocs(type: Exec) {
     def sources = files()
 
     subprojects.each { sub ->
-      sources += sub.fileTree("src/main/coffeescript", { include "**/*.coffee" })
+        sources += sub.fileTree("src/main/coffeescript", { include "**/*.coffee" })
     }
 
     sources += project(":tapestry-core").tasks.preprocessCoffeeScript.outputs.files.asFileTree
@@ -385,7 +376,7 @@ task coffeeScriptDocs(type: Exec) {
     // Needs to be installed via "npm install -g docco"
     executable isWindows() ? "docco.cmd" : "docco"
     args "--output", outputDir
-    args sources.files.sort({ a,b -> a.name.compareTo b.name })
+    args sources.files.sort({ a, b -> a.name.compareTo b.name })
 
     inputs.files { sources }
     outputs.dir outputDir
@@ -562,8 +553,8 @@ boolean checkJDK() {
     def jdkVersion = System.properties['java.version']
     def match = jdkVersion =~ /_(\d+)/
 
-    if (! match.find())
-      throw new IllegalStateException("""Could not parse minor version number out of "#{jdkVersion}".""")
+    if (!match.find())
+        throw new IllegalStateException("""Could not parse minor version number out of "#{jdkVersion}".""")
 
     def minor = match[0][1].toInteger()