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

Side by Side Diff: build/toolchain/mac/BUILD.gn

Issue 2106353004: Implement "copy_bundle_data" tool without using a python script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@create-bundle-deps
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | build/toolchain/mac/copy_bundle_data.py » ('j') | 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) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires 5 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires
6 # some enhancements since the commands on Mac are slightly different than on 6 # some enhancements since the commands on Mac are slightly different than on
7 # Linux. 7 # Linux.
8 8
9 import("../goma.gni") 9 import("../goma.gni")
10 import("//build/config/clang/clang.gni") 10 import("//build/config/clang/clang.gni")
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 # proper input-dirty checking, but that could be expensive. Instead, use a 57 # proper input-dirty checking, but that could be expensive. Instead, use a
58 # script to get the tool scripts' modification time to use as the version. 58 # script to get the tool scripts' modification time to use as the version.
59 # This won't cause a re-generation of GN files when the tool script changes 59 # This won't cause a re-generation of GN files when the tool script changes
60 # but it will cause edges to be marked as dirty if the ninja files are 60 # but it will cause edges to be marked as dirty if the ninja files are
61 # regenerated. See https://crbug.com/619083 for details. A proper fix 61 # regenerated. See https://crbug.com/619083 for details. A proper fix
62 # would be to have inputs to tools (https://crbug.com/621119). 62 # would be to have inputs to tools (https://crbug.com/621119).
63 tool_versions = 63 tool_versions =
64 exec_script("get_tool_mtime.py", 64 exec_script("get_tool_mtime.py",
65 rebase_path([ 65 rebase_path([
66 "//build/toolchain/mac/compile_xcassets.py", 66 "//build/toolchain/mac/compile_xcassets.py",
67 "//build/toolchain/mac/copy_bundle_data.py",
68 "//build/toolchain/mac/filter_libtool.py", 67 "//build/toolchain/mac/filter_libtool.py",
69 "//build/toolchain/mac/linker_driver.py", 68 "//build/toolchain/mac/linker_driver.py",
70 ], 69 ],
71 root_build_dir), 70 root_build_dir),
72 "trim scope") 71 "trim scope")
73 72
74 # Work around for unused variable warning in template https://crbug.com/395883. 73 # Work around for unused variable warning in template https://crbug.com/395883.
75 assert(tool_versions != "") 74 assert(tool_versions != "")
76 75
77 # Shared toolchain definition. Invocations should set toolchain_os to set the 76 # Shared toolchain definition. Invocations should set toolchain_os to set the
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 tool("stamp") { 299 tool("stamp") {
301 command = stamp_command 300 command = stamp_command
302 description = stamp_description 301 description = stamp_description
303 } 302 }
304 tool("copy") { 303 tool("copy") {
305 command = copy_command 304 command = copy_command
306 description = copy_description 305 description = copy_description
307 } 306 }
308 307
309 tool("copy_bundle_data") { 308 tool("copy_bundle_data") {
310 if (is_ios) { 309 _command = "if [[ -d {{source}} ]]; then " +
Robert Sesek 2016/06/30 17:28:02 This is missing the rm step first.
sdefresne 2016/07/01 11:12:29 Fixed.
311 _extra_args = "--strings-format=binary1" 310 "rsync --recursive --perms --links {{source}}/ {{output}}; " +
312 } else { 311 "else " + copy_command + "; fi"
313 _extra_args = "" 312
313 _convert_strings = is_ios
314 if (_convert_strings) {
Robert Sesek 2016/06/30 17:28:02 Should we just make string conversion a separate s
sdefresne 2016/07/01 11:12:29 I think we should do it as a separate step, howeve
Robert Sesek 2016/07/01 15:12:17 Yes, fine to do that in a follow up. Can you file
315 _command =
316 "case {{source}} in " +
317 "*.strings) plutil -convert binary1 -o {{output}} {{source}};; " +
318 "*) " + _command + ";; esac"
314 } 319 }
315 _tool = rebase_path("//build/toolchain/mac/copy_bundle_data.py", 320
316 root_build_dir) 321 command = _command
317 command = "TOOL_VERSION=${tool_versions.copy_bundle_data} python $_tool ${ _extra_args} {{source}} {{output}}"
318 description = "COPY_BUNDLE_DATA {{source}} {{output}}" 322 description = "COPY_BUNDLE_DATA {{source}} {{output}}"
319 pool = ":bundle_pool($default_toolchain)" 323 pool = ":bundle_pool($default_toolchain)"
320 } 324 }
321 tool("compile_xcassets") { 325 tool("compile_xcassets") {
322 _tool = rebase_path("//build/toolchain/mac/compile_xcassets.py", 326 _tool = rebase_path("//build/toolchain/mac/compile_xcassets.py",
323 root_build_dir) 327 root_build_dir)
324 if (is_ios) { 328 if (is_ios) {
325 _sdk_name = ios_sdk_name 329 _sdk_name = ios_sdk_name
326 _min_deployment_target = ios_deployment_target 330 _min_deployment_target = ios_deployment_target
327 } else { 331 } else {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 376
373 mac_toolchain("ios_clang_x86") { 377 mac_toolchain("ios_clang_x86") {
374 toolchain_cpu = "x86" 378 toolchain_cpu = "x86"
375 toolchain_os = "ios" 379 toolchain_os = "ios"
376 } 380 }
377 381
378 mac_toolchain("ios_clang_x64") { 382 mac_toolchain("ios_clang_x64") {
379 toolchain_cpu = "x64" 383 toolchain_cpu = "x64"
380 toolchain_os = "ios" 384 toolchain_os = "ios"
381 } 385 }
OLDNEW
« no previous file with comments | « no previous file | build/toolchain/mac/copy_bundle_data.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698