Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(830)

Side by Side Diff: build/config/android/rules.gni

Issue 2031033002: Adding option for Proguard jar to be switched. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed single newline Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/config/android/internal_rules.gni ('k') | chrome/android/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 # include_all_resources - If true include all resource IDs in all generated 1407 # include_all_resources - If true include all resource IDs in all generated
1408 # R.java files. 1408 # R.java files.
1409 # testonly: Marks this target as "test-only". 1409 # testonly: Marks this target as "test-only".
1410 # write_asset_list: Adds an extra file to the assets, which contains a list of 1410 # write_asset_list: Adds an extra file to the assets, which contains a list of
1411 # all other asset files. 1411 # all other asset files.
1412 # alternative_locale_resource_dep: The locale resource target which override s 1412 # alternative_locale_resource_dep: The locale resource target which override s
1413 # any exsting locale resources in dep graph. 1413 # any exsting locale resources in dep graph.
1414 # requires_sdk_api_level_23: If defined and true, the apk is intended for 1414 # requires_sdk_api_level_23: If defined and true, the apk is intended for
1415 # installation only on Android M or later. In these releases the system 1415 # installation only on Android M or later. In these releases the system
1416 # linker does relocation unpacking, so we can enable it unconditionally. 1416 # linker does relocation unpacking, so we can enable it unconditionally.
1417 # secondary_native_libs: the path of native libraries for secondary app abi. 1417 # secondary_native_libs: The path of native libraries for secondary app abi.
1418 # run_findbugs_override: Forces run_findbugs on or off. If undefined, the 1418 # run_findbugs_override: Forces run_findbugs on or off. If undefined, the
1419 # default will use the build arg run_findbugs. 1419 # default will use the build arg run_findbugs.
1420 # proguard_jar_path: The path to proguard.jar you wish to use. If undefined,
1421 # the proguard used will be the checked in one in //third_party/proguard.
1420 # 1422 #
1421 # Example 1423 # Example
1422 # android_apk("foo_apk") { 1424 # android_apk("foo_apk") {
1423 # android_manifest = "AndroidManifest.xml" 1425 # android_manifest = "AndroidManifest.xml"
1424 # java_files = [ 1426 # java_files = [
1425 # "android/org/chromium/foo/FooApplication.java", 1427 # "android/org/chromium/foo/FooApplication.java",
1426 # "android/org/chromium/foo/FooActivity.java", 1428 # "android/org/chromium/foo/FooActivity.java",
1427 # ] 1429 # ]
1428 # deps = [ 1430 # deps = [
1429 # ":foo_support_java" 1431 # ":foo_support_java"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 defined(invoker.create_density_splits) && invoker.create_density_splits 1569 defined(invoker.create_density_splits) && invoker.create_density_splits
1568 _create_language_splits = 1570 _create_language_splits =
1569 defined(invoker.language_splits) && invoker.language_splits != [] 1571 defined(invoker.language_splits) && invoker.language_splits != []
1570 1572
1571 # Help GN understand that _create_abi_split is not unused (bug in GN). 1573 # Help GN understand that _create_abi_split is not unused (bug in GN).
1572 assert(_create_abi_split || true) 1574 assert(_create_abi_split || true)
1573 1575
1574 _proguard_enabled = 1576 _proguard_enabled =
1575 defined(invoker.proguard_enabled) && invoker.proguard_enabled 1577 defined(invoker.proguard_enabled) && invoker.proguard_enabled
1576 if (_proguard_enabled) { 1578 if (_proguard_enabled) {
1577 _proguard_jar_path = "$base_path.proguard.jar" 1579 _proguard_output_jar_path = "$base_path.proguard.jar"
1578 } 1580 }
1579 1581
1580 _emma_never_instrument = defined(invoker.testonly) && invoker.testonly 1582 _emma_never_instrument = defined(invoker.testonly) && invoker.testonly
1581 1583
1582 build_config_target = "${_template_name}__build_config" 1584 build_config_target = "${_template_name}__build_config"
1583 write_build_config(build_config_target) { 1585 write_build_config(build_config_target) {
1584 forward_variables_from(invoker, [ "apk_under_test" ]) 1586 forward_variables_from(invoker, [ "apk_under_test" ])
1585 type = "android_apk" 1587 type = "android_apk"
1586 jar_path = _jar_path 1588 jar_path = _jar_path
1587 dex_path = final_dex_path 1589 dex_path = final_dex_path
(...skipping 14 matching lines...) Expand all
1602 has_alternative_locale_resource = true 1604 has_alternative_locale_resource = true
1603 } 1605 }
1604 1606
1605 # Added emma to the target's classpath via its .build_config. 1607 # Added emma to the target's classpath via its .build_config.
1606 if (emma_coverage && !_emma_never_instrument) { 1608 if (emma_coverage && !_emma_never_instrument) {
1607 deps += [ "//third_party/android_tools:emma_device" ] 1609 deps += [ "//third_party/android_tools:emma_device" ]
1608 } 1610 }
1609 1611
1610 proguard_enabled = _proguard_enabled 1612 proguard_enabled = _proguard_enabled
1611 if (_proguard_enabled) { 1613 if (_proguard_enabled) {
1612 proguard_info = "$_proguard_jar_path.info" 1614 proguard_info = "$_proguard_output_jar_path.info"
1613 } 1615 }
1614 1616
1615 native_libs = _native_libs 1617 native_libs = _native_libs
1616 } 1618 }
1617 1619
1618 _final_deps = [] 1620 _final_deps = []
1619 1621
1620 _generated_proguard_config = "$base_path.resources.proguard.txt" 1622 _generated_proguard_config = "$base_path.resources.proguard.txt"
1621 process_resources_target = "${_template_name}__process_resources" 1623 process_resources_target = "${_template_name}__process_resources"
1622 process_resources(process_resources_target) { 1624 process_resources(process_resources_target) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 java_cpp_template("${_template_name}__build_config_java") { 1690 java_cpp_template("${_template_name}__build_config_java") {
1689 package_name = "org/chromium/base" 1691 package_name = "org/chromium/base"
1690 sources = [ 1692 sources = [
1691 "//base/android/java/templates/BuildConfig.template", 1693 "//base/android/java/templates/BuildConfig.template",
1692 ] 1694 ]
1693 1695
1694 defines = [] 1696 defines = []
1695 if (enable_multidex) { 1697 if (enable_multidex) {
1696 defines += [ "ENABLE_MULTIDEX" ] 1698 defines += [ "ENABLE_MULTIDEX" ]
1697 } 1699 }
1700 if (!is_java_debug) {
1701 defines += [ "NDEBUG" ]
1702 }
1698 } 1703 }
1699 _srcjar_deps += [ ":${_template_name}__build_config_java" ] 1704 _srcjar_deps += [ ":${_template_name}__build_config_java" ]
1700 } 1705 }
1701 1706
1702 java_target = "${_template_name}__java" 1707 java_target = "${_template_name}__java"
1703 java_library_impl(java_target) { 1708 java_library_impl(java_target) {
1704 forward_variables_from(invoker, 1709 forward_variables_from(invoker,
1705 [ 1710 [
1706 "chromium_code", 1711 "chromium_code",
1707 "java_files", 1712 "java_files",
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 } 1764 }
1760 } 1765 }
1761 1766
1762 if (_proguard_enabled) { 1767 if (_proguard_enabled) {
1763 _proguard_configs = [ _generated_proguard_config ] 1768 _proguard_configs = [ _generated_proguard_config ]
1764 if (defined(invoker.proguard_configs)) { 1769 if (defined(invoker.proguard_configs)) {
1765 _proguard_configs += invoker.proguard_configs 1770 _proguard_configs += invoker.proguard_configs
1766 } 1771 }
1767 _proguard_target = "${_template_name}__proguard" 1772 _proguard_target = "${_template_name}__proguard"
1768 proguard(_proguard_target) { 1773 proguard(_proguard_target) {
1769 forward_variables_from(invoker, [ "alternative_android_sdk_jar" ]) 1774 forward_variables_from(invoker,
1775 [
1776 "alternative_android_sdk_jar",
1777 "proguard_jar_path",
1778 ])
1770 deps = [ 1779 deps = [
1771 ":$build_config_target", 1780 ":$build_config_target",
1772 ":$java_target", 1781 ":$java_target",
1773 ":$process_resources_target", 1782 ":$process_resources_target",
1774 ] 1783 ]
1775 inputs = [ 1784 inputs = [
1776 _build_config, 1785 _build_config,
1777 _jar_path, 1786 _jar_path,
1778 ] + _proguard_configs 1787 ] + _proguard_configs
1779 1788
1780 output_jar_path = _proguard_jar_path 1789 output_jar_path = _proguard_output_jar_path
1781 _rebased_proguard_configs = 1790 _rebased_proguard_configs =
1782 rebase_path(_proguard_configs, root_build_dir) 1791 rebase_path(_proguard_configs, root_build_dir)
1783 args = [ 1792 args = [
1784 "--proguard-configs=$_rebased_proguard_configs", 1793 "--proguard-configs=$_rebased_proguard_configs",
1785 "--input-paths=@FileArg($_rebased_build_config:proguard:input_paths)", 1794 "--input-paths=@FileArg($_rebased_build_config:proguard:input_paths)",
1786 ] 1795 ]
1787 if (defined(invoker.apk_under_test)) { 1796 if (defined(invoker.apk_under_test)) {
1788 deps += [ 1797 deps += [
1789 "${invoker.apk_under_test}__build_config", 1798 "${invoker.apk_under_test}__build_config",
1790 "${invoker.apk_under_test}__proguard", 1799 "${invoker.apk_under_test}__proguard",
1791 ] 1800 ]
1792 _apk_under_test_build_config = 1801 _apk_under_test_build_config =
1793 get_label_info(invoker.apk_under_test, "target_gen_dir") + "/" + 1802 get_label_info(invoker.apk_under_test, "target_gen_dir") + "/" +
1794 get_label_info(invoker.apk_under_test, "name") + ".build_config" 1803 get_label_info(invoker.apk_under_test, "name") + ".build_config"
1795 _rebased_apk_under_test_build_config = 1804 _rebased_apk_under_test_build_config =
1796 rebase_path(_apk_under_test_build_config, root_build_dir) 1805 rebase_path(_apk_under_test_build_config, root_build_dir)
1797 args += [ "--tested-apk-info=@FileArg($_rebased_apk_under_test_build_c onfig:deps_info:proguard_info)" ] 1806 args += [ "--tested-apk-info=@FileArg($_rebased_apk_under_test_build_c onfig:deps_info:proguard_info)" ]
1798 } 1807 }
1799 } 1808 }
1800 _dex_sources = [ _proguard_jar_path ] 1809 _dex_sources = [ _proguard_output_jar_path ]
1801 _dex_deps = [ ":$_proguard_target" ] 1810 _dex_deps = [ ":$_proguard_target" ]
1802 } else { 1811 } else {
1803 if (enable_multidex) { 1812 if (enable_multidex) {
1804 _dex_sources = [ _jar_path ] 1813 _dex_sources = [ _jar_path ]
1805 } else { 1814 } else {
1806 _dex_sources = [ _lib_dex_path ] 1815 _dex_sources = [ _lib_dex_path ]
1807 } 1816 }
1808 _dex_deps = [ ":$java_target" ] 1817 _dex_deps = [ ":$java_target" ]
1809 } 1818 }
1810 1819
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 android_library(target_name) { 2491 android_library(target_name) {
2483 chromium_code = false 2492 chromium_code = false
2484 java_files = [] 2493 java_files = []
2485 srcjar_deps = [ ":${_template_name}__protoc_java" ] 2494 srcjar_deps = [ ":${_template_name}__protoc_java" ]
2486 deps = [ 2495 deps = [
2487 "//third_party/android_protobuf:protobuf_nano_javalib", 2496 "//third_party/android_protobuf:protobuf_nano_javalib",
2488 ] 2497 ]
2489 } 2498 }
2490 } 2499 }
2491 } 2500 }
OLDNEW
« no previous file with comments | « build/config/android/internal_rules.gni ('k') | chrome/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698