Chromium Code Reviews| 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("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
| 6 import("//build/config/android/internal_rules.gni") | 6 import("//build/config/android/internal_rules.gni") |
| 7 import("//build/toolchain/toolchain.gni") | 7 import("//build/toolchain/toolchain.gni") |
| 8 | 8 |
| 9 assert(is_android) | 9 assert(is_android) |
| 10 | 10 |
| (...skipping 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2490 | 2490 |
| 2491 android_library(target_name) { | 2491 android_library(target_name) { |
| 2492 chromium_code = false | 2492 chromium_code = false |
| 2493 java_files = [] | 2493 java_files = [] |
| 2494 srcjar_deps = [ ":${_template_name}__protoc_java" ] | 2494 srcjar_deps = [ ":${_template_name}__protoc_java" ] |
| 2495 deps = [ | 2495 deps = [ |
| 2496 "//third_party/android_protobuf:protobuf_nano_javalib", | 2496 "//third_party/android_protobuf:protobuf_nano_javalib", |
| 2497 ] | 2497 ] |
| 2498 } | 2498 } |
| 2499 } | 2499 } |
| 2500 | |
| 2501 # Declare an Android library target for a prebuilt aar | |
| 2502 # | |
| 2503 # This target creates an Android library containing java code and Android | |
| 2504 # resources. | |
| 2505 # | |
| 2506 # Variables | |
| 2507 # aar_path: Path to the aar. | |
| 2508 # custom_package: Custom package name to be used for the resource | |
| 2509 # directory. | |
| 2510 # skip_jar: If true do not include classes.jar | |
| 2511 # skip_res: If true do not include the resource directory | |
| 2512 # | |
| 2513 # Example | |
| 2514 # android_aar_prebuilt("foo_aar") { | |
| 2515 # aar_path = "foo.aar" | |
| 2516 # } | |
| 2517 template("android_aar_prebuilt") { | |
| 2518 set_sources_assignment_filter([]) | |
|
agrieve
2016/06/16 02:00:04
no need for this since you aren't using "sources"
| |
| 2519 | |
| 2520 assert(defined(invoker.aar_path)) | |
| 2521 | |
| 2522 build_config = "${root_out_dir}/${target_name}.build_config" | |
| 2523 | |
| 2524 _output_path = "${root_out_dir}/unpacked_aar/${target_name}" | |
| 2525 _copied_aar_path = "${_output_path}/${target_name}.aar" | |
| 2526 | |
| 2527 _unpack_target_name = "${target_name}__unpack_aar" | |
| 2528 _copy_target_name = "${target_name}__copy" | |
| 2529 | |
| 2530 action(_unpack_target_name) { | |
| 2531 script = "//build/config/android/unpack_aar.py" # Unzips the AAR | |
| 2532 args = [ | |
| 2533 rebase_path(invoker.aar_path, root_build_dir), | |
| 2534 rebase_path(_output_path, root_build_dir), | |
| 2535 ] | |
| 2536 outputs = [ | |
| 2537 "${_output_path}/AndroidManifest.xml", | |
| 2538 "${_output_path}/classes.jar", | |
| 2539 "${_output_path}/R.txt", | |
| 2540 ] | |
| 2541 } | |
| 2542 | |
| 2543 copy(_copy_target_name) { | |
|
agrieve
2016/06/16 02:00:04
Why copy it?
| |
| 2544 sources = [ | |
| 2545 rebase_path(invoker.aar_path, root_build_dir), | |
| 2546 ] | |
| 2547 outputs = [ | |
| 2548 _copied_aar_path, | |
| 2549 ] | |
| 2550 } | |
| 2551 | |
| 2552 write_build_config(target_name) { | |
| 2553 deps = [ | |
| 2554 ":$_copy_target_name", | |
| 2555 ":$_unpack_target_name", | |
| 2556 ] | |
| 2557 | |
| 2558 type = "android_aar" | |
| 2559 jar_path = "${_output_path}/classes.jar" | |
| 2560 r_text = "${_output_path}/R.txt" | |
| 2561 resources_zip = _copied_aar_path | |
| 2562 } | |
| 2563 } | |
| 2500 } | 2564 } |
| OLD | NEW |