changeset 15638:83c69954bbaa

mxtool: distribution dependency should be a list
author Bernhard Urban <bernhard.urban@jku.at>
date Wed, 14 May 2014 11:19:38 +0200
parents 40f13c935d8b
children 19ec9885ce6e
files mx/mx_graal.py mx/projects mxtool/mx.py
diffstat 3 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mx/mx_graal.py	Wed May 14 11:08:05 2014 +0200
+++ b/mx/mx_graal.py	Wed May 14 11:19:38 2014 +0200
@@ -1535,7 +1535,7 @@
                     if not mx.library(name, fatalIfMissing=False):
                         mx.log('Skipping ' + groupId + '.' + artifactId + '.jar as ' + name + ' cannot be resolved')
                         return
-        d = mx.Distribution(graalSuite, name=artifactId, path=path, sourcesPath=path, deps=deps, excludedDependencies=[], distDependency=None)
+        d = mx.Distribution(graalSuite, name=artifactId, path=path, sourcesPath=path, deps=deps, excludedDependencies=[], distDependencies=[])
         d.make_archive()
         cmd = ['mvn', 'install:install-file', '-DgroupId=' + groupId, '-DartifactId=' + artifactId,
                '-Dversion=1.0-SNAPSHOT', '-Dpackaging=jar', '-Dfile=' + d.path]
--- a/mx/projects	Wed May 14 11:08:05 2014 +0200
+++ b/mx/projects	Wed May 14 11:19:38 2014 +0200
@@ -87,7 +87,7 @@
 distribution@TRUFFLE-DSL-PROCESSOR@sourcesPath=truffle-dsl-processor-sources.jar
 distribution@TRUFFLE-DSL-PROCESSOR@dependencies=\
 com.oracle.truffle.dsl.processor
-distribution@TRUFFLE-DSL-PROCESSOR@distDependency=TRUFFLE
+distribution@TRUFFLE-DSL-PROCESSOR@distDependencies=TRUFFLE
 
 # graal.api.collections
 project@com.oracle.graal.api.collections@subDir=graal
--- a/mxtool/mx.py	Wed May 14 11:08:05 2014 +0200
+++ b/mxtool/mx.py	Wed May 14 11:19:38 2014 +0200
@@ -62,7 +62,7 @@
 A distribution is a jar or zip file containing the output from one or more Java projects.
 """
 class Distribution:
-    def __init__(self, suite, name, path, sourcesPath, deps, excludedDependencies, distDependency):
+    def __init__(self, suite, name, path, sourcesPath, deps, excludedDependencies, distDependencies):
         self.suite = suite
         self.name = name
         self.path = path.replace('/', os.sep)
@@ -71,7 +71,7 @@
         self.deps = deps
         self.update_listeners = set()
         self.excludedDependencies = excludedDependencies
-        self.distDependency = distDependency
+        self.distDependencies = distDependencies
 
     def sorted_deps(self, includeLibs=False):
         try:
@@ -126,8 +126,14 @@
                 else:
                     p = dep
 
-                    if self.distDependency and p in _dists[self.distDependency].sorted_deps():
-                        logv("Excluding {0} from {1} because it's provided by the dependency {2}".format(p.name, self.path, self.distDependency))
+                    isCoveredByDependecy = False
+                    for d in self.distDependencies:
+                        if p in _dists[d].sorted_deps():
+                            logv("Excluding {0} from {1} because it's provided by the dependency {2}".format(p.name, self.path, d))
+                            isCoveredByDependecy = True
+                            break
+
+                    if isCoveredByDependecy:
                         continue
 
                     # skip a  Java project if its Java compliance level is "higher" than the configured JDK
@@ -755,8 +761,8 @@
             sourcesPath = attrs.pop('sourcesPath', None)
             deps = pop_list(attrs, 'dependencies')
             exclDeps = pop_list(attrs, 'exclude')
-            distDep = attrs.pop('distDependency', None)
-            d = Distribution(self, name, path, sourcesPath, deps, exclDeps, distDep)
+            distDeps = pop_list(attrs, 'distDependencies')
+            d = Distribution(self, name, path, sourcesPath, deps, exclDeps, distDeps)
             d.__dict__.update(attrs)
             self.dists.append(d)