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

Side by Side Diff: utils/generate_patch_sdk.gni

Issue 2944103003: Introduce dart_host_toolchain arg, remove '--checked' option from patch_sdk.py (Closed)
Patch Set: Introduce dart_host_toolchain arg Created 3 years, 6 months 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 unified diff | Download patch
« tools/patch_sdk.py ('K') | « tools/patch_sdk.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 import("../build/prebuilt_dart_sdk.gni") 5 import("../build/prebuilt_dart_sdk.gni")
6 6
7 _dart_root = get_path_info("..", "abspath") 7 _dart_root = get_path_info("..", "abspath")
8 8
9 declare_args() {
10 dart_host_toolchain = host_toolchain
rmacnak 2017/06/21 21:15:34 Can we use this for the standalone's invocation of
aam 2017/06/21 21:39:18 Do you mean invocation in flutter/build/flutter_ap
aam 2017/06/22 04:34:07 Done.
11 }
12
9 # Template to generate a patched_sdk folder. This invokes the tools/patch_sdk.py 13 # Template to generate a patched_sdk folder. This invokes the tools/patch_sdk.py
10 # script and sets up the right dependencies. 14 # script and sets up the right dependencies.
11 # 15 #
12 # This template expects four arguments: 16 # This template expects four arguments:
13 # - mode: vm or dart2js (whether to build an sdk for the vm or for dart2js) 17 # - mode: vm or dart2js (whether to build an sdk for the vm or for dart2js)
14 # - input_patches_dir: directory containing the input library files. 18 # - input_patches_dir: directory containing the input library files.
15 # - patched_sdk_dir: the output location 19 # - patched_sdk_dir: the output location
16 # - deps: extra dependencies that must be built ahead of time. 20 # - deps: extra dependencies that must be built ahead of time.
17 template("generate_patched_sdk") { 21 template("generate_patched_sdk") {
18 assert(defined(invoker.input_patches_dir), 22 assert(defined(invoker.input_patches_dir),
19 "Need input_patches_dir in $target_name") 23 "Need input_patches_dir in $target_name")
20 assert(defined(invoker.patched_sdk_dir), 24 assert(defined(invoker.patched_sdk_dir),
21 "Need patched_sdk_dir in $target_name") 25 "Need patched_sdk_dir in $target_name")
22 assert(defined(invoker.mode), "Need mode in $target_name") 26 assert(defined(invoker.mode), "Need mode in $target_name")
23 action(target_name) { 27 action(target_name) {
24 if (defined(invoker.deps)) { 28 if (defined(invoker.deps)) {
25 deps = invoker.deps 29 deps = invoker.deps
26 } else { 30 } else {
27 deps = [] 31 deps = []
28 } 32 }
29 33
30 if (!prebuilt_dart_exe_works) { 34 if (!prebuilt_dart_exe_works) {
31 deps += [ "$_dart_root/runtime/bin:dart_bootstrap_host_arch($host_toolchai n)" ] 35 deps += [ "$_dart_root/runtime/bin:dart_bootstrap_host_arch($dart_host_too lchain)" ]
32 } 36 }
33 37
34 script = "$_dart_root/tools/patch_sdk.py" 38 script = "$_dart_root/tools/patch_sdk.py"
35 39
36 # We list the `patch_sdk.dart` tool here because the [script] (which is 40 # We list the `patch_sdk.dart` tool here because the [script] (which is
37 # implicitly an input) will call it. 41 # implicitly an input) will call it.
38 inputs = [ 42 inputs = [
39 "$_dart_root/tools/patch_sdk.dart", 43 "$_dart_root/tools/patch_sdk.dart",
40 ] 44 ]
41 45
42 depfile = "$root_out_dir/${target_name}.d" 46 depfile = "$root_out_dir/${target_name}.d"
43 47
44 outputs = [ 48 outputs = [
45 # Instead of listing all outputs we list a single well-known one. 49 # Instead of listing all outputs we list a single well-known one.
46 "$root_out_dir/${invoker.patched_sdk_dir}/platform.dill", 50 "$root_out_dir/${invoker.patched_sdk_dir}/platform.dill",
47 ] 51 ]
48 52
49 args = [ "--quiet" ] 53 args = [ "--quiet" ]
50 if (!prebuilt_dart_exe_works) { 54 if (!prebuilt_dart_exe_works) {
51 dart_out_dir = get_label_info( 55 dart_out_dir = get_label_info(
52 "$_dart_root/runtime/bin:dart_bootstrap_host_arch($host_toolchain) ", 56 "$_dart_root/runtime/bin:dart_bootstrap_host_arch($dart_host_toolc hain)",
53 "root_out_dir") 57 "root_out_dir")
54 dart_bootstrap = rebase_path( 58 dart_bootstrap = rebase_path(
55 "$dart_out_dir/dart_bootstrap_host_arch$executable_suffix") 59 "$dart_out_dir/dart_bootstrap_host_arch$executable_suffix")
56 args += [ 60 args += [
57 "--dart-executable", 61 "--dart-executable",
58 dart_bootstrap, 62 dart_bootstrap,
59 ] 63 ]
60 } 64 }
61 args += [ 65 args += [
62 invoker.mode, 66 invoker.mode,
63 rebase_path("$_dart_root/sdk"), 67 rebase_path("$_dart_root/sdk"),
64 rebase_path(invoker.input_patches_dir), 68 rebase_path(invoker.input_patches_dir),
65 rebase_path("$root_out_dir/${invoker.patched_sdk_dir}", root_build_dir), 69 rebase_path("$root_out_dir/${invoker.patched_sdk_dir}", root_build_dir),
66 rebase_path("$_dart_root/.packages"), 70 rebase_path("$_dart_root/.packages"),
67 ] 71 ]
68 } 72 }
69 } 73 }
OLDNEW
« tools/patch_sdk.py ('K') | « tools/patch_sdk.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698