| 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/config/dcheck_always_on.gni") | 7 import("//build/config/dcheck_always_on.gni") |
| 8 import("//build/toolchain/toolchain.gni") | 8 import("//build/toolchain/toolchain.gni") |
| 9 | 9 |
| 10 assert(is_android) | 10 assert(is_android) |
| (...skipping 2602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2613 rebase_path(_scanned_files.resources, "", _output_path), | 2613 rebase_path(_scanned_files.resources, "", _output_path), |
| 2614 "abspath") | 2614 "abspath") |
| 2615 } | 2615 } |
| 2616 if (defined(_scanned_files.jars)) { | 2616 if (defined(_scanned_files.jars)) { |
| 2617 outputs += | 2617 outputs += |
| 2618 get_path_info(rebase_path(_scanned_files.jars, "", _output_path), | 2618 get_path_info(rebase_path(_scanned_files.jars, "", _output_path), |
| 2619 "abspath") | 2619 "abspath") |
| 2620 } | 2620 } |
| 2621 } | 2621 } |
| 2622 | 2622 |
| 2623 _sub_target_names = [] | 2623 _resource_targets = [] |
| 2624 |
| 2625 # Create the android_resources target for resources. |
| 2626 if (_scanned_files.resources != []) { |
| 2627 _res_target_name = "${target_name}__res" |
| 2628 _resource_targets += [ ":$_res_target_name" ] |
| 2629 android_resources(_res_target_name) { |
| 2630 forward_variables_from(invoker, [ "deps" ]) |
| 2631 if (!defined(deps)) { |
| 2632 deps = [] |
| 2633 } |
| 2634 deps += [ ":$_unpack_target_name" ] |
| 2635 resource_dirs = [] |
| 2636 generated_resource_dirs = [ "${_output_path}/res" ] |
| 2637 generated_resource_files = |
| 2638 rebase_path(_scanned_files.resources, "", _output_path) |
| 2639 android_manifest_dep = ":$_unpack_target_name" |
| 2640 android_manifest = "${_output_path}/AndroidManifest.xml" |
| 2641 v14_skip = true |
| 2642 } |
| 2643 } |
| 2624 | 2644 |
| 2625 # Create android_java_prebuilt targets for jar files. | 2645 # Create android_java_prebuilt targets for jar files. |
| 2646 _jar_targets = [] |
| 2626 _counter = 0 | 2647 _counter = 0 |
| 2627 foreach(jar, _scanned_files.jars) { | 2648 foreach(jar, _scanned_files.jars) { |
| 2628 _counter += 1 | 2649 _counter += 1 |
| 2629 _current_target = "${target_name}__jar_$_counter" | 2650 _current_target = "${target_name}__jar_$_counter" |
| 2630 _sub_target_names += [ ":$_current_target" ] | 2651 _jar_targets += [ ":$_current_target" ] |
| 2631 java_prebuilt(_current_target) { | 2652 java_prebuilt(_current_target) { |
| 2632 forward_variables_from(invoker, | 2653 forward_variables_from(invoker, |
| 2633 [ | 2654 [ |
| 2634 "deps", | 2655 "deps", |
| 2635 "requires_android", | 2656 "requires_android", |
| 2636 ]) | 2657 ]) |
| 2637 if (!defined(deps)) { | 2658 if (!defined(deps)) { |
| 2638 deps = [] | 2659 deps = [] |
| 2639 } | 2660 } |
| 2640 deps += [ ":$_unpack_target_name" ] | 2661 deps += _resource_targets + [ ":$_unpack_target_name" ] |
| 2641 if (!defined(requires_android)) { | 2662 if (!defined(requires_android)) { |
| 2642 requires_android = true | 2663 requires_android = true |
| 2643 } | 2664 } |
| 2644 supports_android = true | 2665 supports_android = true |
| 2645 jar_path = "${_output_path}/$jar" | 2666 jar_path = "${_output_path}/$jar" |
| 2646 } | 2667 } |
| 2647 } | 2668 } |
| 2648 | 2669 |
| 2649 # Create the android_resources target for resources. | |
| 2650 if (_scanned_files.resources != []) { | |
| 2651 _res_target_name = "${target_name}__res" | |
| 2652 _sub_target_names += [ ":$_res_target_name" ] | |
| 2653 android_resources(_res_target_name) { | |
| 2654 forward_variables_from(invoker, [ "deps" ]) | |
| 2655 if (!defined(deps)) { | |
| 2656 deps = [] | |
| 2657 } | |
| 2658 deps += [ ":$_unpack_target_name" ] | |
| 2659 resource_dirs = [] | |
| 2660 generated_resource_dirs = [ "${_output_path}/res" ] | |
| 2661 generated_resource_files = | |
| 2662 rebase_path(_scanned_files.resources, "", _output_path) | |
| 2663 android_manifest_dep = ":$_unpack_target_name" | |
| 2664 android_manifest = "${_output_path}/AndroidManifest.xml" | |
| 2665 v14_skip = true | |
| 2666 } | |
| 2667 } | |
| 2668 | |
| 2669 java_group(target_name) { | 2670 java_group(target_name) { |
| 2670 deps = _sub_target_names | 2671 deps = _resource_targets + _jar_targets |
| 2671 } | 2672 } |
| 2672 } | 2673 } |
| 2673 } | 2674 } |
| OLD | NEW |