Mercurial > hg > truffle
comparison mx/mx_graal.py @ 21040:12e94cba3696
Graal Loader: load all jars matching lib/graal/graal*.jar
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Mon, 20 Apr 2015 17:56:38 +0200 |
parents | 9507c925abe9 |
children | 5ea65fe64368 |
comparison
equal
deleted
inserted
replaced
21039:13a255e29236 | 21040:12e94cba3696 |
---|---|
612 jdks = _jdksDir() | 612 jdks = _jdksDir() |
613 | 613 |
614 if exists(jdks): | 614 if exists(jdks): |
615 for e in os.listdir(jdks): | 615 for e in os.listdir(jdks): |
616 jreLibDir = join(jdks, e, 'jre', 'lib') | 616 jreLibDir = join(jdks, e, 'jre', 'lib') |
617 if deployableDist.isExtension: | |
618 jreLibDir = join(jreLibDir, 'ext') | |
619 if exists(jreLibDir): | 617 if exists(jreLibDir): |
620 _copyToJdk(dist.path, jreLibDir) | 618 if deployableDist.isExtension: |
619 targetDir = join(jreLibDir, 'ext') | |
620 elif deployableDist.isGraalClassLoader: | |
621 targetDir = join(jreLibDir, 'graal') | |
622 else: | |
623 targetDir = jreLibDir | |
624 if not exists(targetDir): | |
625 os.makedirs(targetDir) | |
626 _copyToJdk(dist.path, targetDir) | |
621 if dist.sourcesPath: | 627 if dist.sourcesPath: |
622 _copyToJdk(dist.sourcesPath, join(jdks, e)) | 628 _copyToJdk(dist.sourcesPath, join(jdks, e)) |
629 # deploy service files | |
623 if deployableDist.isGraalClassLoader: | 630 if deployableDist.isGraalClassLoader: |
624 assert not deployableDist.isExtension | |
625 # deploy services files | 631 # deploy services files |
626 jreGraalServicesDir = join(jreLibDir, 'graal', 'services') | 632 jreGraalServicesDir = join(jreLibDir, 'graal', 'services') |
627 if not exists(jreGraalServicesDir): | 633 if not exists(jreGraalServicesDir): |
628 os.makedirs(jreGraalServicesDir) | 634 os.makedirs(jreGraalServicesDir) |
629 with zipfile.ZipFile(dist.path) as zf: | 635 with zipfile.ZipFile(dist.path) as zf: |
799 for jdkDist in _jdkDeployedDists: | 805 for jdkDist in _jdkDeployedDists: |
800 dist = mx.distribution(jdkDist.name) | 806 dist = mx.distribution(jdkDist.name) |
801 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/' + basename(dist.path) | 807 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/' + basename(dist.path) |
802 if jdkDist.isExtension: | 808 if jdkDist.isExtension: |
803 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_EXT_DIR)/' + basename(dist.path) | 809 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_EXT_DIR)/' + basename(dist.path) |
810 elif jdkDist.isGraalClassLoader: | |
811 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_GRAAL_DIR)/' + basename(dist.path) | |
804 else: | 812 else: |
805 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/' + basename(dist.path) | 813 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/' + basename(dist.path) |
806 if defLine not in defs: | 814 if defLine not in defs: |
807 mx.abort('Missing following line in ' + defsPath + '\n' + defLine) | 815 mx.abort('Missing following line in ' + defsPath + '\n' + defLine) |
808 shutil.copy(dist.path, opts2.export_dir) | 816 shutil.copy(dist.path, opts2.export_dir) |
2572 _vm_prefix = opts.vm_prefix | 2580 _vm_prefix = opts.vm_prefix |
2573 | 2581 |
2574 for jdkDist in _jdkDeployedDists: | 2582 for jdkDist in _jdkDeployedDists: |
2575 def _close(jdkDeployable): | 2583 def _close(jdkDeployable): |
2576 def _install(dist): | 2584 def _install(dist): |
2577 mx.log("install " + dist.name) | |
2578 assert dist.name == jdkDeployable.name, dist.name + "!=" + jdkDeployable.name | 2585 assert dist.name == jdkDeployable.name, dist.name + "!=" + jdkDeployable.name |
2579 _installDistInJdks(jdkDeployable) | 2586 _installDistInJdks(jdkDeployable) |
2580 return _install | 2587 return _install |
2581 mx.distribution(jdkDist.name).add_update_listener(_close(jdkDist)) | 2588 mx.distribution(jdkDist.name).add_update_listener(_close(jdkDist)) |