| 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_overrides/build.gni") | 5 import("//build_overrides/build.gni") |
| 6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
| 7 import("//build/config/sanitizers/sanitizers.gni") | 7 import("//build/config/sanitizers/sanitizers.gni") |
| 8 | 8 |
| 9 assert(is_android) | 9 assert(is_android) |
| 10 | 10 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 if (defined(invoker.bundled_srcjars)) { | 336 if (defined(invoker.bundled_srcjars)) { |
| 337 _rebased_bundled_srcjars = | 337 _rebased_bundled_srcjars = |
| 338 rebase_path(invoker.bundled_srcjars, root_build_dir) | 338 rebase_path(invoker.bundled_srcjars, root_build_dir) |
| 339 args += [ "--bundled-srcjars=$_rebased_bundled_srcjars" ] | 339 args += [ "--bundled-srcjars=$_rebased_bundled_srcjars" ] |
| 340 } | 340 } |
| 341 if (defined(invoker.input_jars_paths)) { | 341 if (defined(invoker.input_jars_paths)) { |
| 342 _rebased_input_jars_paths = | 342 _rebased_input_jars_paths = |
| 343 rebase_path(invoker.input_jars_paths, root_build_dir) | 343 rebase_path(invoker.input_jars_paths, root_build_dir) |
| 344 args += [ "--extra-classpath-jars=$_rebased_input_jars_paths" ] | 344 args += [ "--extra-classpath-jars=$_rebased_input_jars_paths" ] |
| 345 } | 345 } |
| 346 if (defined(invoker.proguard_configs)) { |
| 347 _rebased_proguard_configs = |
| 348 rebase_path(invoker.proguard_configs, root_build_dir) |
| 349 args += [ "--proguard-configs=$_rebased_proguard_configs" ] |
| 350 } |
| 346 if (current_toolchain != default_toolchain) { | 351 if (current_toolchain != default_toolchain) { |
| 347 # This has to be a built-time error rather than a GN assert because many | 352 # This has to be a built-time error rather than a GN assert because many |
| 348 # packages have a mix of java and non-java targets. For example, the | 353 # packages have a mix of java and non-java targets. For example, the |
| 349 # following would fail even though nothing depends on :bar(//baz): | 354 # following would fail even though nothing depends on :bar(//baz): |
| 350 # | 355 # |
| 351 # shared_library("foo") { | 356 # shared_library("foo") { |
| 352 # } | 357 # } |
| 353 # | 358 # |
| 354 # android_library("bar") { | 359 # android_library("bar") { |
| 355 # deps = [ ":foo(//baz)" ] | 360 # deps = [ ":foo(//baz)" ] |
| (...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1759 | 1764 |
| 1760 _build_config_target_name = "${_template_name}__build_config" | 1765 _build_config_target_name = "${_template_name}__build_config" |
| 1761 _process_jar_target_name = "${_template_name}__process_jar" | 1766 _process_jar_target_name = "${_template_name}__process_jar" |
| 1762 _ijar_target_name = "${_template_name}__ijar" | 1767 _ijar_target_name = "${_template_name}__ijar" |
| 1763 if (_supports_android) { | 1768 if (_supports_android) { |
| 1764 _dex_target_name = "${_template_name}__dex" | 1769 _dex_target_name = "${_template_name}__dex" |
| 1765 } | 1770 } |
| 1766 | 1771 |
| 1767 write_build_config(_build_config_target_name) { | 1772 write_build_config(_build_config_target_name) { |
| 1768 type = "java_prebuilt" | 1773 type = "java_prebuilt" |
| 1769 forward_variables_from(invoker, [ "input_jars_paths" ]) | 1774 forward_variables_from(invoker, |
| 1775 [ |
| 1776 "input_jars_paths", |
| 1777 "proguard_configs", |
| 1778 ]) |
| 1770 supports_android = _supports_android | 1779 supports_android = _supports_android |
| 1771 requires_android = | 1780 requires_android = |
| 1772 defined(invoker.requires_android) && invoker.requires_android | 1781 defined(invoker.requires_android) && invoker.requires_android |
| 1773 | 1782 |
| 1774 if (defined(invoker.deps)) { | 1783 if (defined(invoker.deps)) { |
| 1775 possible_config_deps = _deps | 1784 possible_config_deps = _deps |
| 1776 } | 1785 } |
| 1777 build_config = _build_config | 1786 build_config = _build_config |
| 1778 jar_path = _jar_path | 1787 jar_path = _jar_path |
| 1779 if (_supports_android) { | 1788 if (_supports_android) { |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2238 | 2247 |
| 2239 # Define build_config_deps which will be a list of targets required to | 2248 # Define build_config_deps which will be a list of targets required to |
| 2240 # build the _build_config. | 2249 # build the _build_config. |
| 2241 if (defined(invoker.override_build_config)) { | 2250 if (defined(invoker.override_build_config)) { |
| 2242 _build_config = invoker.override_build_config | 2251 _build_config = invoker.override_build_config |
| 2243 } else { | 2252 } else { |
| 2244 _build_config = _base_path + ".build_config" | 2253 _build_config = _base_path + ".build_config" |
| 2245 build_config_target_name = "${_template_name}__build_config" | 2254 build_config_target_name = "${_template_name}__build_config" |
| 2246 | 2255 |
| 2247 write_build_config(build_config_target_name) { | 2256 write_build_config(build_config_target_name) { |
| 2248 forward_variables_from(invoker, [ "input_jars_paths" ]) | 2257 forward_variables_from(invoker, |
| 2258 [ |
| 2259 "input_jars_paths", |
| 2260 "proguard_configs", |
| 2261 ]) |
| 2249 if (defined(invoker.is_java_binary) && invoker.is_java_binary) { | 2262 if (defined(invoker.is_java_binary) && invoker.is_java_binary) { |
| 2250 type = "java_binary" | 2263 type = "java_binary" |
| 2251 } else { | 2264 } else { |
| 2252 type = "java_library" | 2265 type = "java_library" |
| 2253 } | 2266 } |
| 2254 if (defined(invoker.deps)) { | 2267 if (defined(invoker.deps)) { |
| 2255 possible_config_deps = invoker.deps | 2268 possible_config_deps = invoker.deps |
| 2256 } | 2269 } |
| 2257 supports_android = _supports_android | 2270 supports_android = _supports_android |
| 2258 requires_android = _requires_android | 2271 requires_android = _requires_android |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2645 outputs = [ | 2658 outputs = [ |
| 2646 depfile, | 2659 depfile, |
| 2647 invoker.out_manifest, | 2660 invoker.out_manifest, |
| 2648 ] | 2661 ] |
| 2649 inputs = [ | 2662 inputs = [ |
| 2650 invoker.main_manifest, | 2663 invoker.main_manifest, |
| 2651 ] | 2664 ] |
| 2652 } | 2665 } |
| 2653 } | 2666 } |
| 2654 } | 2667 } |
| OLD | NEW |