# HG changeset patch # User Bernhard Urban # Date 1371817008 -7200 # Node ID 590b0c26877fcba260d769ec0c9b0e51a903094e # Parent f748b42a1389e4f4abfb57f96c9dda2508796ff6 mx: add --workdir argument diff -r f748b42a1389 -r 590b0c26877f mx/commands.py --- a/mx/commands.py Fri Jun 21 12:20:04 2013 +0200 +++ b/mx/commands.py Fri Jun 21 14:16:48 2013 +0200 @@ -54,6 +54,8 @@ _jacoco = 'off' +_workdir = None + _native_dbg = None _make_eclipse_launch = False @@ -645,6 +647,11 @@ if vm is None: vm = _vm + if cwd is None: + cwd = _workdir + elif _workdir is not None: + mx.abort("conflicting working directories: do not set --workdir for this command") + build = vmbuild if vmbuild is not None else _vmbuild if _vmSourcesAvailable else 'product' jdk = _jdk(build, vmToCheck=vm) mx.expand_project_in_args(args) @@ -1298,6 +1305,7 @@ } mx.add_argument('--jacoco', help='instruments com.oracle.* classes using JaCoCo', default='off', choices=['off', 'on', 'append']) + mx.add_argument('--workdir', help='runs the VM in the given directory', default=None) if (_vmSourcesAvailable): mx.add_argument('--vm', action='store', dest='vm', default='graal', choices=_vmChoices, help='the VM to build/run (default: ' + _vmChoices[0] + ')') @@ -1330,6 +1338,8 @@ _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False) global _jacoco _jacoco = opts.jacoco + global _workdir + _workdir = opts.workdir global _native_dbg _native_dbg = opts.native_dbg