# HG changeset patch # User Doug Simon # Date 1395920711 -3600 # Node ID d2038d372cd29ee021628aac10d26a09aa5cf4b0 # Parent aaecb0ca0c7d4cc7cbcfb6b6eddb170327517473 changed distribution dependency exclusion mechanism to be only for library dependencies diff -r aaecb0ca0c7d -r d2038d372cd2 mx/projects --- a/mx/projects Thu Mar 27 09:46:31 2014 +0100 +++ b/mx/projects Thu Mar 27 12:45:11 2014 +0100 @@ -54,7 +54,7 @@ com.oracle.graal.hotspot.sparc,\ com.oracle.graal.hotspot,\ com.oracle.graal.hotspot.hsail -distribution@GRAAL@excludeDependencies=FINDBUGS +distribution@GRAAL@excludeLibs=FINDBUGS # graal.api.runtime project@com.oracle.graal.api.runtime@subDir=graal diff -r aaecb0ca0c7d -r d2038d372cd2 mxtool/mx.py --- a/mxtool/mx.py Thu Mar 27 09:46:31 2014 +0100 +++ b/mxtool/mx.py Thu Mar 27 12:45:11 2014 +0100 @@ -61,7 +61,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, deps, exclDeps): + def __init__(self, suite, name, path, deps, excludedLibs): self.suite = suite self.name = name self.path = path.replace('/', os.sep) @@ -69,10 +69,13 @@ self.path = join(suite.dir, self.path) self.deps = deps self.update_listeners = set() - self.exclDeps = exclDeps + self.excludedLibs = excludedLibs def sorted_deps(self, includeLibs=False): - excl = [dependency(d) for d in self.exclDeps] + try: + excl = [library(d) for d in self.excludedLibs] + except SystemExit as e: + abort('invalid excluded library for {} distribution: {}'.format(self.name, e)) return [d for d in sorted_deps(self.deps, includeLibs=includeLibs) if d not in excl] def __str__(self): @@ -619,8 +622,8 @@ for name, attrs in distsMap.iteritems(): path = attrs.pop('path') deps = pop_list(attrs, 'dependencies') - exclDeps = pop_list(attrs, 'excludeDependencies') - d = Distribution(self, name, path, deps, exclDeps) + exclLibs = pop_list(attrs, 'excludeLibs') + d = Distribution(self, name, path, deps, exclLibs) d.__dict__.update(attrs) self.dists.append(d) @@ -914,6 +917,8 @@ """ l = _libs.get(name) if l is None and fatalIfMissing: + if _projects.get(name): + abort(name + ' is a project, not a library') abort('library named ' + name + ' not found') return l @@ -1532,6 +1537,7 @@ _kill_process_group(p.pid, sig=signal.SIGQUIT) time.sleep(0.1) + def abort(codeOrMessage): """ Aborts the program with a SystemExit exception.