comparison mxtool/mx.py @ 21717:a3315bce5192

Change makefile generator to produce human readable code (JBS:GRAAL-52)
author Stefan Anzinger <stefan.anzinger@oracle.com>
date Wed, 03 Jun 2015 20:24:04 +0200
parents b939ee385ae4
children b5bbf03bc17a
comparison
equal deleted inserted replaced
21716:2f9e4d984d16 21717:a3315bce5192
122 self.excludedDependencies = excludedDependencies 122 self.excludedDependencies = excludedDependencies
123 self.distDependencies = distDependencies 123 self.distDependencies = distDependencies
124 self.javaCompliance = JavaCompliance(javaCompliance) if javaCompliance else None 124 self.javaCompliance = JavaCompliance(javaCompliance) if javaCompliance else None
125 self.isProcessorDistribution = isProcessorDistribution 125 self.isProcessorDistribution = isProcessorDistribution
126 126
127 def sorted_deps(self, includeLibs=False, transitive=False): 127 def sorted_deps(self, includeLibs=False, transitive=False, includeAnnotationProcessors=False):
128 deps = [] 128 deps = []
129 if transitive: 129 if transitive:
130 for depDist in [distribution(name) for name in self.distDependencies]: 130 for depDist in [distribution(name) for name in self.distDependencies]:
131 for d in depDist.sorted_deps(includeLibs=includeLibs, transitive=True): 131 for d in depDist.sorted_deps(includeLibs=includeLibs, transitive=True):
132 if d not in deps: 132 if d not in deps:
133 deps.append(d) 133 deps.append(d)
134 try: 134 try:
135 excl = [dependency(d) for d in self.excludedDependencies] 135 excl = [dependency(d) for d in self.excludedDependencies]
136 except SystemExit as e: 136 except SystemExit as e:
137 abort('invalid excluded dependency for {0} distribution: {1}'.format(self.name, e)) 137 abort('invalid excluded dependency for {0} distribution: {1}'.format(self.name, e))
138 return deps + [d for d in sorted_deps(self.deps, includeLibs=includeLibs) if d not in excl] 138 return deps + [d for d in sorted_deps(self.deps, includeLibs=includeLibs, includeAnnotationProcessors=includeAnnotationProcessors) if d not in excl]
139 139
140 def __str__(self): 140 def __str__(self):
141 return self.name 141 return self.name
142 142
143 def add_update_listener(self, listener): 143 def add_update_listener(self, listener):
144 self.update_listeners.add(listener) 144 self.update_listeners.add(listener)
145
146 def get_dist_deps(self, includeSelf=True, transitive=False):
147 deps = set()
148 if includeSelf:
149 deps.add(self)
150 deps.update([distribution(name) for name in self.distDependencies])
151 if transitive:
152 for depName in self.distDependencies:
153 deps.update(distribution(depName).get_dist_deps(False, False))
154 return list(deps)
145 155
146 """ 156 """
147 Gets the directory in which the IDE project configuration 157 Gets the directory in which the IDE project configuration
148 for this distribution is generated. If this is a distribution 158 for this distribution is generated. If this is a distribution
149 derived from a project defining an annotation processor, then 159 derived from a project defining an annotation processor, then