Mercurial > hg > truffle
comparison mxtool/mx.py @ 13785:55785507f4df
Merge.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 28 Jan 2014 18:32:30 +0100 |
parents | fc5e2c808a23 |
children | 96d5cb754b68 |
comparison
equal
deleted
inserted
replaced
13784:219a84093dda | 13785:55785507f4df |
---|---|
1562 def __cmp__ (self, other): | 1562 def __cmp__ (self, other): |
1563 if isinstance(other, types.StringType): | 1563 if isinstance(other, types.StringType): |
1564 other = JavaCompliance(other) | 1564 other = JavaCompliance(other) |
1565 | 1565 |
1566 return cmp(self.value, other.value) | 1566 return cmp(self.value, other.value) |
1567 | |
1568 def __hash__(self): | |
1569 return self.value.__hash__() | |
1567 | 1570 |
1568 """ | 1571 """ |
1569 A version specification as defined in JSR-56 | 1572 A version specification as defined in JSR-56 |
1570 """ | 1573 """ |
1571 class VersionSpec: | 1574 class VersionSpec: |
2740 def _source_locator_memento(deps): | 2743 def _source_locator_memento(deps): |
2741 slm = XMLDoc() | 2744 slm = XMLDoc() |
2742 slm.open('sourceLookupDirector') | 2745 slm.open('sourceLookupDirector') |
2743 slm.open('sourceContainers', {'duplicates' : 'false'}) | 2746 slm.open('sourceContainers', {'duplicates' : 'false'}) |
2744 | 2747 |
2745 # Every Java program depends on the JRE | 2748 javaCompliance = None |
2746 memento = XMLDoc().element('classpathContainer', {'path' : 'org.eclipse.jdt.launching.JRE_CONTAINER'}).xml(standalone='no') | |
2747 slm.element('classpathContainer', {'memento' : memento, 'typeId':'org.eclipse.jdt.launching.sourceContainer.classpathContainer'}) | |
2748 | |
2749 for dep in deps: | 2749 for dep in deps: |
2750 if dep.isLibrary(): | 2750 if dep.isLibrary(): |
2751 if hasattr(dep, 'eclipse.container'): | 2751 if hasattr(dep, 'eclipse.container'): |
2752 memento = XMLDoc().element('classpathContainer', {'path' : getattr(dep, 'eclipse.container')}).xml(standalone='no') | 2752 memento = XMLDoc().element('classpathContainer', {'path' : getattr(dep, 'eclipse.container')}).xml(standalone='no') |
2753 slm.element('classpathContainer', {'memento' : memento, 'typeId':'org.eclipse.jdt.launching.sourceContainer.classpathContainer'}) | 2753 slm.element('classpathContainer', {'memento' : memento, 'typeId':'org.eclipse.jdt.launching.sourceContainer.classpathContainer'}) |
2755 memento = XMLDoc().element('archive', {'detectRoot' : 'true', 'path' : dep.get_source_path(resolve=True)}).xml(standalone='no') | 2755 memento = XMLDoc().element('archive', {'detectRoot' : 'true', 'path' : dep.get_source_path(resolve=True)}).xml(standalone='no') |
2756 slm.element('container', {'memento' : memento, 'typeId':'org.eclipse.debug.core.containerType.externalArchive'}) | 2756 slm.element('container', {'memento' : memento, 'typeId':'org.eclipse.debug.core.containerType.externalArchive'}) |
2757 else: | 2757 else: |
2758 memento = XMLDoc().element('javaProject', {'name' : dep.name}).xml(standalone='no') | 2758 memento = XMLDoc().element('javaProject', {'name' : dep.name}).xml(standalone='no') |
2759 slm.element('container', {'memento' : memento, 'typeId':'org.eclipse.jdt.launching.sourceContainer.javaProject'}) | 2759 slm.element('container', {'memento' : memento, 'typeId':'org.eclipse.jdt.launching.sourceContainer.javaProject'}) |
2760 if javaCompliance is None or dep.javaCompliance < javaCompliance: | |
2761 javaCompliance = dep.javaCompliance | |
2762 | |
2763 if javaCompliance: | |
2764 memento = XMLDoc().element('classpathContainer', {'path' : 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-' + str(javaCompliance)}).xml(standalone='no') | |
2765 slm.element('classpathContainer', {'memento' : memento, 'typeId':'org.eclipse.jdt.launching.sourceContainer.classpathContainer'}) | |
2766 else: | |
2767 memento = XMLDoc().element('classpathContainer', {'path' : 'org.eclipse.jdt.launching.JRE_CONTAINER'}).xml(standalone='no') | |
2768 slm.element('classpathContainer', {'memento' : memento, 'typeId':'org.eclipse.jdt.launching.sourceContainer.classpathContainer'}) | |
2760 | 2769 |
2761 slm.close('sourceContainers') | 2770 slm.close('sourceContainers') |
2762 slm.close('sourceLookupDirector') | 2771 slm.close('sourceLookupDirector') |
2763 return slm | 2772 return slm |
2764 | 2773 |
2931 if not exists(genDir): | 2940 if not exists(genDir): |
2932 os.mkdir(genDir) | 2941 os.mkdir(genDir) |
2933 out.element('classpathentry', {'kind' : 'src', 'path' : 'src_gen'}) | 2942 out.element('classpathentry', {'kind' : 'src', 'path' : 'src_gen'}) |
2934 files.append(genDir) | 2943 files.append(genDir) |
2935 | 2944 |
2936 # Every Java program depends on the JRE | 2945 # Every Java program depends on a JRE |
2937 out.element('classpathentry', {'kind' : 'con', 'path' : 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-' + str(p.javaCompliance)}) | 2946 out.element('classpathentry', {'kind' : 'con', 'path' : 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-' + str(p.javaCompliance)}) |
2938 | 2947 |
2939 if exists(join(p.dir, 'plugin.xml')): # eclipse plugin project | 2948 if exists(join(p.dir, 'plugin.xml')): # eclipse plugin project |
2940 out.element('classpathentry', {'kind' : 'con', 'path' : 'org.eclipse.pde.core.requiredPlugins'}) | 2949 out.element('classpathentry', {'kind' : 'con', 'path' : 'org.eclipse.pde.core.requiredPlugins'}) |
2941 | 2950 |