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 2273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2284 } | 2284 } |
2285 | 2285 |
2286 android_library(target_name) { | 2286 android_library(target_name) { |
2287 java_files = [] | 2287 java_files = [] |
2288 srcjar_deps = [ ":${_template_name}__protoc_java" ] | 2288 srcjar_deps = [ ":${_template_name}__protoc_java" ] |
2289 deps = [ | 2289 deps = [ |
2290 "//third_party/android_protobuf:protobuf_nano_javalib", | 2290 "//third_party/android_protobuf:protobuf_nano_javalib", |
2291 ] | 2291 ] |
2292 } | 2292 } |
2293 } | 2293 } |
| 2294 |
| 2295 # Writes a script to root_out_dir/bin that passes --output-directory to the |
| 2296 # wrapped script, in addition to forwarding arguments. Most / all of these |
| 2297 # wrappers should be made deps of //tools/android:android_tools. |
| 2298 # |
| 2299 # Variables |
| 2300 # target: Script to wrap. |
| 2301 # flag_name: Default is "--output-directory" |
| 2302 # |
| 2303 # Example |
| 2304 # wrapper_script("foo_wrapper") { |
| 2305 # target = "//pkg/foo.py" |
| 2306 # } |
| 2307 template("wrapper_script") { |
| 2308 action(target_name) { |
| 2309 _name = get_path_info(invoker.target, "name") |
| 2310 _output = "$root_out_dir/bin/$_name" |
| 2311 |
| 2312 script = "//build/android/gyp/create_tool_wrapper.py" |
| 2313 outputs = [ |
| 2314 _output, |
| 2315 ] |
| 2316 |
| 2317 # The target isn't actually used by the script, but it's nice to have GN |
| 2318 # check that it exists. |
| 2319 inputs = [ |
| 2320 invoker.target, |
| 2321 ] |
| 2322 args = [ |
| 2323 "--output", |
| 2324 rebase_path(_output, root_build_dir), |
| 2325 "--target", |
| 2326 rebase_path(invoker.target, root_build_dir), |
| 2327 "--output-directory", |
| 2328 rebase_path(root_out_dir, root_build_dir), |
| 2329 ] |
| 2330 if (defined(invoker.flag_name)) { |
| 2331 args += [ "--flag-name=${invoker.flag_name}" ] |
| 2332 } |
| 2333 } |
| 2334 } |
OLD | NEW |