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/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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
572 # |generated_resource_dirs| must be specified in |generated_resource_files| | 572 # |generated_resource_dirs| must be specified in |generated_resource_files| |
573 # is specified. | 573 # is specified. |
574 # android_manifest: AndroidManifest.xml for this target. Defaults to | 574 # android_manifest: AndroidManifest.xml for this target. Defaults to |
575 # //build/android/AndroidManifest.xml. | 575 # //build/android/AndroidManifest.xml. |
576 # custom_package: java package for generated .java files. | 576 # custom_package: java package for generated .java files. |
577 # v14_skip: If true, don't run v14 resource generator on this. Defaults to | 577 # v14_skip: If true, don't run v14 resource generator on this. Defaults to |
578 # false. (see build/android/gyp/generate_v14_compatible_resources.py) | 578 # false. (see build/android/gyp/generate_v14_compatible_resources.py) |
579 # | 579 # |
580 # shared_resources: If true make a resource package that can be loaded by a | 580 # shared_resources: If true make a resource package that can be loaded by a |
581 # different application at runtime to access the package's resources. | 581 # different application at runtime to access the package's resources. |
582 # | 582 # |
agrieve
2015/12/30 15:12:16
nit: Remove blank line (feel free to remove the on
michaelbai
2015/12/30 18:54:15
Done.
| |
583 # app_as_shared_lib: If true make a resource package that can be loaded as | |
584 # both shared_resources and normal application. | |
583 | 585 |
584 # Example: | 586 # Example: |
585 # android_resources("foo_resources") { | 587 # android_resources("foo_resources") { |
586 # deps = [":foo_strings_grd"] | 588 # deps = [":foo_strings_grd"] |
587 # resource_dirs = ["res"] | 589 # resource_dirs = ["res"] |
588 # custom_package = "org.chromium.foo" | 590 # custom_package = "org.chromium.foo" |
589 # } | 591 # } |
590 # | 592 # |
591 # android_resources("foo_resources_overrides") { | 593 # android_resources("foo_resources_overrides") { |
592 # deps = [":foo_resources"] | 594 # deps = [":foo_resources"] |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
628 type = "android_resources" | 630 type = "android_resources" |
629 resources_zip = zip_path | 631 resources_zip = zip_path |
630 srcjar = srcjar_path | 632 srcjar = srcjar_path |
631 } | 633 } |
632 | 634 |
633 process_resources(process_resources_target_name) { | 635 process_resources(process_resources_target_name) { |
634 visibility = [ ":$final_target_name" ] | 636 visibility = [ ":$final_target_name" ] |
635 deps = [] | 637 deps = [] |
636 forward_variables_from(invoker, | 638 forward_variables_from(invoker, |
637 [ | 639 [ |
640 "app_as_shared_lib", | |
638 "android_manifest", | 641 "android_manifest", |
639 "custom_package", | 642 "custom_package", |
640 "deps", | 643 "deps", |
641 "generated_resource_dirs", | 644 "generated_resource_dirs", |
642 "generated_resource_files", | 645 "generated_resource_files", |
643 "resource_dirs", | 646 "resource_dirs", |
644 "shared_resources", | 647 "shared_resources", |
645 "v14_skip", | 648 "v14_skip", |
646 ]) | 649 ]) |
647 deps += [ ":$build_config_target_name" ] | 650 deps += [ ":$build_config_target_name" ] |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1175 requires_android = true | 1178 requires_android = true |
1176 } | 1179 } |
1177 } | 1180 } |
1178 | 1181 |
1179 # Declare an Android apk target | 1182 # Declare an Android apk target |
1180 # | 1183 # |
1181 # This target creates an Android APK containing java code, resources, assets, | 1184 # This target creates an Android APK containing java code, resources, assets, |
1182 # and (possibly) native libraries. | 1185 # and (possibly) native libraries. |
1183 # | 1186 # |
1184 # Variables | 1187 # Variables |
1188 # alternative_android_sdk_jar: The alternative android sdk jar used in | |
1189 # proguard. | |
1190 # android_aapt_path: Android aapt tool to replace default one to build | |
1191 # resource. | |
1185 # android_manifest: Path to AndroidManifest.xml. | 1192 # android_manifest: Path to AndroidManifest.xml. |
1186 # android_manifest_dep: Target that generates AndroidManifest (if applicable) | 1193 # android_manifest_dep: Target that generates AndroidManifest (if applicable) |
1187 # chromium_code: If true, extra analysis warning/errors will be enabled. | 1194 # chromium_code: If true, extra analysis warning/errors will be enabled. |
1188 # data_deps: List of dependencies needed at runtime. These will be built but | 1195 # data_deps: List of dependencies needed at runtime. These will be built but |
1189 # won't change the generated .apk in any way (in fact they may be built | 1196 # won't change the generated .apk in any way (in fact they may be built |
1190 # after the .apk is). | 1197 # after the .apk is). |
1191 # deps: List of dependencies. All Android java resources and libraries in the | 1198 # deps: List of dependencies. All Android java resources and libraries in the |
1192 # "transitive closure" of these dependencies will be included in the apk. | 1199 # "transitive closure" of these dependencies will be included in the apk. |
1193 # Note: this "transitive closure" actually only includes such targets if | 1200 # Note: this "transitive closure" actually only includes such targets if |
1194 # they are depended on through android_library or android_resources targets | 1201 # they are depended on through android_library or android_resources targets |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1402 native_libs = _native_libs | 1409 native_libs = _native_libs |
1403 } | 1410 } |
1404 | 1411 |
1405 _final_deps = [] | 1412 _final_deps = [] |
1406 | 1413 |
1407 _generated_proguard_config = "$base_path.resources.proguard.txt" | 1414 _generated_proguard_config = "$base_path.resources.proguard.txt" |
1408 process_resources_target = "${_template_name}__process_resources" | 1415 process_resources_target = "${_template_name}__process_resources" |
1409 process_resources(process_resources_target) { | 1416 process_resources(process_resources_target) { |
1410 forward_variables_from(invoker, | 1417 forward_variables_from(invoker, |
1411 [ | 1418 [ |
1419 "android_aapt_path", | |
1420 "app_as_shared_lib", | |
1412 "include_all_resources", | 1421 "include_all_resources", |
1413 "shared_resources", | 1422 "shared_resources", |
1414 ]) | 1423 ]) |
1415 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" | 1424 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" |
1416 r_text_path = "${target_gen_dir}/${target_name}_R.txt" | 1425 r_text_path = "${target_gen_dir}/${target_name}_R.txt" |
1417 android_manifest = _android_manifest | 1426 android_manifest = _android_manifest |
1418 resource_dirs = [ "//build/android/ant/empty/res" ] | 1427 resource_dirs = [ "//build/android/ant/empty/res" ] |
1419 zip_path = resources_zip_path | 1428 zip_path = resources_zip_path |
1420 all_resources_zip_path = _all_resources_zip_path | 1429 all_resources_zip_path = _all_resources_zip_path |
1421 generate_constant_ids = true | 1430 generate_constant_ids = true |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1550 _jar_path, | 1559 _jar_path, |
1551 ] + _proguard_configs | 1560 ] + _proguard_configs |
1552 | 1561 |
1553 output_jar_path = _proguard_jar_path | 1562 output_jar_path = _proguard_jar_path |
1554 rebased_proguard_configs = rebase_path(_proguard_configs, root_build_dir) | 1563 rebased_proguard_configs = rebase_path(_proguard_configs, root_build_dir) |
1555 args = [ | 1564 args = [ |
1556 "--proguard-configs=$rebased_proguard_configs", | 1565 "--proguard-configs=$rebased_proguard_configs", |
1557 "--tested-apk-info=@FileArg($_rebased_build_config:proguard:tested_apk_i nfo)", | 1566 "--tested-apk-info=@FileArg($_rebased_build_config:proguard:tested_apk_i nfo)", |
1558 "--input-paths=@FileArg($_rebased_build_config:proguard:input_paths)", | 1567 "--input-paths=@FileArg($_rebased_build_config:proguard:input_paths)", |
1559 ] | 1568 ] |
1569 if (defined(invoker.alternative_android_sdk_jar)) { | |
agrieve
2015/12/30 15:12:16
nit: use forward_variables_from()
michaelbai
2015/12/30 18:54:15
Done.
| |
1570 alternative_android_sdk_jar = invoker.alternative_android_sdk_jar | |
1571 } | |
1560 } | 1572 } |
1561 _dex_sources = [ _proguard_jar_path ] | 1573 _dex_sources = [ _proguard_jar_path ] |
1562 _dex_deps = [ ":$_proguard_target" ] | 1574 _dex_deps = [ ":$_proguard_target" ] |
1563 } else { | 1575 } else { |
1564 if (enable_multidex) { | 1576 if (enable_multidex) { |
1565 _dex_sources = [ _jar_path ] | 1577 _dex_sources = [ _jar_path ] |
1566 } else { | 1578 } else { |
1567 _dex_sources = [ _lib_dex_path ] | 1579 _dex_sources = [ _lib_dex_path ] |
1568 } | 1580 } |
1569 _dex_deps = [ ":$java_target" ] | 1581 _dex_deps = [ ":$java_target" ] |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1662 } | 1674 } |
1663 if (defined(invoker.loadable_modules) && invoker.loadable_modules != []) { | 1675 if (defined(invoker.loadable_modules) && invoker.loadable_modules != []) { |
1664 _extra_native_libs_even_when_incremental += invoker.loadable_modules | 1676 _extra_native_libs_even_when_incremental += invoker.loadable_modules |
1665 } | 1677 } |
1666 | 1678 |
1667 _final_deps += [ ":${_template_name}__create" ] | 1679 _final_deps += [ ":${_template_name}__create" ] |
1668 create_apk("${_template_name}__create") { | 1680 create_apk("${_template_name}__create") { |
1669 deps = [] | 1681 deps = [] |
1670 forward_variables_from(invoker, | 1682 forward_variables_from(invoker, |
1671 [ | 1683 [ |
1684 "android_aapt_path", | |
1685 "app_as_shared_lib", | |
1672 "deps", | 1686 "deps", |
1673 "extensions_to_not_compress", | 1687 "extensions_to_not_compress", |
1674 "language_splits", | 1688 "language_splits", |
1675 "public_deps", | 1689 "public_deps", |
1676 "shared_resources", | 1690 "shared_resources", |
1677 "write_asset_list", | 1691 "write_asset_list", |
1678 ]) | 1692 ]) |
1679 apk_path = _final_apk_path | 1693 apk_path = _final_apk_path |
1680 android_manifest = _android_manifest | 1694 android_manifest = _android_manifest |
1681 assets_build_config = _build_config | 1695 assets_build_config = _build_config |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1754 | 1768 |
1755 keystore_name = _keystore_name | 1769 keystore_name = _keystore_name |
1756 keystore_path = _keystore_path | 1770 keystore_path = _keystore_path |
1757 keystore_password = _keystore_password | 1771 keystore_password = _keystore_password |
1758 | 1772 |
1759 # Placeholders necessary for some older devices. | 1773 # Placeholders necessary for some older devices. |
1760 # http://crbug.com/395038 | 1774 # http://crbug.com/395038 |
1761 deps = [] | 1775 deps = [] |
1762 forward_variables_from(invoker, | 1776 forward_variables_from(invoker, |
1763 [ | 1777 [ |
1778 "android_aapt_path", | |
1764 "deps", | 1779 "deps", |
1765 "native_lib_placeholders", | 1780 "native_lib_placeholders", |
1766 "public_deps", | 1781 "public_deps", |
1767 ]) | 1782 ]) |
1768 | 1783 |
1769 incremental_deps = deps + _extra_native_libs_even_when_incremental_deps + | 1784 incremental_deps = deps + _extra_native_libs_even_when_incremental_deps + |
1770 [ ":$_manifest_rule" ] | 1785 [ ":$_manifest_rule" ] |
1771 deps = [] | 1786 deps = [] |
1772 deps = incremental_deps + _native_libs_deps + _extra_native_libs_deps + | 1787 deps = incremental_deps + _native_libs_deps + _extra_native_libs_deps + |
1773 [ _native_libs_file_arg_dep ] | 1788 [ _native_libs_file_arg_dep ] |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2235 } | 2250 } |
2236 | 2251 |
2237 android_library(target_name) { | 2252 android_library(target_name) { |
2238 java_files = [] | 2253 java_files = [] |
2239 srcjar_deps = [ ":${_template_name}__protoc_java" ] | 2254 srcjar_deps = [ ":${_template_name}__protoc_java" ] |
2240 deps = [ | 2255 deps = [ |
2241 "//third_party/android_protobuf:protobuf_nano_javalib", | 2256 "//third_party/android_protobuf:protobuf_nano_javalib", |
2242 ] | 2257 ] |
2243 } | 2258 } |
2244 } | 2259 } |
OLD | NEW |