changeset 14781:d2038d372cd2

changed distribution dependency exclusion mechanism to be only for library dependencies
author Doug Simon <doug.simon@oracle.com>
date Thu, 27 Mar 2014 12:45:11 +0100
parents aaecb0ca0c7d
children 145949aeeccb
files mx/projects mxtool/mx.py
diffstat 2 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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.