| 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 | 6 |
| 7 assert(is_android) | 7 assert(is_android) |
| 8 | 8 |
| 9 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) | 9 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) |
| 10 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) | 10 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 defined(invoker.supports_android) && invoker.supports_android | 827 defined(invoker.supports_android) && invoker.supports_android |
| 828 | 828 |
| 829 assert(defined(invoker.jar_path)) | 829 assert(defined(invoker.jar_path)) |
| 830 _base_path = "${target_gen_dir}/$target_name" | 830 _base_path = "${target_gen_dir}/$target_name" |
| 831 _jar_path = _base_path + ".jar" | 831 _jar_path = _base_path + ".jar" |
| 832 _build_config = _base_path + ".build_config" | 832 _build_config = _base_path + ".build_config" |
| 833 | 833 |
| 834 if (_supports_android) { | 834 if (_supports_android) { |
| 835 _dex_path = _base_path + ".dex.jar" | 835 _dex_path = _base_path + ".dex.jar" |
| 836 } | 836 } |
| 837 _deps = [] |
| 838 if (defined(invoker.deps)) { |
| 839 _deps = invoker.deps |
| 840 } |
| 837 | 841 |
| 838 _template_name = target_name | 842 _template_name = target_name |
| 839 | 843 |
| 840 build_config_target_name = "${_template_name}__build_config" | 844 build_config_target_name = "${_template_name}__build_config" |
| 841 process_jar_target_name = "${_template_name}__process_jar" | 845 process_jar_target_name = "${_template_name}__process_jar" |
| 842 if (_supports_android) { | 846 if (_supports_android) { |
| 843 dex_target_name = "${_template_name}__dex" | 847 dex_target_name = "${_template_name}__dex" |
| 844 } | 848 } |
| 845 | 849 |
| 846 write_build_config(build_config_target_name) { | 850 write_build_config(build_config_target_name) { |
| 847 type = "java_library" | 851 type = "java_library" |
| 848 supports_android = _supports_android | 852 supports_android = _supports_android |
| 849 requires_android = | 853 requires_android = |
| 850 defined(invoker.requires_android) && invoker.requires_android | 854 defined(invoker.requires_android) && invoker.requires_android |
| 851 | 855 |
| 852 deps = [] | 856 deps = _deps |
| 853 if (defined(invoker.deps)) { | |
| 854 deps += invoker.deps | |
| 855 } | |
| 856 build_config = _build_config | 857 build_config = _build_config |
| 857 jar_path = _jar_path | 858 jar_path = _jar_path |
| 858 if (_supports_android) { | 859 if (_supports_android) { |
| 859 dex_path = _dex_path | 860 dex_path = _dex_path |
| 860 } | 861 } |
| 861 } | 862 } |
| 862 | 863 |
| 863 process_java_prebuilt(process_jar_target_name) { | 864 process_java_prebuilt(process_jar_target_name) { |
| 864 visibility = [ ":$_template_name" ] | 865 visibility = [ ":$_template_name" ] |
| 865 if (_supports_android) { | 866 if (_supports_android) { |
| 866 visibility += [ ":$dex_target_name" ] | 867 visibility += [ ":$dex_target_name" ] |
| 867 } | 868 } |
| 868 | 869 |
| 869 if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) { | 870 if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) { |
| 870 proguard_preprocess = true | 871 proguard_preprocess = true |
| 871 proguard_config = invoker.proguard_config | 872 proguard_config = invoker.proguard_config |
| 872 } | 873 } |
| 873 | 874 |
| 874 build_config = _build_config | 875 build_config = _build_config |
| 875 input_jar_path = invoker.jar_path | 876 input_jar_path = invoker.jar_path |
| 876 output_jar_path = _jar_path | 877 output_jar_path = _jar_path |
| 877 | 878 |
| 878 deps = [ | 879 deps = [ ":$build_config_target_name" ] + _deps |
| 879 ":$build_config_target_name", | |
| 880 ] | |
| 881 } | 880 } |
| 882 | 881 |
| 883 if (_supports_android) { | 882 if (_supports_android) { |
| 884 dex(dex_target_name) { | 883 dex(dex_target_name) { |
| 885 sources = [ | 884 sources = [ |
| 886 _jar_path, | 885 _jar_path, |
| 887 ] | 886 ] |
| 888 output = _dex_path | 887 output = _dex_path |
| 889 deps = [ | 888 deps = [ |
| 890 ":$process_jar_target_name", | 889 ":$process_jar_target_name", |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 ] | 1571 ] |
| 1573 args = [ | 1572 args = [ |
| 1574 "--depfile", | 1573 "--depfile", |
| 1575 rebase_path(depfile, root_build_dir), | 1574 rebase_path(depfile, root_build_dir), |
| 1576 "--script-output-path", | 1575 "--script-output-path", |
| 1577 rebase_path(generated_script, root_build_dir), | 1576 rebase_path(generated_script, root_build_dir), |
| 1578 ] | 1577 ] |
| 1579 args += test_runner_args | 1578 args += test_runner_args |
| 1580 } | 1579 } |
| 1581 } | 1580 } |
| OLD | NEW |