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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 } | 673 } |
674 | 674 |
675 group(final_target_name) { | 675 group(final_target_name) { |
676 forward_variables_from(invoker, [ "visibility" ]) | 676 forward_variables_from(invoker, [ "visibility" ]) |
677 public_deps = [ | 677 public_deps = [ |
678 ":${target_name}__process_resources", | 678 ":${target_name}__process_resources", |
679 ] | 679 ] |
680 } | 680 } |
681 } | 681 } |
682 | 682 |
| 683 # Declare an Android assets target. |
| 684 # |
| 685 # Defines a set of files to include as assets in a dependent apk. |
| 686 # |
| 687 # To include these assets in an apk, this target should be listed in |
| 688 # the apk's deps, or in the deps of a library target used by an apk. |
| 689 # |
| 690 # Variables |
| 691 # deps: Specifies the dependencies of this target. Any Android assets |
| 692 # listed in deps will be included by libraries/apks that depend on this |
| 693 # target. |
| 694 # sources: List of files to include as assets. |
| 695 # outputs: NOT YET IMPLEMENTED - List of asset paths to use for the assets |
| 696 # (refer to semantics of copy()). |
| 697 # disable_compression: Whether to diesable compression for files that are |
| 698 # known to be compressable (default: false). |
| 699 # |
| 700 # Example: |
| 701 # android_assets("content_shell_assets") { |
| 702 # deps = [ |
| 703 # ":generates_foo", |
| 704 # ":other_assets", |
| 705 # ] |
| 706 # sources = [ |
| 707 # "$target_gen_dir/foo.dat", |
| 708 # ] |
| 709 # } |
| 710 template("android_assets") { |
| 711 set_sources_assignment_filter([]) |
| 712 forward_variables_from(invoker, [ "testonly" ]) |
| 713 |
| 714 assert(!defined(invoker.outputs), "TODO: Add support for output paths") |
| 715 |
| 716 _build_config = "$target_gen_dir/$target_name.build_config" |
| 717 _build_config_target_name = "${target_name}__build_config" |
| 718 |
| 719 write_build_config(_build_config_target_name) { |
| 720 forward_variables_from(invoker, |
| 721 [ |
| 722 "deps", |
| 723 "disable_compression", |
| 724 ]) |
| 725 type = "android_assets" |
| 726 build_config = _build_config |
| 727 assets = invoker.sources |
| 728 } |
| 729 |
| 730 group(target_name) { |
| 731 forward_variables_from(invoker, [ "visibility" ]) |
| 732 if (invoker.sources != []) { |
| 733 public_deps = [ |
| 734 ":$_build_config_target_name", |
| 735 ] |
| 736 } |
| 737 } |
| 738 } |
| 739 |
683 # Declare a target that generates localized strings.xml from a .grd file. | 740 # Declare a target that generates localized strings.xml from a .grd file. |
684 # | 741 # |
685 # If this target is included in the deps of an android resources/library/apk, | 742 # If this target is included in the deps of an android resources/library/apk, |
686 # the strings.xml will be included with that target. | 743 # the strings.xml will be included with that target. |
687 # | 744 # |
688 # Variables | 745 # Variables |
689 # deps: Specifies the dependencies of this target. | 746 # deps: Specifies the dependencies of this target. |
690 # grd_file: Path to the .grd file to generate strings.xml from. | 747 # grd_file: Path to the .grd file to generate strings.xml from. |
691 # outputs: Expected grit outputs (see grit rule). | 748 # outputs: Expected grit outputs (see grit rule). |
692 # | 749 # |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1513 deps = [] | 1570 deps = [] |
1514 forward_variables_from(invoker, | 1571 forward_variables_from(invoker, |
1515 [ | 1572 [ |
1516 "asset_location", | 1573 "asset_location", |
1517 "deps", | 1574 "deps", |
1518 "extensions_to_not_compress", | 1575 "extensions_to_not_compress", |
1519 "language_splits", | 1576 "language_splits", |
1520 ]) | 1577 ]) |
1521 apk_path = _final_apk_path | 1578 apk_path = _final_apk_path |
1522 android_manifest = _android_manifest | 1579 android_manifest = _android_manifest |
| 1580 assets_build_config = _build_config |
1523 resources_zip = _all_resources_zip_path | 1581 resources_zip = _all_resources_zip_path |
1524 dex_path = final_dex_path | 1582 dex_path = final_dex_path |
1525 load_library_from_apk = _load_library_from_apk | 1583 load_library_from_apk = _load_library_from_apk |
1526 create_density_splits = _create_density_splits | 1584 create_density_splits = _create_density_splits |
1527 | 1585 |
1528 if (!defined(extensions_to_not_compress)) { | 1586 if (!defined(extensions_to_not_compress)) { |
1529 # Allow icu data, v8 snapshots, and pak files to be loaded directly from | 1587 # Allow icu data, v8 snapshots, and pak files to be loaded directly from |
1530 # the .apk. | 1588 # the .apk. |
1531 # Note: These are actually suffix matches, not necessarily extensions. | 1589 # Note: These are actually suffix matches, not necessarily extensions. |
1532 extensions_to_not_compress = ".dat,.bin,.pak" | 1590 extensions_to_not_compress = ".dat,.bin,.pak" |
1533 } | 1591 } |
1534 | 1592 |
1535 version_code = _version_code | 1593 version_code = _version_code |
1536 version_name = _version_name | 1594 version_name = _version_name |
1537 | 1595 |
1538 keystore_name = _keystore_name | 1596 keystore_name = _keystore_name |
1539 keystore_path = _keystore_path | 1597 keystore_path = _keystore_path |
1540 keystore_password = _keystore_password | 1598 keystore_password = _keystore_password |
1541 | 1599 |
1542 # Incremental apk does not use native libs nor final dex. | 1600 # Incremental apk does not use native libs nor final dex. |
1543 incremental_deps = | 1601 incremental_deps = deps + _android_manifest_deps + [ |
1544 deps + _android_manifest_deps + [ ":$process_resources_target" ] | 1602 ":$build_config_target", |
| 1603 ":$process_resources_target", |
| 1604 ] |
1545 | 1605 |
1546 # This target generates the input file _all_resources_zip_path. | 1606 # This target generates the input file _all_resources_zip_path. |
1547 deps += _android_manifest_deps + [ | 1607 deps += _android_manifest_deps + [ |
| 1608 ":$build_config_target", |
1548 ":$process_resources_target", | 1609 ":$process_resources_target", |
1549 ":$final_dex_target_name", | 1610 ":$final_dex_target_name", |
1550 ] | 1611 ] |
1551 | 1612 |
1552 if (_native_libs != [] && !_create_abi_split) { | 1613 if (_native_libs != [] && !_create_abi_split) { |
1553 native_libs_dir = _native_libs_dir | 1614 native_libs_dir = _native_libs_dir |
1554 deps += [ ":$_prepare_native_target_name" ] | 1615 deps += [ ":$_prepare_native_target_name" ] |
1555 } | 1616 } |
1556 } | 1617 } |
1557 | 1618 |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2035 } | 2096 } |
2036 | 2097 |
2037 android_library(target_name) { | 2098 android_library(target_name) { |
2038 java_files = [] | 2099 java_files = [] |
2039 srcjar_deps = [ ":${_template_name}__protoc_java" ] | 2100 srcjar_deps = [ ":${_template_name}__protoc_java" ] |
2040 deps = [ | 2101 deps = [ |
2041 "//third_party/android_protobuf:protobuf_nano_javalib", | 2102 "//third_party/android_protobuf:protobuf_nano_javalib", |
2042 ] | 2103 ] |
2043 } | 2104 } |
2044 } | 2105 } |
OLD | NEW |