comparison mxtool/mx.py @ 8134:6e3ebc6fd5a4

graal.jar is installed in all JDKs every time it is updated (GRAAL-136)
author Doug Simon <doug.simon@oracle.com>
date Wed, 06 Mar 2013 20:25:57 +0100
parents 83ec1df0a30f
children 1446b04e4148
comparison
equal deleted inserted replaced
8133:396a059fdeed 8134:6e3ebc6fd5a4
158 self.name = name 158 self.name = name
159 self.path = path.replace('/', os.sep) 159 self.path = path.replace('/', os.sep)
160 if not isabs(self.path): 160 if not isabs(self.path):
161 self.path = join(suite.dir, self.path) 161 self.path = join(suite.dir, self.path)
162 self.deps = deps 162 self.deps = deps
163 self.update_listeners = set()
163 164
164 def __str__(self): 165 def __str__(self):
165 return self.name 166 return self.name
167
168 def add_update_listener(self, listener):
169 self.update_listeners.add(listener)
170
171 def notify_updated(self):
172 for l in self.update_listeners:
173 l(self)
166 174
167 """ 175 """
168 A dependency is a library or project specified in a suite. 176 A dependency is a library or project specified in a suite.
169 """ 177 """
170 class Dependency: 178 class Dependency:
561 os.environ[key.strip()] = expandvars_in_property(value.strip()) 569 os.environ[key.strip()] = expandvars_in_property(value.strip())
562 570
563 def _post_init(self, opts): 571 def _post_init(self, opts):
564 mxDir = join(self.dir, 'mx') 572 mxDir = join(self.dir, 'mx')
565 self._load_projects(mxDir) 573 self._load_projects(mxDir)
566 if hasattr(self, 'mx_post_parse_cmd_line'):
567 self.mx_post_parse_cmd_line(opts)
568 for p in self.projects: 574 for p in self.projects:
569 existing = _projects.get(p.name) 575 existing = _projects.get(p.name)
570 if existing is not None: 576 if existing is not None:
571 abort('cannot override project ' + p.name + ' in ' + p.dir + " with project of the same name in " + existing.dir) 577 abort('cannot override project ' + p.name + ' in ' + p.dir + " with project of the same name in " + existing.dir)
572 if not p.name in _opts.ignored_projects: 578 if not p.name in _opts.ignored_projects:
579 for d in self.dists: 585 for d in self.dists:
580 existing = _dists.get(l.name) 586 existing = _dists.get(l.name)
581 if existing is not None: 587 if existing is not None:
582 abort('cannot redefine distribution ' + d.name) 588 abort('cannot redefine distribution ' + d.name)
583 _dists[d.name] = d 589 _dists[d.name] = d
590 if hasattr(self, 'mx_post_parse_cmd_line'):
591 self.mx_post_parse_cmd_line(opts)
584 592
585 class XMLElement(xml.dom.minidom.Element): 593 class XMLElement(xml.dom.minidom.Element):
586 def writexml(self, writer, indent="", addindent="", newl=""): 594 def writexml(self, writer, indent="", addindent="", newl=""):
587 writer.write(indent+"<" + self.tagName) 595 writer.write(indent+"<" + self.tagName)
588 596
1650 for f in files: 1658 for f in files:
1651 relpath = root[len(outputDir) + 1:] 1659 relpath = root[len(outputDir) + 1:]
1652 arcname = join(relpath, f).replace(os.sep, '/') 1660 arcname = join(relpath, f).replace(os.sep, '/')
1653 zf.write(join(root, f), arcname) 1661 zf.write(join(root, f), arcname)
1654 zf.close() 1662 zf.close()
1663 d.notify_updated()
1664
1655 else: 1665 else:
1656 p = project(name) 1666 p = project(name)
1657 outputDir = p.output_dir() 1667 outputDir = p.output_dir()
1658 jar = join(p.dir, p.name + '.jar') 1668 jar = join(p.dir, p.name + '.jar')
1659 zf = zipfile.ZipFile(jar, 'w') 1669 zf = zipfile.ZipFile(jar, 'w')