changeset 22064:0f969fd3a7d3

create missing distribution jars irrespective of whether any constituent projects were rebuilt
author Doug Simon <doug.simon@oracle.com>
date Tue, 23 Jun 2015 13:15:55 +0200
parents 97ad67783fbb
children 4dd0835c0fb0
files mxtool/mx.py
diffstat 1 files changed, 21 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/mxtool/mx.py	Tue Jun 23 13:15:48 2015 +0200
+++ b/mxtool/mx.py	Tue Jun 23 13:15:55 2015 +0200
@@ -3145,25 +3145,27 @@
                 log('Compiling {0} failed'.format(t.proj.name))
             abort('{0} Java compilation tasks failed'.format(len(failed)))
 
-    if len(tasks) != 0:
-        if args.java and not args.only:
-            files = []
-            rebuiltProjects = frozenset([t.proj for t in tasks.itervalues()])
-            for dist in sorted_dists():
-                if dist not in updatedAnnotationProcessorDists:
-                    projectsInDist = dist.sorted_deps()
-                    n = len(rebuiltProjects.intersection(projectsInDist))
-                    if n != 0:
-                        log('Updating jars for {0} [{1} constituent projects (re)built]'.format(dist.name, n))
-                        dist.make_archive()
-                    else:
-                        logv('[all constituent projects for {0} are up to date - skipping jar updating]'.format(dist.name))
-                if args.check_distributions and not dist.isProcessorDistribution:
-                    with zipfile.ZipFile(dist.path, 'r') as zf:
-                        files.extend([member for member in zf.namelist() if not member.startswith('META-INF')])
-            dups = set([x for x in files if files.count(x) > 1])
-            if len(dups) > 0:
-                abort('Distributions overlap! duplicates: ' + str(dups))
+    if args.java and not args.only:
+        files = []
+        rebuiltProjects = frozenset([t.proj for t in tasks.itervalues()])
+        for dist in sorted_dists():
+            if not exists(dist.path):
+                log('Creating jar for {0}'.format(dist.name))
+                dist.make_archive()
+            elif dist not in updatedAnnotationProcessorDists:
+                projectsInDist = dist.sorted_deps()
+                n = len(rebuiltProjects.intersection(projectsInDist))
+                if n != 0:
+                    log('Updating jar for {0} [{1} constituent projects (re)built]'.format(dist.name, n))
+                    dist.make_archive()
+                else:
+                    logv('[all constituent projects for {0} are up to date - skipping jar updating]'.format(dist.name))
+            if args.check_distributions and not dist.isProcessorDistribution:
+                with zipfile.ZipFile(dist.path, 'r') as zf:
+                    files.extend([member for member in zf.namelist() if not member.startswith('META-INF')])
+        dups = set([x for x in files if files.count(x) > 1])
+        if len(dups) > 0:
+            abort('Distributions overlap! duplicates: ' + str(dups))
 
     if suppliedParser:
         return args