Update observatory_tool.py to remove package-root

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2346483007 .
This commit is contained in:
William Hesse 2016-09-19 10:11:31 +02:00
parent f5a616834e
commit 9f3b5d8680
3 changed files with 4 additions and 17 deletions

View file

@ -29,7 +29,6 @@
'python',
'../tools/observatory_tool.py',
'--sdk=True',
'--package-root', '<(PRODUCT_DIR)/packages',
'--stamp',
'<(gen_source_dir)/observatory_packages.stamp',
'--dart-executable',
@ -66,7 +65,6 @@
'python',
'../tools/observatory_tool.py',
'--sdk=True',
'--package-root', '<(PRODUCT_DIR)/packages',
'--dart-executable',
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart_bootstrap<(EXECUTABLE_SUFFIX)',
'--directory', 'observatory',
@ -87,7 +85,6 @@
'python',
'../tools/observatory_tool.py',
'--sdk=True',
'--package-root', '<(PRODUCT_DIR)/packages',
'--dart-executable',
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart_bootstrap<(EXECUTABLE_SUFFIX)',
'--directory', '<(PRODUCT_DIR)/observatory/',

View file

@ -255,7 +255,6 @@ def RunTestRunner(build_info, path):
build_root = utils.GetBuildRoot(
BUILD_OS, build_info.mode, build_info.arch)
package_root = os.path.abspath(os.path.join(build_root, 'packages'))
dart_name = 'dart.exe' if build_info.system == 'windows' else 'dart'
dart_bin = os.path.join(sdk_bin, dart_name)
@ -264,9 +263,7 @@ def RunTestRunner(build_info, path):
os.path.join('third_party', 'pkg', 'test', 'bin', 'test.dart'))
with utils.ChangedWorkingDirectory(path):
args = [dart_bin, '--package-root=' + package_root, test_bin,
'--package-root', package_root, '--reporter', 'expanded',
'--no-color']
args = [dart_bin, test_bin, '--reporter', 'expanded', '--no-color']
print("Running %s" % ' '.join(args))
RunProcess(args)

View file

@ -48,7 +48,6 @@ def CreateTimestampFile(options):
def BuildArguments():
result = argparse.ArgumentParser(usage=usage)
result.add_argument("--package-root", help="package root", default=None)
result.add_argument("--dart-executable", help="dart executable", default=None)
result.add_argument("--pub-executable", help="pub executable", default=None)
result.add_argument("--directory", help="observatory root", default=None)
@ -113,9 +112,8 @@ def ProcessOptions(options, args):
pass
options.pub_snapshot = None
# We need a dart executable and a package root.
return (options.package_root is not None and
options.dart_executable is not None)
# We need a dart executable.
return (options.dart_executable is not None)
def ChangeDirectory(directory):
os.chdir(directory);
@ -138,7 +136,6 @@ in the tools/observatory_tool.py script.
def PubCommand(dart_executable,
pub_executable,
pub_snapshot,
pkg_root,
command,
silent):
with open(os.devnull, 'wb') as silent_sink:
@ -148,7 +145,7 @@ def PubCommand(dart_executable,
executable = [utils.CheckedInSdkExecutable(), pub_snapshot]
else:
DisplayBootstrapWarning()
executable = [dart_executable, '--package-root=' + pkg_root, PUB_PATH]
executable = [dart_executable, PUB_PATH]
# Prevent the bootstrap Dart executable from running in regular
# development flow.
# REMOVE THE FOLLOWING LINE TO USE the dart_bootstrap binary.
@ -184,14 +181,12 @@ def ExecuteCommand(options, args):
return PubCommand(options.dart_executable,
options.pub_executable,
options.pub_snapshot,
options.package_root,
['get', '--offline'],
options.silent)
elif (cmd == 'build'):
return PubCommand(options.dart_executable,
options.pub_executable,
options.pub_snapshot,
options.package_root,
['build',
'-DOBS_VER=' + utils.GetVersion(),
'--output', args[0]],
@ -212,8 +207,6 @@ def main():
parser.print_help()
return 1
# Calculate absolute paths before changing directory.
if (options.package_root != None):
options.package_root = os.path.abspath(options.package_root)
if (options.dart_executable != None):
options.dart_executable = os.path.abspath(options.dart_executable)
if (options.pub_executable != None):