comparison mxtool/mx.py @ 15577:406a94c03ffa

truffle distrubtion: move dsl processor in a separated jar, such that it can be a build-time only dependency
author Bernhard Urban <bernhard.urban@jku.at>
date Fri, 09 May 2014 16:11:01 +0200
parents 1f28c463e452
children c3869fe3d917
comparison
equal deleted inserted replaced
15576:0c0b479903bb 15577:406a94c03ffa
60 60
61 """ 61 """
62 A distribution is a jar or zip file containing the output from one or more Java projects. 62 A distribution is a jar or zip file containing the output from one or more Java projects.
63 """ 63 """
64 class Distribution: 64 class Distribution:
65 def __init__(self, suite, name, path, sourcesPath, deps, excludedLibs): 65 def __init__(self, suite, name, path, sourcesPath, deps, excludedDependencies):
66 self.suite = suite 66 self.suite = suite
67 self.name = name 67 self.name = name
68 self.path = path.replace('/', os.sep) 68 self.path = path.replace('/', os.sep)
69 self.path = _make_absolute(self.path, suite.dir) 69 self.path = _make_absolute(self.path, suite.dir)
70 self.sourcesPath = _make_absolute(sourcesPath.replace('/', os.sep), suite.dir) if sourcesPath else None 70 self.sourcesPath = _make_absolute(sourcesPath.replace('/', os.sep), suite.dir) if sourcesPath else None
71 self.deps = deps 71 self.deps = deps
72 self.update_listeners = set() 72 self.update_listeners = set()
73 self.excludedLibs = excludedLibs 73 self.excludedDependencies = excludedDependencies
74 74
75 def sorted_deps(self, includeLibs=False): 75 def sorted_deps(self, includeLibs=False):
76 try: 76 try:
77 excl = [library(d) for d in self.excludedLibs] 77 excl = [dependency(d) for d in self.excludedDependencies]
78 except SystemExit as e: 78 except SystemExit as e:
79 abort('invalid excluded library for {} distribution: {}'.format(self.name, e)) 79 abort('invalid excluded dependency for {} distribution: {}'.format(self.name, e))
80 return [d for d in sorted_deps(self.deps, includeLibs=includeLibs) if d not in excl] 80 return [d for d in sorted_deps(self.deps, includeLibs=includeLibs) if d not in excl]
81 81
82 def __str__(self): 82 def __str__(self):
83 return self.name 83 return self.name
84 84
746 746
747 for name, attrs in distsMap.iteritems(): 747 for name, attrs in distsMap.iteritems():
748 path = attrs.pop('path') 748 path = attrs.pop('path')
749 sourcesPath = attrs.pop('sourcesPath', None) 749 sourcesPath = attrs.pop('sourcesPath', None)
750 deps = pop_list(attrs, 'dependencies') 750 deps = pop_list(attrs, 'dependencies')
751 exclLibs = pop_list(attrs, 'excludeLibs') 751 exclDeps = pop_list(attrs, 'exclude')
752 d = Distribution(self, name, path, sourcesPath, deps, exclLibs) 752 d = Distribution(self, name, path, sourcesPath, deps, exclDeps)
753 d.__dict__.update(attrs) 753 d.__dict__.update(attrs)
754 self.dists.append(d) 754 self.dists.append(d)
755 755
756 if self.name is None: 756 if self.name is None:
757 abort('Missing "suite=<name>" in ' + projectsFile) 757 abort('Missing "suite=<name>" in ' + projectsFile)