OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import("//base/android/linker/config.gni") | 5 import("//base/android/linker/config.gni") |
6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
7 import("//build/config/android/internal_rules.gni") | 7 import("//build/config/android/internal_rules.gni") |
8 import("//build/config/sanitizers/sanitizers.gni") | 8 import("//build/config/sanitizers/sanitizers.gni") |
9 import("//build/toolchain/toolchain.gni") | 9 import("//build/toolchain/toolchain.gni") |
10 import("//third_party/android_platform/config.gni") | 10 import("//third_party/android_platform/config.gni") |
(...skipping 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2320 } | 2320 } |
2321 | 2321 |
2322 android_library(target_name) { | 2322 android_library(target_name) { |
2323 java_files = [] | 2323 java_files = [] |
2324 srcjar_deps = [ ":${_template_name}__protoc_java" ] | 2324 srcjar_deps = [ ":${_template_name}__protoc_java" ] |
2325 deps = [ | 2325 deps = [ |
2326 "//third_party/android_protobuf:protobuf_nano_javalib", | 2326 "//third_party/android_protobuf:protobuf_nano_javalib", |
2327 ] | 2327 ] |
2328 } | 2328 } |
2329 } | 2329 } |
| 2330 |
| 2331 # Writes a script to root_out_dir/bin that passes --output-directory to the |
| 2332 # wrapped script, in addition to forwarding arguments. Most / all of these |
| 2333 # wrappers should be made deps of //tools/android:android_tools. |
| 2334 # |
| 2335 # Variables |
| 2336 # target: Script to wrap. |
| 2337 # flag_name: Default is "--output-directory" |
| 2338 # |
| 2339 # Example |
| 2340 # wrapper_script("foo_wrapper") { |
| 2341 # target = "//pkg/foo.py" |
| 2342 # } |
| 2343 template("wrapper_script") { |
| 2344 action(target_name) { |
| 2345 _name = get_path_info(invoker.target, "name") |
| 2346 _output = "$root_out_dir/bin/$_name" |
| 2347 |
| 2348 script = "//build/android/gyp/create_tool_wrapper.py" |
| 2349 outputs = [ |
| 2350 _output, |
| 2351 ] |
| 2352 |
| 2353 # The target isn't actually used by the script, but it's nice to have GN |
| 2354 # check that it exists. |
| 2355 inputs = [ |
| 2356 invoker.target, |
| 2357 ] |
| 2358 args = [ |
| 2359 "--output", |
| 2360 rebase_path(_output, root_build_dir), |
| 2361 "--target", |
| 2362 rebase_path(invoker.target, root_build_dir), |
| 2363 "--output-directory", |
| 2364 rebase_path(root_out_dir, root_build_dir), |
| 2365 ] |
| 2366 if (defined(invoker.flag_name)) { |
| 2367 args += [ "--flag-name=${invoker.flag_name}" ] |
| 2368 } |
| 2369 } |
| 2370 } |
OLD | NEW |