polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject zest-qi4j git commit: ZEST-25 bin-dist, go-offline helpers now d/l deps src and javadocs
Date Thu, 16 Jul 2015 15:08:59 GMT
Repository: zest-qi4j
Updated Branches:
  refs/heads/develop 44f6157f0 -> b0f74761f


ZEST-25 bin-dist, go-offline helpers now d/l deps src and javadocs


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

Branch: refs/heads/develop
Commit: b0f74761f9cbd36e2ef2ce78961a61b321c428e2
Parents: 44f6157
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Thu Jul 16 12:15:04 2015 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Thu Jul 16 12:15:04 2015 +0200

----------------------------------------------------------------------
 build.gradle | 53 ++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 40 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b0f74761/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 11c9d14..f1e1431 100644
--- a/build.gradle
+++ b/build.gradle
@@ -602,29 +602,56 @@ task generateBinDistGoOfflineHelpers {
         if( !dep.group.startsWith( 'org.qi4j' ) && !handledDeps.contains( depCoords
) ) {
 
           goOfflineGradle += "  download '$depCoords'\n"
-          goOfflineGradle += "  // download '$depCoords:sources'\n"
-          goOfflineGradle += "  // download '$depCoords:javadoc'\n"
 
-          def gav = "<groupId>${dep.group}</groupId><artifactId>${dep.name}</artifactId><version>${dep.version}</version>"
-          goOfflinePom += """    <dependency>$gav</dependency>
-          <!-- <dependency>$gav<classifier>sources</classifier></dependency>
-->
-          <!-- <dependency>$gav<classifier>javadoc</classifier></dependency>
-->\n"""
+          goOfflinePom += "    <dependency><groupId>${dep.group}</groupId><artifactId>${dep.name}</artifactId><version>${dep.version}</version></dependency>\n"
 
           handledDeps << depCoords
         }
       }
     }
 
-    goOfflineGradle += '}\ntask download( type: Copy ) {\n  from configurations.download\n
 into file( \'dependencies/\' )\n}\n'
+    goOfflineGradle += """}
+task download( type: Copy ) {
+  def sources = configurations.download.resolvedConfiguration.resolvedArtifacts.collect {
artifact ->
+    project.dependencies.create( [ group: artifact.moduleVersion.id.group, name: artifact.moduleVersion.id.name,
version: artifact.moduleVersion.id.version, classifier: 'sources' ] )
+  }
+  def javadocs = configurations.download.resolvedConfiguration.resolvedArtifacts.collect
{ artifact ->
+    project.dependencies.create( [ group: artifact.moduleVersion.id.group, name: artifact.moduleVersion.id.name,
version: artifact.moduleVersion.id.version, classifier: 'javadoc' ] )
+  }
+  from configurations.download
+  from configurations.detachedConfiguration( sources as Dependency[] ).resolvedConfiguration.lenientConfiguration.getFiles(
Specs.SATISFIES_ALL )
+  from configurations.detachedConfiguration( javadocs as Dependency[] ).resolvedConfiguration.lenientConfiguration.getFiles(
Specs.SATISFIES_ALL )
+  into file( 'dependencies/' )
+}
+"""
+
     goOfflinePom += """  </dependencies>\n  <build><plugins><plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-dependency-plugin</artifactId>
     <version>2.10</version>
-    <executions><execution>
-      <id>go-offline</id><phase>validate</phase>
-      <goals><goal>copy-dependencies</goal></goals>
-      <configuration><outputDirectory>\${project.basedir}/dependencies</outputDirectory></configuration>
-    </execution></executions>
+    <executions>
+      <execution>
+        <id>go-offline-jars</id><phase>validate</phase>
+        <goals><goal>copy-dependencies</goal></goals>
+        <configuration><outputDirectory>\${project.basedir}/dependencies</outputDirectory></configuration>
+      </execution>
+      <execution>
+        <id>go-offline-sources</id><phase>validate</phase>
+        <goals><goal>copy-dependencies</goal></goals>
+        <configuration>
+          <classifier>sources</classifier><failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
+          <outputDirectory>\${project.basedir}/dependencies</outputDirectory>
+        </configuration>
+      </execution>
+      <execution>
+        <id>go-offline-javadocs</id><phase>validate</phase>
+        <goals><goal>copy-dependencies</goal></goals>
+        <configuration>
+          <classifier>javadoc</classifier><failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
+          <outputDirectory>\${project.basedir}/dependencies</outputDirectory>
+        </configuration>
+      </execution>
+    </executions>
   </plugin></plugins></build>
 </project>
 """
@@ -790,7 +817,7 @@ task checkBinDist_goOfflineMaven( type: Exec, dependsOn: unpackBinDist
) {
   def dependenciesDir = new File( unpackedBinDistDir, 'dependencies' )
   doFirst { dependenciesDir.deleteDir() }
   workingDir unpackedBinDistDir
-  commandLine 'mvn', '-e', '-q', '-f', 'go-offline.pom', 'validate'
+  commandLine 'mvn', '-e', '-f', 'go-offline.pom', 'validate'
   doLast {
     releaseApprovedProjects*.configurations.runtime.allDependencies.findAll({it.name}).each
{ dep ->
       def jarArtifactId = dep.name instanceof String ? dep.name : dep.name.last()


Mime
View raw message