# HG changeset patch # User Bernhard Urban # Date 1399927034 -7200 # Node ID 4aeb0b80324f86bb12976dbb3964e15929c5c718 # Parent 2a5f05654bc632454e72e3896b9c9acc775fab5b mx distributions: allow to specify dependencies between distributions diff -r 2a5f05654bc6 -r 4aeb0b80324f mx/projects --- a/mx/projects Mon May 12 20:29:41 2014 +0200 +++ b/mx/projects Mon May 12 22:37:14 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@exclude=com.oracle.truffle.api.dsl,com.oracle.truffle.api +distribution@TRUFFLE-DSL-PROCESSOR@distDependency=TRUFFLE # graal.api.collections project@com.oracle.graal.api.collections@subDir=graal diff -r 2a5f05654bc6 -r 4aeb0b80324f mxtool/mx.py --- a/mxtool/mx.py Mon May 12 20:29:41 2014 +0200 +++ b/mxtool/mx.py Mon May 12 22:37:14 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): + def __init__(self, suite, name, path, sourcesPath, deps, excludedDependencies, distDependency): self.suite = suite self.name = name self.path = path.replace('/', os.sep) @@ -71,6 +71,7 @@ self.deps = deps self.update_listeners = set() self.excludedDependencies = excludedDependencies + self.distDependency = distDependency def sorted_deps(self, includeLibs=False): try: @@ -124,6 +125,11 @@ srcArc.zf.writestr(arcname, lp.read(arcname)) 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)) + continue + # skip a Java project if its Java compliance level is "higher" than the configured JDK jdk = java(p.javaCompliance) if not jdk: @@ -749,7 +755,8 @@ sourcesPath = attrs.pop('sourcesPath', None) deps = pop_list(attrs, 'dependencies') exclDeps = pop_list(attrs, 'exclude') - d = Distribution(self, name, path, sourcesPath, deps, exclDeps) + distDep = attrs.pop('distDependency', None) + d = Distribution(self, name, path, sourcesPath, deps, exclDeps, distDep) d.__dict__.update(attrs) self.dists.append(d)