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 2481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2492 | 2492 |
2493 android_library(target_name) { | 2493 android_library(target_name) { |
2494 chromium_code = false | 2494 chromium_code = false |
2495 java_files = [] | 2495 java_files = [] |
2496 srcjar_deps = [ ":${_template_name}__protoc_java" ] | 2496 srcjar_deps = [ ":${_template_name}__protoc_java" ] |
2497 deps = [ | 2497 deps = [ |
2498 "//third_party/android_protobuf:protobuf_nano_javalib", | 2498 "//third_party/android_protobuf:protobuf_nano_javalib", |
2499 ] | 2499 ] |
2500 } | 2500 } |
2501 } | 2501 } |
2502 | |
2503 # Declare an Android library target for a prebuilt aar | |
2504 # | |
2505 # This target creates an Android library containing java code and Android | |
2506 # resources. | |
2507 # | |
2508 # Variables | |
2509 # aar_path: Path to the aar. | |
2510 # | |
2511 # Example | |
2512 # android_aar_prebuilt("foo_aar") { | |
2513 # aar_path = "foo.aar" | |
2514 # } | |
2515 template("android_aar_prebuilt") { | |
2516 assert(defined(invoker.aar_path)) | |
2517 | |
2518 _output_path = "${root_out_dir}/unpacked_aar/${target_name}" | |
agrieve
2016/06/28 19:36:05
nit: should use "$target_gen_dir/$target_name"
| |
2519 _unpack_target_name = "${target_name}__unpack_aar" | |
2520 _jar_target_name = "${target_name}__jar" | |
2521 _res_target_name = "${target_name}__res" | |
2522 | |
2523 action(_unpack_target_name) { | |
2524 script = "//build/android/gyp/unpack_aar.py" # Unzips the AAR | |
2525 args = [ | |
2526 rebase_path(invoker.aar_path, root_build_dir), | |
2527 rebase_path(_output_path, root_build_dir), | |
2528 ] | |
2529 outputs = [ | |
2530 "${_output_path}/AndroidManifest.xml", | |
2531 "${_output_path}/classes.jar", | |
2532 "${_output_path}/R.txt", | |
2533 ] | |
2534 | |
2535 _resource_files = | |
2536 exec_script("//build/android/gyp/find.py", | |
agrieve
2016/06/28 19:36:05
this runs at gn gen time, so won't actually find a
| |
2537 rebase_path([ "${_output_path}/res" ], root_out_dir), | |
2538 "list lines") | |
2539 | |
2540 outputs += get_path_info(rebase_path(_resource_files, "", root_out_dir), | |
2541 "abspath") | |
2542 } | |
2543 | |
2544 java_prebuilt_impl(_jar_target_name) { | |
agrieve
2016/06/28 19:36:05
would android_rebuilt() work here?
| |
2545 deps = [ | |
2546 ":$_unpack_target_name", | |
2547 ] | |
2548 jar_path = "${_output_path}/classes.jar" | |
2549 supports_android = true | |
2550 requires_android = true | |
2551 strip_resource_classes = true | |
2552 } | |
2553 | |
2554 android_resources(_res_target_name) { | |
2555 deps = [ | |
2556 ":$_unpack_target_name", | |
2557 ] | |
2558 resource_dirs = [ "${_output_path}/res" ] | |
agrieve
2016/06/28 19:36:06
This also results in a find.py at gn gen time. I t
| |
2559 android_manifest = "${_output_path}/AndroidManifest.xml" | |
2560 v14_skip = true | |
2561 } | |
2562 | |
2563 java_group(target_name) { | |
2564 deps = [ | |
2565 ":$_jar_target_name", | |
2566 ":$_res_target_name", | |
2567 ] | |
2568 } | |
2569 } | |
2502 } | 2570 } |
OLD | NEW |