Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: tools/patch_sdk.py

Issue 2469683002: Emit patched_sdk in the root output directory. (Closed)
Patch Set: Martin's comment Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/vm.gypi ('k') | tools/testing/dart/compiler_configuration.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/patch_sdk.py
diff --git a/tools/patch_sdk.py b/tools/patch_sdk.py
index faa2bd03cf55e10961e59641b7677a9f1fdb6f13..f87addbe7a9bb0d52380aa5767721067c108caee 100755
--- a/tools/patch_sdk.py
+++ b/tools/patch_sdk.py
@@ -11,6 +11,18 @@ import utils
usage = """patch_sdk.py [options]"""
+def DisplayBootstrapWarning():
+ print """\
+
+
+WARNING: Your system cannot run the checked-in Dart SDK. Using the
+bootstrap Dart executable will make debug builds slow.
+Please see the Wiki for instructions on replacing the checked-in Dart SDK.
+
+https://github.com/dart-lang/sdk/wiki/The-checked-in-SDK-in-tools
+
+"""
+
def BuildArguments():
result = argparse.ArgumentParser(usage=usage)
result.add_argument("--dart-executable", help="dart executable", default=None)
@@ -20,12 +32,17 @@ def main():
# Parse the options.
parser = BuildArguments()
(options, args) = parser.parse_known_args()
- if options.dart_executable is not None:
+ if utils.CheckedInSdkCheckExecutable():
+ options.dart_executable = utils.CheckedInSdkExecutable()
+ elif options.dart_executable is not None:
+ DisplayBootstrapWarning()
options.dart_executable = os.path.abspath(options.dart_executable)
else:
- options.dart_executable = os.path.join(utils.CheckedInSdkPath(), 'bin', 'dart')
+ print >> sys.stderr, 'ERROR: cannot locate dart executable'
+ return -1
dart_file = os.path.join(os.path.dirname(__file__), 'patch_sdk.dart')
- subprocess.check_call([options.dart_executable, dart_file] + args);
+ subprocess.check_call([options.dart_executable, dart_file] + args)
+ return 0
if __name__ == '__main__':
- main()
+ sys.exit(main())
« no previous file with comments | « runtime/vm/vm.gypi ('k') | tools/testing/dart/compiler_configuration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698