Mercurial > hg > truffle
comparison mxtool/mx.py @ 15785:7a6f6a7ef886
Add JRE library support to mx projectgraph.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Tue, 20 May 2014 11:56:19 +0200 |
parents | 8b9e7f235d85 |
children | d54cca247d0b |
comparison
equal
deleted
inserted
replaced
15784:fb530b9fa474 | 15785:7a6f6a7ef886 |
---|---|
1230 with zipfile.ZipFile(entry, 'r') as zf: | 1230 with zipfile.ZipFile(entry, 'r') as zf: |
1231 for zi in zf.infolist(): | 1231 for zi in zf.infolist(): |
1232 entryPath = zi.filename | 1232 entryPath = zi.filename |
1233 yield zf, entryPath | 1233 yield zf, entryPath |
1234 | 1234 |
1235 def sorted_deps(projectNames=None, includeLibs=False, includeAnnotationProcessors=False): | 1235 def sorted_deps(projectNames=None, includeLibs=False, includeJreLibs=False, includeAnnotationProcessors=False): |
1236 """ | 1236 """ |
1237 Gets projects and libraries sorted such that dependencies | 1237 Gets projects and libraries sorted such that dependencies |
1238 are before the projects that depend on them. Unless 'includeLibs' is | 1238 are before the projects that depend on them. Unless 'includeLibs' is |
1239 true, libraries are omitted from the result. | 1239 true, libraries are omitted from the result. |
1240 """ | 1240 """ |
1241 projects = projects_from_names(projectNames) | 1241 projects = projects_from_names(projectNames) |
1242 | 1242 |
1243 return sorted_project_deps(projects, includeLibs=includeLibs, includeAnnotationProcessors=includeAnnotationProcessors) | 1243 return sorted_project_deps(projects, includeLibs=includeLibs, includeJreLibs=includeJreLibs, includeAnnotationProcessors=includeAnnotationProcessors) |
1244 | 1244 |
1245 def sorted_project_deps(projects, includeLibs=False, includeAnnotationProcessors=False): | 1245 def sorted_project_deps(projects, includeLibs=False, includeJreLibs=False, includeAnnotationProcessors=False): |
1246 deps = [] | 1246 deps = [] |
1247 for p in projects: | 1247 for p in projects: |
1248 p.all_deps(deps, includeLibs=includeLibs, includeAnnotationProcessors=includeAnnotationProcessors) | 1248 p.all_deps(deps, includeLibs=includeLibs, includeJreLibs=includeJreLibs, includeAnnotationProcessors=includeAnnotationProcessors) |
1249 return deps | 1249 return deps |
1250 | 1250 |
1251 def _handle_missing_java_home(): | 1251 def _handle_missing_java_home(): |
1252 if not sys.stdout.isatty(): | 1252 if not sys.stdout.isatty(): |
1253 abort('Could not find bootstrap JDK. Use --java-home option or ensure JAVA_HOME environment variable is set.') | 1253 abort('Could not find bootstrap JDK. Use --java-home option or ensure JAVA_HOME environment variable is set.') |
2939 igv.open('properties') | 2939 igv.open('properties') |
2940 igv.element('p', {'name' : 'name'}, 'GraalProjectDependencies') | 2940 igv.element('p', {'name' : 'name'}, 'GraalProjectDependencies') |
2941 igv.close('properties') | 2941 igv.close('properties') |
2942 igv.open('graph', {'name' : 'dependencies'}) | 2942 igv.open('graph', {'name' : 'dependencies'}) |
2943 igv.open('nodes') | 2943 igv.open('nodes') |
2944 for p in sorted_deps(includeLibs=True): | 2944 for p in sorted_deps(includeLibs=True, includeJreLibs=True): |
2945 ident = len(ids) | 2945 ident = len(ids) |
2946 ids[p.name] = str(ident) | 2946 ids[p.name] = str(ident) |
2947 igv.open('node', {'id' : str(ident)}) | 2947 igv.open('node', {'id' : str(ident)}) |
2948 igv.open('properties') | 2948 igv.open('properties') |
2949 igv.element('p', {'name' : 'name'}, p.name) | 2949 igv.element('p', {'name' : 'name'}, p.name) |