Mercurial > hg > truffle
diff mxtool/mx.py @ 15601:4aeb0b80324f
mx distributions: allow to specify dependencies between distributions
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Mon, 12 May 2014 22:37:14 +0200 |
parents | c3869fe3d917 |
children | 83c69954bbaa |
line wrap: on
line diff
--- 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)