| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 # TODO(cjhopman): #includes should probably all be relative to | 77 # TODO(cjhopman): #includes should probably all be relative to |
| 78 # base_output_dir. Remove that from this config once the includes are | 78 # base_output_dir. Remove that from this config once the includes are |
| 79 # updated. | 79 # updated. |
| 80 include_dirs = [ | 80 include_dirs = [ |
| 81 base_output_dir, | 81 base_output_dir, |
| 82 package_output_dir, | 82 package_output_dir, |
| 83 ] | 83 ] |
| 84 } | 84 } |
| 85 | 85 |
| 86 group(target_name) { | 86 group(target_name) { |
| 87 deps = [] | 87 public_deps = [] |
| 88 forward_variables_from(invoker, | 88 forward_variables_from(invoker, |
| 89 [ | 89 [ |
| 90 "deps", | 90 "deps", |
| 91 "public_deps", | 91 "public_deps", |
| 92 "visibility", | 92 "visibility", |
| 93 ]) | 93 ]) |
| 94 deps += [ ":$foreach_target_name" ] | 94 public_deps += [ ":$foreach_target_name" ] |
| 95 public_configs = [ ":jni_includes_${target_name}" ] | 95 public_configs = [ ":jni_includes_${target_name}" ] |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 | 98 |
| 99 # Declare a jni target for a prebuilt jar | 99 # Declare a jni target for a prebuilt jar |
| 100 # | 100 # |
| 101 # This target generates the native jni bindings for a set of classes in a .jar. | 101 # This target generates the native jni bindings for a set of classes in a .jar. |
| 102 # | 102 # |
| 103 # See base/android/jni_generator/jni_generator.py for more info about the | 103 # See base/android/jni_generator/jni_generator.py for more info about the |
| 104 # format of generating JNI bindings. | 104 # format of generating JNI bindings. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 "--native_exports_optional", | 176 "--native_exports_optional", |
| 177 ] | 177 ] |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 config("jni_includes_${target_name}") { | 181 config("jni_includes_${target_name}") { |
| 182 include_dirs = [ base_output_dir ] | 182 include_dirs = [ base_output_dir ] |
| 183 } | 183 } |
| 184 | 184 |
| 185 group(target_name) { | 185 group(target_name) { |
| 186 deps = [] | 186 public_deps = [] |
| 187 forward_variables_from(invoker, | 187 forward_variables_from(invoker, |
| 188 [ | 188 [ |
| 189 "deps", | 189 "deps", |
| 190 "public_deps", | 190 "public_deps", |
| 191 "visibility", | 191 "visibility", |
| 192 ]) | 192 ]) |
| 193 deps += jni_actions | 193 public_deps += jni_actions |
| 194 public_configs = [ ":jni_includes_${target_name}" ] | 194 public_configs = [ ":jni_includes_${target_name}" ] |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 # Declare a target for c-preprocessor-generated java files | 198 # Declare a target for c-preprocessor-generated java files |
| 199 # | 199 # |
| 200 # NOTE: For generating Java conterparts to enums prefer using the java_cpp_enum | 200 # NOTE: For generating Java conterparts to enums prefer using the java_cpp_enum |
| 201 # rule instead. | 201 # rule instead. |
| 202 # | 202 # |
| 203 # This target generates java files using the host C pre-processor. Each file in | 203 # This target generates java files using the host C pre-processor. Each file in |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 inputs = apply_gcc_outputs | 301 inputs = apply_gcc_outputs |
| 302 output = srcjar_path | 302 output = srcjar_path |
| 303 base_dir = base_gen_dir | 303 base_dir = base_gen_dir |
| 304 deps = [ | 304 deps = [ |
| 305 ":$apply_gcc_target_name", | 305 ":$apply_gcc_target_name", |
| 306 ] | 306 ] |
| 307 } | 307 } |
| 308 | 308 |
| 309 group(final_target_name) { | 309 group(final_target_name) { |
| 310 forward_variables_from(invoker, [ "visibility" ]) | 310 forward_variables_from(invoker, [ "visibility" ]) |
| 311 deps = [ | 311 public_deps = [ |
| 312 ":$zip_srcjar_target_name", | 312 ":$zip_srcjar_target_name", |
| 313 ] | 313 ] |
| 314 } | 314 } |
| 315 } | 315 } |
| 316 | 316 |
| 317 # Declare a target for generating Java classes from C++ enums. | 317 # Declare a target for generating Java classes from C++ enums. |
| 318 # | 318 # |
| 319 # This target generates Java files from C++ enums using a script. | 319 # This target generates Java files from C++ enums using a script. |
| 320 # | 320 # |
| 321 # This target will create a single .srcjar. Adding this target to an | 321 # This target will create a single .srcjar. Adding this target to an |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 inputs = generate_enum_outputs | 384 inputs = generate_enum_outputs |
| 385 output = srcjar_path | 385 output = srcjar_path |
| 386 base_dir = base_gen_dir | 386 base_dir = base_gen_dir |
| 387 deps = [ | 387 deps = [ |
| 388 ":$generate_enum_target_name", | 388 ":$generate_enum_target_name", |
| 389 ] | 389 ] |
| 390 } | 390 } |
| 391 | 391 |
| 392 group(final_target_name) { | 392 group(final_target_name) { |
| 393 forward_variables_from(invoker, [ "visibility" ]) | 393 forward_variables_from(invoker, [ "visibility" ]) |
| 394 deps = [ | 394 public_deps = [ |
| 395 ":$zip_srcjar_target_name", | 395 ":$zip_srcjar_target_name", |
| 396 ] | 396 ] |
| 397 } | 397 } |
| 398 } | 398 } |
| 399 | 399 |
| 400 # Declare a target for processing a Jinja template. | 400 # Declare a target for processing a Jinja template. |
| 401 # | 401 # |
| 402 # Variables | 402 # Variables |
| 403 # input: The template file to be processed. | 403 # input: The template file to be processed. |
| 404 # output: Where to save the result. | 404 # output: Where to save the result. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 "--depfile", | 504 "--depfile", |
| 505 rebase_path(depfile, root_build_dir), | 505 rebase_path(depfile, root_build_dir), |
| 506 ] | 506 ] |
| 507 if (defined(invoker.variables)) { | 507 if (defined(invoker.variables)) { |
| 508 variables = invoker.variables | 508 variables = invoker.variables |
| 509 args += [ "--variables=${variables}" ] | 509 args += [ "--variables=${variables}" ] |
| 510 } | 510 } |
| 511 } | 511 } |
| 512 | 512 |
| 513 group(target_name) { | 513 group(target_name) { |
| 514 deps = [ | 514 public_deps = [ |
| 515 ":${target_name}__build_config", | 515 ":${target_name}__build_config", |
| 516 ":${target_name}__template", | 516 ":${target_name}__template", |
| 517 ] | 517 ] |
| 518 } | 518 } |
| 519 } | 519 } |
| 520 | 520 |
| 521 # Creates a resources.zip with locale.pak files placed into appropriate | 521 # Creates a resources.zip with locale.pak files placed into appropriate |
| 522 # resource configs (e.g. en-GB.pak -> res/raw-en/en_gb.pak). Also generates | 522 # resource configs (e.g. en-GB.pak -> res/raw-en/en_gb.pak). Also generates |
| 523 # a locale_paks TypedArray so that resource files can be enumerated at runtime. | 523 # a locale_paks TypedArray so that resource files can be enumerated at runtime. |
| 524 # | 524 # |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 args = [ | 567 args = [ |
| 568 "--locale-paks=${_rebased_sources}", | 568 "--locale-paks=${_rebased_sources}", |
| 569 "--resources-zip", | 569 "--resources-zip", |
| 570 rebase_path(_resources_zip, root_build_dir), | 570 rebase_path(_resources_zip, root_build_dir), |
| 571 "--depfile", | 571 "--depfile", |
| 572 rebase_path(depfile, root_build_dir), | 572 rebase_path(depfile, root_build_dir), |
| 573 ] | 573 ] |
| 574 } | 574 } |
| 575 | 575 |
| 576 group(target_name) { | 576 group(target_name) { |
| 577 deps = [ | 577 public_deps = [ |
| 578 ":${target_name}__build_config", | 578 ":${target_name}__build_config", |
| 579 ":${target_name}__create_resources_zip", | 579 ":${target_name}__create_resources_zip", |
| 580 ] | 580 ] |
| 581 } | 581 } |
| 582 } | 582 } |
| 583 | 583 |
| 584 # Declare an Android resources target | 584 # Declare an Android resources target |
| 585 # | 585 # |
| 586 # This creates a resources zip file that will be used when building an Android | 586 # This creates a resources zip file that will be used when building an Android |
| 587 # library or apk and included into a final apk. | 587 # library or apk and included into a final apk. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 "v14_skip", | 667 "v14_skip", |
| 668 ]) | 668 ]) |
| 669 deps += [ ":$build_config_target_name" ] | 669 deps += [ ":$build_config_target_name" ] |
| 670 if (!defined(android_manifest)) { | 670 if (!defined(android_manifest)) { |
| 671 android_manifest = "//build/android/AndroidManifest.xml" | 671 android_manifest = "//build/android/AndroidManifest.xml" |
| 672 } | 672 } |
| 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 deps = [ | 677 public_deps = [ |
| 678 ":${target_name}__process_resources", | 678 ":${target_name}__process_resources", |
| 679 ] | 679 ] |
| 680 } | 680 } |
| 681 } | 681 } |
| 682 | 682 |
| 683 # Declare a target that generates localized strings.xml from a .grd file. | 683 # Declare a target that generates localized strings.xml from a .grd file. |
| 684 # | 684 # |
| 685 # If this target is included in the deps of an android resources/library/apk, | 685 # If this target is included in the deps of an android resources/library/apk, |
| 686 # the strings.xml will be included with that target. | 686 # the strings.xml will be included with that target. |
| 687 # | 687 # |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 zip("${target_name}__zip") { | 730 zip("${target_name}__zip") { |
| 731 base_dir = grit_output_dir | 731 base_dir = grit_output_dir |
| 732 inputs = generate_strings_outputs | 732 inputs = generate_strings_outputs |
| 733 output = resources_zip | 733 output = resources_zip |
| 734 deps = [ | 734 deps = [ |
| 735 ":$grit_target_name", | 735 ":$grit_target_name", |
| 736 ] | 736 ] |
| 737 } | 737 } |
| 738 | 738 |
| 739 group(target_name) { | 739 group(target_name) { |
| 740 deps = [ | 740 public_deps = [ |
| 741 ":${target_name}__build_config", | 741 ":${target_name}__build_config", |
| 742 ":${target_name}__zip", | 742 ":${target_name}__zip", |
| 743 ] | 743 ] |
| 744 } | 744 } |
| 745 } | 745 } |
| 746 | 746 |
| 747 # Declare a target that packages strings.xml generated from a grd file. | 747 # Declare a target that packages strings.xml generated from a grd file. |
| 748 # | 748 # |
| 749 # If this target is included in the deps of an android resources/library/apk, | 749 # If this target is included in the deps of an android resources/library/apk, |
| 750 # the strings.xml will be included with that target. | 750 # the strings.xml will be included with that target. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 deps = [ | 786 deps = [ |
| 787 ":$build_config_target_name", | 787 ":$build_config_target_name", |
| 788 ] | 788 ] |
| 789 if (defined(invoker.deps)) { | 789 if (defined(invoker.deps)) { |
| 790 deps += invoker.deps | 790 deps += invoker.deps |
| 791 } | 791 } |
| 792 } | 792 } |
| 793 | 793 |
| 794 group(final_target_name) { | 794 group(final_target_name) { |
| 795 forward_variables_from(invoker, [ "visibility" ]) | 795 forward_variables_from(invoker, [ "visibility" ]) |
| 796 deps = [ | 796 public_deps = [ |
| 797 ":$zip_target_name", | 797 ":$zip_target_name", |
| 798 ] | 798 ] |
| 799 } | 799 } |
| 800 } | 800 } |
| 801 | 801 |
| 802 # Declare a Java executable target | 802 # Declare a Java executable target |
| 803 # | 803 # |
| 804 # This target creates an executable from java code and libraries. The executable | 804 # This target creates an executable from java code and libraries. The executable |
| 805 # will be in the output folder's /bin/ directory. | 805 # will be in the output folder's /bin/ directory. |
| 806 # | 806 # |
| (...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1635 if (_create_density_splits) { | 1635 if (_create_density_splits) { |
| 1636 args += [ "--split=${_rebased_apk_path_no_ext}-density-*.apk" ] | 1636 args += [ "--split=${_rebased_apk_path_no_ext}-density-*.apk" ] |
| 1637 } | 1637 } |
| 1638 if (_create_language_splits) { | 1638 if (_create_language_splits) { |
| 1639 args += [ "--split=${_rebased_apk_path_no_ext}-language-*.apk" ] | 1639 args += [ "--split=${_rebased_apk_path_no_ext}-language-*.apk" ] |
| 1640 } | 1640 } |
| 1641 } | 1641 } |
| 1642 | 1642 |
| 1643 group(target_name) { | 1643 group(target_name) { |
| 1644 forward_variables_from(invoker, [ "data_deps" ]) | 1644 forward_variables_from(invoker, [ "data_deps" ]) |
| 1645 deps = _final_deps | 1645 public_deps = _final_deps |
| 1646 } | 1646 } |
| 1647 group("${target_name}_incremental") { | 1647 group("${target_name}_incremental") { |
| 1648 data_deps = [] | 1648 data_deps = [] |
| 1649 forward_variables_from(invoker, [ "data_deps" ]) | 1649 forward_variables_from(invoker, [ "data_deps" ]) |
| 1650 data_deps += [ "//build/android/pylib/device/commands" ] | 1650 data_deps += [ "//build/android/pylib/device/commands" ] |
| 1651 deps = _incremental_final_deps | 1651 public_deps = _incremental_final_deps |
| 1652 } | 1652 } |
| 1653 } | 1653 } |
| 1654 | 1654 |
| 1655 # Declare an Android instrumentation test apk | 1655 # Declare an Android instrumentation test apk |
| 1656 # | 1656 # |
| 1657 # This target creates an Android instrumentation test apk. | 1657 # This target creates an Android instrumentation test apk. |
| 1658 # | 1658 # |
| 1659 # Variables | 1659 # Variables |
| 1660 # android_manifest: Path to AndroidManifest.xml. | 1660 # android_manifest: Path to AndroidManifest.xml. |
| 1661 # data_deps: List of dependencies needed at runtime. These will be built but | 1661 # data_deps: List of dependencies needed at runtime. These will be built but |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1959 deps = [ | 1959 deps = [ |
| 1960 ":$find_deps_target_name", | 1960 ":$find_deps_target_name", |
| 1961 ] | 1961 ] |
| 1962 if (defined(invoker.deps)) { | 1962 if (defined(invoker.deps)) { |
| 1963 deps += invoker.deps | 1963 deps += invoker.deps |
| 1964 } | 1964 } |
| 1965 } | 1965 } |
| 1966 | 1966 |
| 1967 group(template_name) { | 1967 group(template_name) { |
| 1968 forward_variables_from(invoker, [ "visibility" ]) | 1968 forward_variables_from(invoker, [ "visibility" ]) |
| 1969 deps = [ | 1969 public_deps = [ |
| 1970 ":$copy_target_name", | 1970 ":$copy_target_name", |
| 1971 ] | 1971 ] |
| 1972 } | 1972 } |
| 1973 } | 1973 } |
| 1974 | 1974 |
| 1975 # Compile a protocol buffer to java. | 1975 # Compile a protocol buffer to java. |
| 1976 # | 1976 # |
| 1977 # This generates java files from protocol buffers and creates an Android library | 1977 # This generates java files from protocol buffers and creates an Android library |
| 1978 # containing the classes. | 1978 # containing the classes. |
| 1979 # | 1979 # |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2031 | 2031 |
| 2032 # TODO(GYP): implement this. | 2032 # TODO(GYP): implement this. |
| 2033 template("uiautomator_test") { | 2033 template("uiautomator_test") { |
| 2034 set_sources_assignment_filter([]) | 2034 set_sources_assignment_filter([]) |
| 2035 forward_variables_from(invoker, [ "testonly" ]) | 2035 forward_variables_from(invoker, [ "testonly" ]) |
| 2036 assert(target_name != "") | 2036 assert(target_name != "") |
| 2037 assert(invoker.deps != [] || true) | 2037 assert(invoker.deps != [] || true) |
| 2038 group(target_name) { | 2038 group(target_name) { |
| 2039 } | 2039 } |
| 2040 } | 2040 } |
| OLD | NEW |