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/toolchain/toolchain.gni") | 8 import("//build/toolchain/toolchain.gni") |
9 import("//third_party/android_platform/config.gni") | 9 import("//third_party/android_platform/config.gni") |
10 import("//tools/grit/grit_rule.gni") | 10 import("//tools/grit/grit_rule.gni") |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 wrapper_script_args = [ | 931 wrapper_script_args = [ |
932 "-test-jars", | 932 "-test-jars", |
933 "$target_name.jar", | 933 "$target_name.jar", |
934 ] | 934 ] |
935 testonly = true | 935 testonly = true |
936 | 936 |
937 deps += [ | 937 deps += [ |
938 "//testing/android/junit:junit_test_support", | 938 "//testing/android/junit:junit_test_support", |
939 "//third_party/junit", | 939 "//third_party/junit", |
940 "//third_party/mockito:mockito_java", | 940 "//third_party/mockito:mockito_java", |
| 941 "//third_party/robolectric:android-all-4.3_r2-robolectric-0", |
941 "//third_party/robolectric:robolectric_java", | 942 "//third_party/robolectric:robolectric_java", |
942 "//third_party/robolectric:android-all-4.3_r2-robolectric-0", | |
943 ] | 943 ] |
944 } | 944 } |
945 } | 945 } |
946 | 946 |
947 # Declare a java library target | 947 # Declare a java library target |
948 # | 948 # |
949 # Variables | 949 # Variables |
950 # deps: Specifies the dependencies of this target. Java targets in this list | 950 # deps: Specifies the dependencies of this target. Java targets in this list |
951 # will be added to the javac classpath. | 951 # will be added to the javac classpath. |
952 # | 952 # |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1520 | 1520 |
1521 if (_proguard_enabled) { | 1521 if (_proguard_enabled) { |
1522 _proguard_configs = [ _generated_proguard_config ] | 1522 _proguard_configs = [ _generated_proguard_config ] |
1523 if (defined(invoker.proguard_configs)) { | 1523 if (defined(invoker.proguard_configs)) { |
1524 _proguard_configs += invoker.proguard_configs | 1524 _proguard_configs += invoker.proguard_configs |
1525 } | 1525 } |
1526 _proguard_target = "${_template_name}__proguard" | 1526 _proguard_target = "${_template_name}__proguard" |
1527 proguard(_proguard_target) { | 1527 proguard(_proguard_target) { |
1528 deps = [ | 1528 deps = [ |
1529 ":$build_config_target", | 1529 ":$build_config_target", |
| 1530 ":$java_target", |
1530 ":$process_resources_target", | 1531 ":$process_resources_target", |
1531 ":$java_target", | |
1532 ] | 1532 ] |
1533 inputs = [ | 1533 inputs = [ |
1534 _build_config, | 1534 _build_config, |
1535 _jar_path, | 1535 _jar_path, |
1536 ] + _proguard_configs | 1536 ] + _proguard_configs |
1537 | 1537 |
1538 output_jar_path = _proguard_jar_path | 1538 output_jar_path = _proguard_jar_path |
1539 rebased_proguard_configs = rebase_path(_proguard_configs, root_build_dir) | 1539 rebased_proguard_configs = rebase_path(_proguard_configs, root_build_dir) |
1540 args = [ | 1540 args = [ |
1541 "--proguard-configs=$rebased_proguard_configs", | 1541 "--proguard-configs=$rebased_proguard_configs", |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1701 | 1701 |
1702 version_code = _version_code | 1702 version_code = _version_code |
1703 version_name = _version_name | 1703 version_name = _version_name |
1704 | 1704 |
1705 keystore_name = _keystore_name | 1705 keystore_name = _keystore_name |
1706 keystore_path = _keystore_path | 1706 keystore_path = _keystore_path |
1707 keystore_password = _keystore_password | 1707 keystore_password = _keystore_password |
1708 | 1708 |
1709 native_libs_dir = _native_libs_dir | 1709 native_libs_dir = _native_libs_dir |
1710 deps = [ | 1710 deps = [ |
| 1711 ":${_manifest_rule}", |
1711 ":${_prepare_native_target_name}", | 1712 ":${_prepare_native_target_name}", |
1712 ":${_manifest_rule}", | |
1713 ] | 1713 ] |
1714 incremental_deps = deps | 1714 incremental_deps = deps |
1715 } | 1715 } |
1716 } | 1716 } |
1717 | 1717 |
1718 _create_incremental_script_rule_name = "${_template_name}__incremental_script" | 1718 _create_incremental_script_rule_name = "${_template_name}__incremental_script" |
1719 action(_create_incremental_script_rule_name) { | 1719 action(_create_incremental_script_rule_name) { |
1720 script = "//build/android/incremental_install/create_install_script.py" | 1720 script = "//build/android/incremental_install/create_install_script.py" |
1721 depfile = "$target_gen_dir/$target_name.d" | 1721 depfile = "$target_gen_dir/$target_name.d" |
1722 deps = [ | 1722 deps = [ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1763 data_deps = [] | 1763 data_deps = [] |
1764 forward_variables_from(invoker, [ "data_deps" ]) | 1764 forward_variables_from(invoker, [ "data_deps" ]) |
1765 | 1765 |
1766 # device/commands is used by the installer script to push files via .zip. | 1766 # device/commands is used by the installer script to push files via .zip. |
1767 data_deps += [ "//build/android/pylib/device/commands" ] | 1767 data_deps += [ "//build/android/pylib/device/commands" ] |
1768 | 1768 |
1769 # Since the _incremental.apk does not include use .so nor .dex from the | 1769 # Since the _incremental.apk does not include use .so nor .dex from the |
1770 # actual target, but instead loads them at runtime, we need to explicitly | 1770 # actual target, but instead loads them at runtime, we need to explicitly |
1771 # depend on them here. | 1771 # depend on them here. |
1772 public_deps = [ | 1772 public_deps = [ |
| 1773 ":${_create_incremental_script_rule_name}", |
1773 ":${_template_name}__create_incremental", | 1774 ":${_template_name}__create_incremental", |
1774 ":${_create_incremental_script_rule_name}", | |
1775 ":${java_target}", | 1775 ":${java_target}", |
1776 ] | 1776 ] |
1777 if (_native_libs != []) { | 1777 if (_native_libs != []) { |
1778 public_deps += [ ":$_prepare_native_target_name" ] | 1778 public_deps += [ ":$_prepare_native_target_name" ] |
1779 } | 1779 } |
1780 } | 1780 } |
1781 } | 1781 } |
1782 | 1782 |
1783 # Declare an Android instrumentation test apk | 1783 # Declare an Android instrumentation test apk |
1784 # | 1784 # |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2140 _protoc_dep = "//third_party/android_protobuf:android_protoc($host_toolchain)" | 2140 _protoc_dep = "//third_party/android_protobuf:android_protoc($host_toolchain)" |
2141 _protoc_out_dir = get_label_info(_protoc_dep, "root_out_dir") | 2141 _protoc_out_dir = get_label_info(_protoc_dep, "root_out_dir") |
2142 _protoc_bin = "$_protoc_out_dir/android_protoc" | 2142 _protoc_bin = "$_protoc_out_dir/android_protoc" |
2143 _proto_path = invoker.proto_path | 2143 _proto_path = invoker.proto_path |
2144 | 2144 |
2145 _template_name = target_name | 2145 _template_name = target_name |
2146 | 2146 |
2147 action("${_template_name}__protoc_java") { | 2147 action("${_template_name}__protoc_java") { |
2148 srcjar_path = "$target_gen_dir/$target_name.srcjar" | 2148 srcjar_path = "$target_gen_dir/$target_name.srcjar" |
2149 script = "//build/protoc_java.py" | 2149 script = "//build/protoc_java.py" |
| 2150 |
2150 deps = [ | 2151 deps = [ |
2151 _protoc_dep, | 2152 _protoc_dep, |
2152 ] | 2153 ] |
| 2154 if (defined(invoker.deps)) { |
| 2155 deps += invoker.deps |
| 2156 } |
| 2157 |
2153 sources = invoker.sources | 2158 sources = invoker.sources |
2154 depfile = "$target_gen_dir/$target_name.d" | 2159 depfile = "$target_gen_dir/$target_name.d" |
2155 outputs = [ | 2160 outputs = [ |
2156 depfile, | 2161 depfile, |
2157 srcjar_path, | 2162 srcjar_path, |
2158 ] | 2163 ] |
2159 args = [ | 2164 args = [ |
2160 "--depfile", | 2165 "--depfile", |
2161 rebase_path(depfile, root_build_dir), | 2166 rebase_path(depfile, root_build_dir), |
2162 "--protoc", | 2167 "--protoc", |
2163 rebase_path(_protoc_bin, root_build_dir), | 2168 rebase_path(_protoc_bin, root_build_dir), |
2164 "--proto-path", | 2169 "--proto-path", |
2165 rebase_path(_proto_path, root_build_dir), | 2170 rebase_path(_proto_path, root_build_dir), |
2166 "--srcjar", | 2171 "--srcjar", |
2167 rebase_path(srcjar_path, root_build_dir), | 2172 rebase_path(srcjar_path, root_build_dir), |
2168 ] + rebase_path(sources, root_build_dir) | 2173 ] + rebase_path(sources, root_build_dir) |
2169 } | 2174 } |
2170 | 2175 |
2171 android_library(target_name) { | 2176 android_library(target_name) { |
2172 java_files = [] | 2177 java_files = [] |
2173 srcjar_deps = [ ":${_template_name}__protoc_java" ] | 2178 srcjar_deps = [ ":${_template_name}__protoc_java" ] |
2174 deps = [ | 2179 deps = [ |
2175 "//third_party/android_protobuf:protobuf_nano_javalib", | 2180 "//third_party/android_protobuf:protobuf_nano_javalib", |
2176 ] | 2181 ] |
2177 } | 2182 } |
2178 } | 2183 } |
OLD | NEW |