polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [49/50] zest-java git commit: ZEST-25 Better dependencies resolution for bin dist go-offline helpers
Date Tue, 28 Jul 2015 12:55:46 GMT
ZEST-25 Better dependencies resolution for bin dist go-offline helpers

Now apply the Zest resolution strategy before generation so there’s no
surprise when using the helpers.

Note that as some of our modules depends on != versions of some
artifacts, the resolution strategy flatten this using the most up to
date versions.


Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/ce95ca7d
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/ce95ca7d
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/ce95ca7d

Branch: refs/heads/master
Commit: ce95ca7d4a2ff35031be66fc0923f29e9b15d500
Parents: 7b8fd18
Author: Paul Merlin <paul@nosphere.org>
Authored: Tue Jul 28 12:16:01 2015 +0200
Committer: Paul Merlin <paul@nosphere.org>
Committed: Tue Jul 28 12:16:01 2015 +0200

----------------------------------------------------------------------
 build.gradle     | 20 +++++++++++---------
 libraries.gradle | 12 ++++++++++++
 2 files changed, 23 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/ce95ca7d/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 2e0a4e4..d7666e6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -632,15 +632,17 @@ task generateBinDistGoOfflineHelpers {
     goOfflineGradle += '}\ndependencies {\n'
     goOfflinePom += '  </repositories>\n  <dependencies>\n'
 
-    def handledDeps = []
-    releaseApprovedProjects.each { p ->
-      p.configurations.runtime.incoming.resolutionResult.allComponents.each { comp ->
-        def depCoords = "${comp.moduleVersion.group}:${comp.moduleVersion.name}:${comp.moduleVersion.version}"
-        if( !comp.moduleVersion.group.startsWith( 'org.qi4j' ) && !handledDeps.contains(
depCoords ) ) {
-          goOfflineGradle += "  download( '$depCoords' ) { transitive = false }\n"
-          goOfflinePom += "    <dependency><groupId>${comp.moduleVersion.group}</groupId><artifactId>${comp.moduleVersion.name}</artifactId><version>${comp.moduleVersion.version}</version></dependency>\n"
-          handledDeps << depCoords
-        }
+    // Do the global dependency resolution here so there won't be any suprise when using
the helpers
+    // This also allow to apply the resolution strategy defined in libraries.gradle
+    // WARN some of our modules depends on != versions of some artifacts, this resolution
flatten this using the most up to date
+    def allRuntimeDeps = releaseApprovedProjects.collect{ it.configurations.runtime.allDependencies
}.flatten()
+    rootProject.configurations.create( 'goOfflineHelpers' )
+    rootProject.dependencies { allRuntimeDeps.each{ goOfflineHelpers it } }
+    rootProject.configurations.goOfflineHelpers.incoming.resolutionResult.allComponents.each
{ comp ->
+      def depCoords = "${comp.moduleVersion.group}:${comp.moduleVersion.name}:${comp.moduleVersion.version}"
+      if( !comp.moduleVersion.group.startsWith( 'org.qi4j' ) ) {
+        goOfflineGradle += "  download( '$depCoords' ) { transitive = false }\n"
+        goOfflinePom += "    <dependency><groupId>${comp.moduleVersion.group}</groupId><artifactId>${comp.moduleVersion.name}</artifactId><version>${comp.moduleVersion.version}</version></dependency>\n"
       }
     }
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/ce95ca7d/libraries.gradle
----------------------------------------------------------------------
diff --git a/libraries.gradle b/libraries.gradle
index c02a901..1507bc8 100644
--- a/libraries.gradle
+++ b/libraries.gradle
@@ -261,6 +261,18 @@ allprojects {
         if( dep.requested.group == 'org.slf4j' ) {
           dep.useTarget group: dep.requested.group, name: dep.requested.module, version:
slf4jVersion
         }
+        // Always resolve ASM to the same version
+        if( dep.requested.group == 'org.ow2.asm' ) {
+          dep.useTarget group: dep.requested.group, name: dep.requested.module, version:
asmVersion
+        }
+        // Always resolve OSGi to the same version
+        if( dep.requested.group == 'org.osgi' ) {
+          dep.useTarget group: dep.requested.group, name: dep.requested.module, version:
osgiVersion
+        }
+        // Always resolve Jackson to the same version
+        if( dep.requested.group.startsWith( 'com.fasterxml.jackson' ) ) {
+          dep.useTarget group: dep.requested.group, name: dep.requested.module, version:
jacksonVersion
+        }
         // woodstox:wstx-asl is broken (no pom), use org.codehaus.woodstox:wstx-asl instead
         if( dep.requested.group == 'woodstox' && dep.requested.module == 'wstx-asl'
) {
           dep.useTarget group: 'org.codehaus.woodstox', name: 'wstx-asl', version: dep.requested.version


Mime
View raw message