[gradle] 03/08: use_local_artifacts: Use ResolutionStrategy to make all third-party dependencies versionless.

Kai-Chung Yan seamlik-guest at moszumanska.debian.org
Sun Sep 4 14:42:57 UTC 2016


This is an automated email from the git hooks/post-receive script.

seamlik-guest pushed a commit to branch master
in repository gradle.

commit 8f03442aa5f1a7cd0bbe579efa65fc5cd396f804
Author: Kai-Chung Yan (殷啟聰) <seamlikok at gmail.com>
Date:   Sun Sep 4 18:36:19 2016 +0800

    use_local_artifacts: Use ResolutionStrategy to make all third-party
    dependencies versionless.
    
    If using flatDir to search for artifacts, Gradle finds "foo-1.0.jar" instead
    of "foo.jar" if the version in the artifact filename ("1.0") matches the one
    in the dependency declaration ("com.foo:foo:1.0"). As a result, some
    classpaths in the finally built Gradle JARs are harcoded with the version.
    If later on some JARs depended by Gradle gets an update, the filenames
    will mismatch and the Gradle in Debian will fail to launch. The update of
    JSch has caused this error (https://bugs.debian.org/836391).
    
    Now that all dependencies are versionless, this bug should be fixed.
---
 debian/patches/use_local_artifacts.diff | 52 ++++++++++++---------------------
 1 file changed, 19 insertions(+), 33 deletions(-)

diff --git a/debian/patches/use_local_artifacts.diff b/debian/patches/use_local_artifacts.diff
index d5b9a9d..38f1775 100644
--- a/debian/patches/use_local_artifacts.diff
+++ b/debian/patches/use_local_artifacts.diff
@@ -9,12 +9,23 @@ Author: Kai-Chung Yan <seamlikok at gmail.com>
 Last-Update: 2015-07-08
 --- a/build.gradle
 +++ b/build.gradle
-@@ -180,7 +180,7 @@
+@@ -180,7 +180,18 @@
      group = 'org.gradle'
  
      repositories {
 -        maven { url 'https://repo.gradle.org/gradle/libs' }
-+        flatDir { dirs "/usr/share/java/" }
++        flatDir { dirs "/usr/share/java" }
++    }
++    configurations.all {
++        resolutionStrategy {
++          eachDependency { details ->
++              if (details.requested.group != 'org.gradle' &&
++                  details.requested.name != 'groovy-all' &&
++                  project.name != 'docs') {
++                  details.useVersion ''
++              }
++          }
++      }
      }
  }
  
@@ -66,15 +77,6 @@ Last-Update: 2015-07-08
  
  // Logging
  libraries.slf4j_api = dependencies.module('org.slf4j:slf4j-api:1.7.10')
-@@ -72,7 +72,7 @@
- 
- libraries.jcifs = "org.samba.jcifs:jcifs:1.3.17 at jar"
- libraries.commons_httpclient = dependencies.module('org.apache.httpcomponents:httpclient:4.4.1') {
--    dependency "org.apache.httpcomponents:httpcore:4.4.4 at jar"
-+    dependency "org.apache.httpcomponents:httpcore"
-     dependency libraries.jcl_to_slf4j
-     dependency "commons-codec:commons-codec:1.6 at jar"
-     dependency libraries.jcifs
 @@ -80,13 +80,13 @@
  
  libraries += [
@@ -83,7 +85,7 @@ Last-Update: 2015-07-08
 +        guava: 'com.google.guava:guava',
          jsr305: 'com.google.code.findbugs:jsr305:1.3.9 at jar',
 -        groovy: "org.codehaus.groovy:groovy-all:${versions.groovy}",
-+        groovy: "org.codehaus.groovy:groovy-all:[2.3, )",
++        groovy: "org.codehaus.groovy:groovy-all:[${versions.groovy}, )",
          jaxen: 'jaxen:jaxen:1.1 at jar',
          jcip: "net.jcip:jcip-annotations:1.0 at jar",
          jna: 'net.java.dev.jna:jna:3.2.7 at jar',
@@ -157,22 +159,6 @@ Last-Update: 2015-07-08
      dependency libraries.bouncycastle_provider
  }
  
-@@ -172,15 +172,3 @@
-         'com.fasterxml.jackson.core:jackson-annotations:2.3.2 at jar',
-         'com.fasterxml.jackson.core:jackson-databind:2.3.2 at jar'
- ] + libraries.commons_httpclient + libraries.joda
--
--allprojects {
--    configurations.all {
--        resolutionStrategy.eachDependency { details ->
--            if (details.requested.group == 'org.ow2.asm') {
--                details.useTarget(libraries.asm)
--            } else if (details.requested.group == 'org.codehaus.groovy') {
--                details.useTarget(libraries.groovy)
--            }
--        }
--    }
--}
 --- a/subprojects/javascript/javascript.gradle
 +++ b/subprojects/javascript/javascript.gradle
 @@ -17,7 +17,7 @@
@@ -191,7 +177,7 @@ Last-Update: 2015-07-08
  
  repositories {
 -    javaScript.googleApis()
-+    flatDir { dirs "/usr/share/javascript/jquery/" }
++    flatDir { dirs "/usr/share/javascript/jquery" }
  }
  
  dependencies {
@@ -213,8 +199,8 @@ Last-Update: 2015-07-08
 -    }
 -
 -    maven { url 'https://repo.gradle.org/gradle/gradle-build-internal' }
-+    maven { url "file:///usr/share/maven-repo/" }
-+    flatDir { dirs "/usr/share/javascript/jquery/" }
++    maven { url "file:///usr/share/maven-repo" }
++    flatDir { dirs "/usr/share/javascript/jquery" }
  }
  
  configurations {
@@ -224,8 +210,8 @@ Last-Update: 2015-07-08
  dependencies {
 -    userGuideTask 'xalan:xalan:2.7.1', libraries.xerces
 -    userGuideTask module('xhtmlrenderer:xhtmlrenderer:R8rc1') {
-+    userGuideTask 'xalan:xalan2:2.7.1', libraries.xerces
-+    userGuideTask module('xhtmlrenderer:core-renderer:R8rc1') {
++    userGuideTask 'xalan:xalan2:debian', libraries.xerces
++    userGuideTask module('xhtmlrenderer:core-renderer') {
          dependency 'itext:itext:2.0.8 at jar'
      }
      userGuideTask 'xslthl:xslthl:2.0.1 at jar'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/gradle.git



More information about the pkg-java-commits mailing list