# HG changeset patch # User Doug Simon # Date 1381237603 -7200 # Node ID 4cdf7623fbe68a15d887bb627fa54c9511797936 # Parent 12e9d529fd1daf8697589c78ac84f1cd3e3cd70f ensure graal.options in the JDK is deployed/updated/deleted each time the VM is run diff -r 12e9d529fd1d -r 4cdf7623fbe6 mx/commands.py --- a/mx/commands.py Tue Oct 08 13:30:10 2013 +0200 +++ b/mx/commands.py Tue Oct 08 15:06:43 2013 +0200 @@ -365,9 +365,18 @@ return jdk +def _updateInstalledGraalOptionsFile(jdk): + graalOptions = join(_graal_home, 'graal.options') + jreLibDir = join(jdk, 'jre', 'lib') + if exists(graalOptions): + shutil.copy(graalOptions, join(jreLibDir, 'graal.options')) + else: + toDelete = join(jreLibDir, 'graal.options') + if exists(toDelete): + os.unlink(toDelete) + def _installGraalJarInJdks(graalDist): graalJar = graalDist.path - graalOptions = join(_graal_home, 'graal.options') jdks = _jdksDir() if exists(jdks): for e in os.listdir(jdks): @@ -379,9 +388,6 @@ os.close(fd) shutil.move(tmp, join(jreLibDir, 'graal.jar')) - if exists(graalOptions): - shutil.copy(graalOptions, join(jreLibDir, 'graal.options')) - # run a command in the windows SDK Debug Shell def _runInDebugShell(cmd, workingDir, logFile=None, findInOutput=None, respondTo=None): if respondTo is None: @@ -692,6 +698,7 @@ build = vmbuild if vmbuild is not None else _vmbuild if _vmSourcesAvailable else 'product' jdk = _jdk(build, vmToCheck=vm, installGraalJar=False) + _updateInstalledGraalOptionsFile(jdk) mx.expand_project_in_args(args) if _make_eclipse_launch: mx.make_eclipse_launch(args, 'graal-' + build, name=None, deps=mx.project('com.oracle.graal.hotspot').all_deps([], True))