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

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: Findbugs suppression 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
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("//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/config/sanitizers/sanitizers.gni") 8 import("//build/config/sanitizers/sanitizers.gni")
9 import("//build/toolchain/toolchain.gni") 9 import("//build/toolchain/toolchain.gni")
10 import("//third_party/android_platform/config.gni") 10 import("//third_party/android_platform/config.gni")
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 # include_all_resources - If true include all resource IDs in all generated 1271 # include_all_resources - If true include all resource IDs in all generated
1272 # R.java files. 1272 # R.java files.
1273 # testonly: Marks this target as "test-only". 1273 # testonly: Marks this target as "test-only".
1274 # write_asset_list: Adds an extra file to the assets, which contains a list of 1274 # write_asset_list: Adds an extra file to the assets, which contains a list of
1275 # all other asset files. 1275 # all other asset files.
1276 # alternative_locale_resource_dep: The locale resource target which overrides 1276 # alternative_locale_resource_dep: The locale resource target which overrides
1277 # any exsting locale resources in dep graph. 1277 # any exsting locale resources in dep graph.
1278 # requires_sdk_api_level_23: If defined and true, the apk is intended for 1278 # requires_sdk_api_level_23: If defined and true, the apk is intended for
1279 # installation only on Android M or later. In these releases the system 1279 # installation only on Android M or later. In these releases the system
1280 # linker does relocation unpacking, so we can enable it unconditionally. 1280 # linker does relocation unpacking, so we can enable it unconditionally.
1281 # secondary_native_libs: the path of native libraries for secondary app abi. 1281 # secondary_native_libs: The path of native libraries for secondary app abi.
1282 # run_findbugs_override: Forces run_findbugs on or off. If undefined, the 1282 # run_findbugs_override: Forces run_findbugs on or off. If undefined, the
1283 # default will use the build arg run_findbugs. 1283 # default will use the build arg run_findbugs.
1284 # proguard_jar_path: The path to proguard.jar you wish to use. If undefined,
1285 # the proguard used will be the checked in one in //third_party/proguard.
1284 # 1286 #
1285 # Example 1287 # Example
1286 # android_apk("foo_apk") { 1288 # android_apk("foo_apk") {
1287 # android_manifest = "AndroidManifest.xml" 1289 # android_manifest = "AndroidManifest.xml"
1288 # java_files = [ 1290 # java_files = [
1289 # "android/org/chromium/foo/FooApplication.java", 1291 # "android/org/chromium/foo/FooApplication.java",
1290 # "android/org/chromium/foo/FooActivity.java", 1292 # "android/org/chromium/foo/FooActivity.java",
1291 # ] 1293 # ]
1292 # deps = [ 1294 # deps = [
1293 # ":foo_support_java" 1295 # ":foo_support_java"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 defined(invoker.create_density_splits) && invoker.create_density_splits 1432 defined(invoker.create_density_splits) && invoker.create_density_splits
1431 _create_language_splits = 1433 _create_language_splits =
1432 defined(invoker.language_splits) && invoker.language_splits != [] 1434 defined(invoker.language_splits) && invoker.language_splits != []
1433 1435
1434 # Help GN understand that _create_abi_split is not unused (bug in GN). 1436 # Help GN understand that _create_abi_split is not unused (bug in GN).
1435 assert(_create_abi_split || true) 1437 assert(_create_abi_split || true)
1436 1438
1437 _proguard_enabled = 1439 _proguard_enabled =
1438 defined(invoker.proguard_enabled) && invoker.proguard_enabled 1440 defined(invoker.proguard_enabled) && invoker.proguard_enabled
1439 if (_proguard_enabled) { 1441 if (_proguard_enabled) {
1440 _proguard_jar_path = "$base_path.proguard.jar" 1442 _proguard_output_jar_path = "$base_path.proguard.jar"
1441 } 1443 }
1442 1444
1443 _emma_never_instrument = defined(invoker.testonly) && invoker.testonly 1445 _emma_never_instrument = defined(invoker.testonly) && invoker.testonly
1444 1446
1445 build_config_target = "${_template_name}__build_config" 1447 build_config_target = "${_template_name}__build_config"
1446 write_build_config(build_config_target) { 1448 write_build_config(build_config_target) {
1447 forward_variables_from(invoker, [ "apk_under_test" ]) 1449 forward_variables_from(invoker, [ "apk_under_test" ])
1448 type = "android_apk" 1450 type = "android_apk"
1449 jar_path = _jar_path 1451 jar_path = _jar_path
1450 dex_path = final_dex_path 1452 dex_path = final_dex_path
(...skipping 14 matching lines...) Expand all
1465 has_alternative_locale_resource = true 1467 has_alternative_locale_resource = true
1466 } 1468 }
1467 1469
1468 # Added emma to the target's classpath via its .build_config. 1470 # Added emma to the target's classpath via its .build_config.
1469 if (emma_coverage && !_emma_never_instrument) { 1471 if (emma_coverage && !_emma_never_instrument) {
1470 deps += [ "//third_party/android_tools:emma_device" ] 1472 deps += [ "//third_party/android_tools:emma_device" ]
1471 } 1473 }
1472 1474
1473 proguard_enabled = _proguard_enabled 1475 proguard_enabled = _proguard_enabled
1474 if (_proguard_enabled) { 1476 if (_proguard_enabled) {
1475 proguard_info = "$_proguard_jar_path.info" 1477 proguard_info = "$_proguard_output_jar_path.info"
1476 } 1478 }
1477 1479
1478 native_libs = _native_libs 1480 native_libs = _native_libs
1479 } 1481 }
1480 1482
1481 _final_deps = [] 1483 _final_deps = []
1482 1484
1483 _generated_proguard_config = "$base_path.resources.proguard.txt" 1485 _generated_proguard_config = "$base_path.resources.proguard.txt"
1484 process_resources_target = "${_template_name}__process_resources" 1486 process_resources_target = "${_template_name}__process_resources"
1485 process_resources(process_resources_target) { 1487 process_resources(process_resources_target) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 java_cpp_template("${_template_name}__build_config_java") { 1553 java_cpp_template("${_template_name}__build_config_java") {
1552 package_name = "org/chromium/base" 1554 package_name = "org/chromium/base"
1553 sources = [ 1555 sources = [
1554 "//base/android/java/templates/BuildConfig.template", 1556 "//base/android/java/templates/BuildConfig.template",
1555 ] 1557 ]
1556 1558
1557 defines = [] 1559 defines = []
1558 if (enable_multidex) { 1560 if (enable_multidex) {
1559 defines += [ "ENABLE_MULTIDEX" ] 1561 defines += [ "ENABLE_MULTIDEX" ]
1560 } 1562 }
1563 if (is_java_debug) {
1564 defines += [ "DEBUG" ]
1565 }
1561 } 1566 }
1562 _srcjar_deps += [ ":${_template_name}__build_config_java" ] 1567 _srcjar_deps += [ ":${_template_name}__build_config_java" ]
1563 } 1568 }
1564 1569
1565 java_target = "${_template_name}__java" 1570 java_target = "${_template_name}__java"
1566 java_library_impl(java_target) { 1571 java_library_impl(java_target) {
1567 forward_variables_from(invoker, 1572 forward_variables_from(invoker,
1568 [ 1573 [
1569 "chromium_code", 1574 "chromium_code",
1570 "java_files", 1575 "java_files",
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 } 1627 }
1623 } 1628 }
1624 1629
1625 if (_proguard_enabled) { 1630 if (_proguard_enabled) {
1626 _proguard_configs = [ _generated_proguard_config ] 1631 _proguard_configs = [ _generated_proguard_config ]
1627 if (defined(invoker.proguard_configs)) { 1632 if (defined(invoker.proguard_configs)) {
1628 _proguard_configs += invoker.proguard_configs 1633 _proguard_configs += invoker.proguard_configs
1629 } 1634 }
1630 _proguard_target = "${_template_name}__proguard" 1635 _proguard_target = "${_template_name}__proguard"
1631 proguard(_proguard_target) { 1636 proguard(_proguard_target) {
1632 forward_variables_from(invoker, [ "alternative_android_sdk_jar" ]) 1637 forward_variables_from(invoker,
1638 [
1639 "alternative_android_sdk_jar",
1640 "proguard_jar_path",
1641 ])
1633 deps = [ 1642 deps = [
1634 ":$build_config_target", 1643 ":$build_config_target",
1635 ":$java_target", 1644 ":$java_target",
1636 ":$process_resources_target", 1645 ":$process_resources_target",
1637 ] 1646 ]
1638 inputs = [ 1647 inputs = [
1639 _build_config, 1648 _build_config,
1640 _jar_path, 1649 _jar_path,
1641 ] + _proguard_configs 1650 ] + _proguard_configs
1642 1651
1643 output_jar_path = _proguard_jar_path 1652 output_jar_path = _proguard_output_jar_path
1644 _rebased_proguard_configs = rebase_path(_proguard_configs, root_build_dir) 1653 _rebased_proguard_configs = rebase_path(_proguard_configs, root_build_dir)
1645 args = [ 1654 args = [
1646 "--proguard-configs=$_rebased_proguard_configs", 1655 "--proguard-configs=$_rebased_proguard_configs",
1647 "--input-paths=@FileArg($_rebased_build_config:proguard:input_paths)", 1656 "--input-paths=@FileArg($_rebased_build_config:proguard:input_paths)",
1648 ] 1657 ]
1649 if (defined(invoker.apk_under_test)) { 1658 if (defined(invoker.apk_under_test)) {
1650 deps += [ 1659 deps += [
1651 "${invoker.apk_under_test}__build_config", 1660 "${invoker.apk_under_test}__build_config",
1652 "${invoker.apk_under_test}__proguard", 1661 "${invoker.apk_under_test}__proguard",
1653 ] 1662 ]
1654 _apk_under_test_build_config = 1663 _apk_under_test_build_config =
1655 get_label_info(invoker.apk_under_test, "target_gen_dir") + "/" + 1664 get_label_info(invoker.apk_under_test, "target_gen_dir") + "/" +
1656 get_label_info(invoker.apk_under_test, "name") + ".build_config" 1665 get_label_info(invoker.apk_under_test, "name") + ".build_config"
1657 _rebased_apk_under_test_build_config = 1666 _rebased_apk_under_test_build_config =
1658 rebase_path(_apk_under_test_build_config, root_build_dir) 1667 rebase_path(_apk_under_test_build_config, root_build_dir)
1659 args += [ "--tested-apk-info=@FileArg($_rebased_apk_under_test_build_con fig:deps_info:proguard_info)" ] 1668 args += [ "--tested-apk-info=@FileArg($_rebased_apk_under_test_build_con fig:deps_info:proguard_info)" ]
1660 } 1669 }
1661 } 1670 }
1662 _dex_sources = [ _proguard_jar_path ] 1671 _dex_sources = [ _proguard_output_jar_path ]
1663 _dex_deps = [ ":$_proguard_target" ] 1672 _dex_deps = [ ":$_proguard_target" ]
1664 } else { 1673 } else {
1665 if (enable_multidex) { 1674 if (enable_multidex) {
1666 _dex_sources = [ _jar_path ] 1675 _dex_sources = [ _jar_path ]
1667 } else { 1676 } else {
1668 _dex_sources = [ _lib_dex_path ] 1677 _dex_sources = [ _lib_dex_path ]
1669 } 1678 }
1670 _dex_deps = [ ":$java_target" ] 1679 _dex_deps = [ ":$java_target" ]
1671 } 1680 }
1672 1681
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
2467 "--target", 2476 "--target",
2468 rebase_path(invoker.target, root_build_dir), 2477 rebase_path(invoker.target, root_build_dir),
2469 "--output-directory", 2478 "--output-directory",
2470 rebase_path(root_out_dir, root_build_dir), 2479 rebase_path(root_out_dir, root_build_dir),
2471 ] 2480 ]
2472 if (defined(invoker.flag_name)) { 2481 if (defined(invoker.flag_name)) {
2473 args += [ "--flag-name=${invoker.flag_name}" ] 2482 args += [ "--flag-name=${invoker.flag_name}" ]
2474 } 2483 }
2475 } 2484 }
2476 } 2485 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698