comparison mx/commands.py @ 10570:2f80624df8a2

Add a --vmdir argument to mx
author Gilles Duboscq <duboscq@ssw.jku.at>
date Fri, 28 Jun 2013 16:36:27 +0200
parents 070b4a3c56f3
children 0cad5096735e
comparison
equal deleted inserted replaced
10569:6b9ebfcf5fc5 10570:2f80624df8a2
54 54
55 _jacoco = 'off' 55 _jacoco = 'off'
56 56
57 _workdir = None 57 _workdir = None
58 58
59 _vmdir = None
60
59 _native_dbg = None 61 _native_dbg = None
60 62
61 _make_eclipse_launch = False 63 _make_eclipse_launch = False
62 64
63 _minVersion = mx.JavaVersion('1.7.0_04') 65 _minVersion = mx.JavaVersion('1.7.0_04')
264 if platform.system() == 'Windows': 266 if platform.system() == 'Windows':
265 return join(jdk, 'jre', 'lib', _arch(), 'jvm.cfg') 267 return join(jdk, 'jre', 'lib', _arch(), 'jvm.cfg')
266 return join(_vmLibDirInJdk(jdk), 'jvm.cfg') 268 return join(_vmLibDirInJdk(jdk), 'jvm.cfg')
267 269
268 def _jdksDir(): 270 def _jdksDir():
271 if _vmdir:
272 return _vmdir
269 return join(_graal_home, 'jdk' + str(mx.java().version)) 273 return join(_graal_home, 'jdk' + str(mx.java().version))
270 274
271 def _jdk(build='product', vmToCheck=None, create=False): 275 def _jdk(build='product', vmToCheck=None, create=False):
272 """ 276 """
273 Get the JDK into which Graal is installed, creating it first if necessary. 277 Get the JDK into which Graal is installed, creating it first if necessary.
1308 'longtests' : [longtests, ''] 1312 'longtests' : [longtests, '']
1309 } 1313 }
1310 1314
1311 mx.add_argument('--jacoco', help='instruments com.oracle.* classes using JaCoCo', default='off', choices=['off', 'on', 'append']) 1315 mx.add_argument('--jacoco', help='instruments com.oracle.* classes using JaCoCo', default='off', choices=['off', 'on', 'append'])
1312 mx.add_argument('--workdir', help='runs the VM in the given directory', default=None) 1316 mx.add_argument('--workdir', help='runs the VM in the given directory', default=None)
1317 mx.add_argument('--vmdir', help='specify where the directory in which the vms should be', default=None)
1313 1318
1314 if (_vmSourcesAvailable): 1319 if (_vmSourcesAvailable):
1315 mx.add_argument('--vm', action='store', dest='vm', default='graal', choices=_vmChoices, help='the VM to build/run (default: ' + _vmChoices[0] + ')') 1320 mx.add_argument('--vm', action='store', dest='vm', default='graal', choices=_vmChoices, help='the VM to build/run (default: ' + _vmChoices[0] + ')')
1316 for c in _vmbuildChoices: 1321 for c in _vmbuildChoices:
1317 mx.add_argument('--' + c, action='store_const', dest='vmbuild', const=c, help='select the ' + c + ' build of the VM') 1322 mx.add_argument('--' + c, action='store_const', dest='vmbuild', const=c, help='select the ' + c + ' build of the VM')
1342 _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False) 1347 _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False)
1343 global _jacoco 1348 global _jacoco
1344 _jacoco = opts.jacoco 1349 _jacoco = opts.jacoco
1345 global _workdir 1350 global _workdir
1346 _workdir = opts.workdir 1351 _workdir = opts.workdir
1352 global _vmdir
1353 _vmdir = opts.vmdir
1347 global _native_dbg 1354 global _native_dbg
1348 _native_dbg = opts.native_dbg 1355 _native_dbg = opts.native_dbg
1349 1356
1350 mx.distribution('GRAAL').add_update_listener(_installGraalJarInJdks) 1357 mx.distribution('GRAAL').add_update_listener(_installGraalJarInJdks)