Author: pderop
Date: Tue Mar  1 19:50:31 2016
New Revision: 1733125

URL: http://svn.apache.org/viewvc?rev=1733125&view=rev
Log:
Incremented dmRelease to r8.
Improved the makeStaging task, which is now verifying if each released bundle 
contains proper mandatory license files under META-INF.

Modified:
    felix/trunk/dependencymanager/release/build.gradle

Modified: felix/trunk/dependencymanager/release/build.gradle
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/release/build.gradle?rev=1733125&r1=1733124&r2=1733125&view=diff
==============================================================================
--- felix/trunk/dependencymanager/release/build.gradle (original)
+++ felix/trunk/dependencymanager/release/build.gradle Tue Mar  1 19:50:31 2016
@@ -23,7 +23,7 @@
 import aQute.bnd.build.Workspace
 
 // Our release number, which has to be monotonically incremented each time we 
make a new release.
-ext.dmRelease = "r7"
+ext.dmRelease = "r8"
 
 // Our Apache svn Staging repo
 ext.svnStagingPath = "https://dist.apache.org/repos/dist/dev/felix";
@@ -111,7 +111,6 @@ task makeStaging << {
     // First, get list of latest released bundles available from our Release 
repository
     def released = []
     def releaseRepo = workspace.getRepository("Release")
-    logger.lifecycle("releaserepo=" + releaseRepo)
     def bundles=releaseRepo.list(null)
     bundles.each {
            def sortedVersions = releaseRepo.versions(it)
@@ -120,6 +119,27 @@ task makeStaging << {
            released << latestBundle
     }
 
+    // Before adding all latest released bundles in the binary distribution, 
check if they contains proper license files.
+       logger.lifecycle("    Checking META-INF mandatory files.")
+    released.each { jarfile -> 
+       if (jarfile.isFile()) {
+                       new ByteArrayOutputStream().withStream { os ->
+                               def result = exec {
+                               executable = 'jar'
+                               args = ['tf', jarfile, "META-INF"]
+                               standardOutput = os
+                               }
+                               def files = os.toString().split("\n")
+                               def mandatory = ["META-INF/LICENSE", 
"META-INF/NOTICE", "META-INF/DEPENDENCIES", "META-INF/changelog.txt"]
+                               mandatory.each { resource ->                    
+                                       if (! files.contains(resource)) {
+                                               throw new 
GradleException("Missing LICENSE file in " + jarfile)
+                                       }
+                               }
+                       }
+               }
+    }
+
     // Now, add all the latest released bundles in the binary distribution
     ant.zip(destfile: "staging/"+topdir+"-bin.zip") {
         // simply include all released bundle.


Reply via email to