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("//tools/grit/grit_rule.gni") | 8 import("//tools/grit/grit_rule.gni") |
9 import("//tools/relocation_packer/config.gni") | 9 import("//tools/relocation_packer/config.gni") |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 # | 23 # |
24 # Example | 24 # Example |
25 # generate_jni("foo_jni") { | 25 # generate_jni("foo_jni") { |
26 # sources = [ | 26 # sources = [ |
27 # "android/java/src/org/chromium/foo/Foo.java", | 27 # "android/java/src/org/chromium/foo/Foo.java", |
28 # "android/java/src/org/chromium/foo/FooUtil.java", | 28 # "android/java/src/org/chromium/foo/FooUtil.java", |
29 # ] | 29 # ] |
30 # jni_package = "foo" | 30 # jni_package = "foo" |
31 # } | 31 # } |
32 template("generate_jni") { | 32 template("generate_jni") { |
| 33 set_sources_assignment_filter([]) |
33 if (defined(invoker.testonly)) { | 34 if (defined(invoker.testonly)) { |
34 testonly = invoker.testonly | 35 testonly = invoker.testonly |
35 } | 36 } |
36 | 37 |
37 assert(defined(invoker.sources)) | 38 assert(defined(invoker.sources)) |
38 assert(defined(invoker.jni_package)) | 39 assert(defined(invoker.jni_package)) |
39 jni_package = invoker.jni_package | 40 jni_package = invoker.jni_package |
40 base_output_dir = "${target_gen_dir}/${target_name}" | 41 base_output_dir = "${target_gen_dir}/${target_name}" |
41 package_output_dir = "${base_output_dir}/${jni_package}" | 42 package_output_dir = "${base_output_dir}/${jni_package}" |
42 jni_output_dir = "${package_output_dir}/jni" | 43 jni_output_dir = "${package_output_dir}/jni" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 # deps, public_deps: As normal | 122 # deps, public_deps: As normal |
122 # | 123 # |
123 # Example | 124 # Example |
124 # generate_jar_jni("foo_jni") { | 125 # generate_jar_jni("foo_jni") { |
125 # classes = [ | 126 # classes = [ |
126 # "android/view/Foo.class", | 127 # "android/view/Foo.class", |
127 # ] | 128 # ] |
128 # jni_package = "foo" | 129 # jni_package = "foo" |
129 # } | 130 # } |
130 template("generate_jar_jni") { | 131 template("generate_jar_jni") { |
| 132 set_sources_assignment_filter([]) |
131 if (defined(invoker.testonly)) { | 133 if (defined(invoker.testonly)) { |
132 testonly = invoker.testonly | 134 testonly = invoker.testonly |
133 } | 135 } |
134 | 136 |
135 assert(defined(invoker.classes)) | 137 assert(defined(invoker.classes)) |
136 assert(defined(invoker.jni_package)) | 138 assert(defined(invoker.jni_package)) |
137 | 139 |
138 if (defined(invoker.jar_file)) { | 140 if (defined(invoker.jar_file)) { |
139 jar_file = invoker.jar_file | 141 jar_file = invoker.jar_file |
140 } else { | 142 } else { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 # "android/java/templates/Foo.template", | 232 # "android/java/templates/Foo.template", |
231 # ] | 233 # ] |
232 # inputs = [ | 234 # inputs = [ |
233 # "android/java/templates/native_foo_header.h", | 235 # "android/java/templates/native_foo_header.h", |
234 # ] | 236 # ] |
235 # | 237 # |
236 # package_name = "org/chromium/base/library_loader" | 238 # package_name = "org/chromium/base/library_loader" |
237 # include_path = "android/java/templates" | 239 # include_path = "android/java/templates" |
238 # } | 240 # } |
239 template("java_cpp_template") { | 241 template("java_cpp_template") { |
| 242 set_sources_assignment_filter([]) |
240 if (defined(invoker.testonly)) { | 243 if (defined(invoker.testonly)) { |
241 testonly = invoker.testonly | 244 testonly = invoker.testonly |
242 } | 245 } |
243 | 246 |
244 assert(defined(invoker.sources)) | 247 assert(defined(invoker.sources)) |
245 package_name = invoker.package_name + "" | 248 package_name = invoker.package_name + "" |
246 | 249 |
247 if (defined(invoker.include_path)) { | 250 if (defined(invoker.include_path)) { |
248 include_path = invoker.include_path + "" | 251 include_path = invoker.include_path + "" |
249 } else { | 252 } else { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 # Example | 329 # Example |
327 # java_cpp_enum("foo_generated_enum") { | 330 # java_cpp_enum("foo_generated_enum") { |
328 # sources = [ | 331 # sources = [ |
329 # "src/native_foo_header.h", | 332 # "src/native_foo_header.h", |
330 # ] | 333 # ] |
331 # outputs = [ | 334 # outputs = [ |
332 # "org/chromium/FooEnum.java", | 335 # "org/chromium/FooEnum.java", |
333 # ] | 336 # ] |
334 # } | 337 # } |
335 template("java_cpp_enum") { | 338 template("java_cpp_enum") { |
| 339 set_sources_assignment_filter([]) |
336 if (defined(invoker.testonly)) { | 340 if (defined(invoker.testonly)) { |
337 testonly = invoker.testonly | 341 testonly = invoker.testonly |
338 } | 342 } |
339 | 343 |
340 assert(defined(invoker.sources)) | 344 assert(defined(invoker.sources)) |
341 assert(defined(invoker.outputs)) | 345 assert(defined(invoker.outputs)) |
342 | 346 |
343 action("${target_name}__generate_enum") { | 347 action("${target_name}__generate_enum") { |
344 sources = invoker.sources | 348 sources = invoker.sources |
345 script = "//build/android/gyp/java_cpp_enum.py" | 349 script = "//build/android/gyp/java_cpp_enum.py" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 # output: Where to save the result. | 389 # output: Where to save the result. |
386 # variables: (Optional) A list of variables to make available to the template | 390 # variables: (Optional) A list of variables to make available to the template |
387 # processing environment, e.g. ["name=foo", "color=red"]. | 391 # processing environment, e.g. ["name=foo", "color=red"]. |
388 # | 392 # |
389 # Example | 393 # Example |
390 # jinja_template("chrome_shell_manifest") { | 394 # jinja_template("chrome_shell_manifest") { |
391 # input = "shell/java/AndroidManifest.xml" | 395 # input = "shell/java/AndroidManifest.xml" |
392 # output = "$target_gen_dir/AndroidManifest.xml" | 396 # output = "$target_gen_dir/AndroidManifest.xml" |
393 # } | 397 # } |
394 template("jinja_template") { | 398 template("jinja_template") { |
| 399 set_sources_assignment_filter([]) |
395 if (defined(invoker.testonly)) { | 400 if (defined(invoker.testonly)) { |
396 testonly = invoker.testonly | 401 testonly = invoker.testonly |
397 } | 402 } |
398 | 403 |
399 assert(defined(invoker.input)) | 404 assert(defined(invoker.input)) |
400 assert(defined(invoker.output)) | 405 assert(defined(invoker.output)) |
401 | 406 |
402 action(target_name) { | 407 action(target_name) { |
403 sources = [ | 408 sources = [ |
404 invoker.input, | 409 invoker.input, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 # variables: (Optional) A list of variables to make available to the template | 446 # variables: (Optional) A list of variables to make available to the template |
442 # processing environment, e.g. ["name=foo", "color=red"]. | 447 # processing environment, e.g. ["name=foo", "color=red"]. |
443 # | 448 # |
444 # Example | 449 # Example |
445 # jinja_template_resources("chrome_shell_template_resources") { | 450 # jinja_template_resources("chrome_shell_template_resources") { |
446 # res_dir = "shell/res_template" | 451 # res_dir = "shell/res_template" |
447 # resources = ["shell/res_template/xml/syncable.xml"] | 452 # resources = ["shell/res_template/xml/syncable.xml"] |
448 # variables = ["color=red"] | 453 # variables = ["color=red"] |
449 # } | 454 # } |
450 template("jinja_template_resources") { | 455 template("jinja_template_resources") { |
| 456 set_sources_assignment_filter([]) |
451 if (defined(invoker.testonly)) { | 457 if (defined(invoker.testonly)) { |
452 testonly = invoker.testonly | 458 testonly = invoker.testonly |
453 } | 459 } |
454 | 460 |
455 assert(defined(invoker.resources)) | 461 assert(defined(invoker.resources)) |
456 assert(defined(invoker.res_dir)) | 462 assert(defined(invoker.res_dir)) |
457 | 463 |
458 _base_path = "$target_gen_dir/$target_name" | 464 _base_path = "$target_gen_dir/$target_name" |
459 _resources_zip = _base_path + ".resources.zip" | 465 _resources_zip = _base_path + ".resources.zip" |
460 _build_config = _base_path + ".build_config" | 466 _build_config = _base_path + ".build_config" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 # shared_resources: If true make a resource package that can be loaded by a | 529 # shared_resources: If true make a resource package that can be loaded by a |
524 # different application at runtime to access the package's resources. | 530 # different application at runtime to access the package's resources. |
525 # | 531 # |
526 # Example | 532 # Example |
527 # android_resources("foo_resources") { | 533 # android_resources("foo_resources") { |
528 # deps = [":foo_strings_grd"] | 534 # deps = [":foo_strings_grd"] |
529 # resource_dirs = ["res"] | 535 # resource_dirs = ["res"] |
530 # custom_package = "org.chromium.foo" | 536 # custom_package = "org.chromium.foo" |
531 # } | 537 # } |
532 template("android_resources") { | 538 template("android_resources") { |
| 539 set_sources_assignment_filter([]) |
533 if (defined(invoker.testonly)) { | 540 if (defined(invoker.testonly)) { |
534 testonly = invoker.testonly | 541 testonly = invoker.testonly |
535 } | 542 } |
536 | 543 |
537 assert(defined(invoker.resource_dirs)) | 544 assert(defined(invoker.resource_dirs)) |
538 assert(defined(invoker.android_manifest) || defined(invoker.custom_package)) | 545 assert(defined(invoker.android_manifest) || defined(invoker.custom_package)) |
539 | 546 |
540 base_path = "$target_gen_dir/$target_name" | 547 base_path = "$target_gen_dir/$target_name" |
541 zip_path = base_path + ".resources.zip" | 548 zip_path = base_path + ".resources.zip" |
542 srcjar_path = base_path + ".srcjar" | 549 srcjar_path = base_path + ".srcjar" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 # Variables | 600 # Variables |
594 # deps: Specifies the dependencies of this target. | 601 # deps: Specifies the dependencies of this target. |
595 # grd_file: Path to the .grd file to generate strings.xml from. | 602 # grd_file: Path to the .grd file to generate strings.xml from. |
596 # outputs: Expected grit outputs (see grit rule). | 603 # outputs: Expected grit outputs (see grit rule). |
597 # | 604 # |
598 # Example | 605 # Example |
599 # java_strings_grd("foo_strings_grd") { | 606 # java_strings_grd("foo_strings_grd") { |
600 # grd_file = "foo_strings.grd" | 607 # grd_file = "foo_strings.grd" |
601 # } | 608 # } |
602 template("java_strings_grd") { | 609 template("java_strings_grd") { |
| 610 set_sources_assignment_filter([]) |
603 if (defined(invoker.testonly)) { | 611 if (defined(invoker.testonly)) { |
604 testonly = invoker.testonly | 612 testonly = invoker.testonly |
605 } | 613 } |
606 | 614 |
607 base_path = "$target_gen_dir/$target_name" | 615 base_path = "$target_gen_dir/$target_name" |
608 resources_zip = base_path + ".resources.zip" | 616 resources_zip = base_path + ".resources.zip" |
609 build_config = base_path + ".build_config" | 617 build_config = base_path + ".build_config" |
610 | 618 |
611 write_build_config("${target_name}__build_config") { | 619 write_build_config("${target_name}__build_config") { |
612 type = "android_resources" | 620 type = "android_resources" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 # generated_files: list of android resource files to package. | 667 # generated_files: list of android resource files to package. |
660 # | 668 # |
661 # Example | 669 # Example |
662 # java_strings_grd_prebuilt("foo_strings_grd") { | 670 # java_strings_grd_prebuilt("foo_strings_grd") { |
663 # grit_output_dir = "$root_gen_dir/foo/grit" | 671 # grit_output_dir = "$root_gen_dir/foo/grit" |
664 # generated_files = [ | 672 # generated_files = [ |
665 # "values/strings.xml" | 673 # "values/strings.xml" |
666 # ] | 674 # ] |
667 # } | 675 # } |
668 template("java_strings_grd_prebuilt") { | 676 template("java_strings_grd_prebuilt") { |
| 677 set_sources_assignment_filter([]) |
669 if (defined(invoker.testonly)) { | 678 if (defined(invoker.testonly)) { |
670 testonly = invoker.testonly | 679 testonly = invoker.testonly |
671 } | 680 } |
672 | 681 |
673 base_path = "$target_gen_dir/$target_name" | 682 base_path = "$target_gen_dir/$target_name" |
674 resources_zip = base_path + ".resources.zip" | 683 resources_zip = base_path + ".resources.zip" |
675 build_config = base_path + ".build_config" | 684 build_config = base_path + ".build_config" |
676 | 685 |
677 write_build_config("${target_name}__build_config") { | 686 write_build_config("${target_name}__build_config") { |
678 type = "android_resources" | 687 type = "android_resources" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 # | 727 # |
719 # datadeps, testonly | 728 # datadeps, testonly |
720 # | 729 # |
721 # Example | 730 # Example |
722 # java_library("foo") { | 731 # java_library("foo") { |
723 # java_files = [ "org/chromium/foo/FooMain.java" ] | 732 # java_files = [ "org/chromium/foo/FooMain.java" ] |
724 # deps = [ ":bar_java" ] | 733 # deps = [ ":bar_java" ] |
725 # main_class = "org.chromium.foo.FooMain" | 734 # main_class = "org.chromium.foo.FooMain" |
726 # } | 735 # } |
727 template("java_binary") { | 736 template("java_binary") { |
| 737 set_sources_assignment_filter([]) |
| 738 |
728 # TODO(cjhopman): This should not act like a java_library for dependents (i.e. | 739 # TODO(cjhopman): This should not act like a java_library for dependents (i.e. |
729 # dependents shouldn't get the jar in their classpath, etc.). | 740 # dependents shouldn't get the jar in their classpath, etc.). |
730 java_library_impl(target_name) { | 741 java_library_impl(target_name) { |
731 if (defined(invoker.DEPRECATED_java_in_dir)) { | 742 if (defined(invoker.DEPRECATED_java_in_dir)) { |
732 DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir | 743 DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir |
733 } | 744 } |
734 if (defined(invoker.chromium_code)) { | 745 if (defined(invoker.chromium_code)) { |
735 chromium_code = invoker.chromium_code | 746 chromium_code = invoker.chromium_code |
736 } | 747 } |
737 if (defined(invoker.datadeps)) { | 748 if (defined(invoker.datadeps)) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 # ":bar_java" | 814 # ":bar_java" |
804 # ] | 815 # ] |
805 # srcjar_deps = [ | 816 # srcjar_deps = [ |
806 # ":foo_generated_enum" | 817 # ":foo_generated_enum" |
807 # ] | 818 # ] |
808 # jar_excluded_patterns = [ | 819 # jar_excluded_patterns = [ |
809 # "*/FooService.class", "*/FooService##*.class" | 820 # "*/FooService.class", "*/FooService##*.class" |
810 # ] | 821 # ] |
811 # } | 822 # } |
812 template("java_library") { | 823 template("java_library") { |
| 824 set_sources_assignment_filter([]) |
813 java_library_impl(target_name) { | 825 java_library_impl(target_name) { |
814 if (defined(invoker.DEPRECATED_java_in_dir)) { | 826 if (defined(invoker.DEPRECATED_java_in_dir)) { |
815 DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir | 827 DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir |
816 } | 828 } |
817 if (defined(invoker.chromium_code)) { | 829 if (defined(invoker.chromium_code)) { |
818 chromium_code = invoker.chromium_code | 830 chromium_code = invoker.chromium_code |
819 } | 831 } |
820 if (defined(invoker.datadeps)) { | 832 if (defined(invoker.datadeps)) { |
821 deps = invoker.datadeps | 833 deps = invoker.datadeps |
822 } | 834 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 # | 881 # |
870 # Example | 882 # Example |
871 # java_prebuilt("foo_java") { | 883 # java_prebuilt("foo_java") { |
872 # jar_path = "foo.jar" | 884 # jar_path = "foo.jar" |
873 # deps = [ | 885 # deps = [ |
874 # ":foo_resources", | 886 # ":foo_resources", |
875 # ":bar_java" | 887 # ":bar_java" |
876 # ] | 888 # ] |
877 # } | 889 # } |
878 template("java_prebuilt") { | 890 template("java_prebuilt") { |
| 891 set_sources_assignment_filter([]) |
879 java_prebuilt_impl(target_name) { | 892 java_prebuilt_impl(target_name) { |
880 jar_path = invoker.jar_path | 893 jar_path = invoker.jar_path |
881 if (defined(invoker.testonly)) { | 894 if (defined(invoker.testonly)) { |
882 testonly = invoker.testonly | 895 testonly = invoker.testonly |
883 } | 896 } |
884 if (defined(invoker.deps)) { | 897 if (defined(invoker.deps)) { |
885 deps = invoker.deps | 898 deps = invoker.deps |
886 } | 899 } |
887 if (defined(invoker.proguard_config)) { | 900 if (defined(invoker.proguard_config)) { |
888 proguard_config = invoker.proguard_config | 901 proguard_config = invoker.proguard_config |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 # ":bar_java" | 948 # ":bar_java" |
936 # ] | 949 # ] |
937 # srcjar_deps = [ | 950 # srcjar_deps = [ |
938 # ":foo_generated_enum" | 951 # ":foo_generated_enum" |
939 # ] | 952 # ] |
940 # jar_excluded_patterns = [ | 953 # jar_excluded_patterns = [ |
941 # "*/FooService.class", "*/FooService##*.class" | 954 # "*/FooService.class", "*/FooService##*.class" |
942 # ] | 955 # ] |
943 # } | 956 # } |
944 template("android_library") { | 957 template("android_library") { |
| 958 set_sources_assignment_filter([]) |
945 assert(!defined(invoker.jar_path), | 959 assert(!defined(invoker.jar_path), |
946 "android_library does not support a custom jar path") | 960 "android_library does not support a custom jar path") |
947 java_library_impl(target_name) { | 961 java_library_impl(target_name) { |
948 if (defined(invoker.DEPRECATED_java_in_dir)) { | 962 if (defined(invoker.DEPRECATED_java_in_dir)) { |
949 DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir | 963 DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir |
950 } | 964 } |
951 if (defined(invoker.chromium_code)) { | 965 if (defined(invoker.chromium_code)) { |
952 chromium_code = invoker.chromium_code | 966 chromium_code = invoker.chromium_code |
953 } | 967 } |
954 if (defined(invoker.datadeps)) { | 968 if (defined(invoker.datadeps)) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 } | 1015 } |
1002 | 1016 |
1003 # Declare a target that packages a set of Java dependencies into a standalone | 1017 # Declare a target that packages a set of Java dependencies into a standalone |
1004 # .dex.jar. | 1018 # .dex.jar. |
1005 # | 1019 # |
1006 # Variables | 1020 # Variables |
1007 # deps: specifies the dependencies of this target. Android libraries in deps | 1021 # deps: specifies the dependencies of this target. Android libraries in deps |
1008 # will be packaged into the resulting .dex.jar file. | 1022 # will be packaged into the resulting .dex.jar file. |
1009 # dex_path: location at which the output file will be put | 1023 # dex_path: location at which the output file will be put |
1010 template("android_standalone_library") { | 1024 template("android_standalone_library") { |
| 1025 set_sources_assignment_filter([]) |
1011 deps_dex(target_name) { | 1026 deps_dex(target_name) { |
1012 deps = invoker.deps | 1027 deps = invoker.deps |
1013 dex_path = invoker.dex_path | 1028 dex_path = invoker.dex_path |
1014 } | 1029 } |
1015 } | 1030 } |
1016 | 1031 |
1017 # Declare an Android library target for a prebuilt jar | 1032 # Declare an Android library target for a prebuilt jar |
1018 # | 1033 # |
1019 # This target creates an Android library containing java code and Android | 1034 # This target creates an Android library containing java code and Android |
1020 # resources. | 1035 # resources. |
1021 # | 1036 # |
1022 # Variables | 1037 # Variables |
1023 # deps: Specifies the dependencies of this target. Java targets in this list | 1038 # deps: Specifies the dependencies of this target. Java targets in this list |
1024 # will be added to the javac classpath. Android resources in dependencies | 1039 # will be added to the javac classpath. Android resources in dependencies |
1025 # will be used when building this library. | 1040 # will be used when building this library. |
1026 # jar_path: Path to the prebuilt jar. | 1041 # jar_path: Path to the prebuilt jar. |
1027 # proguard_preprocess: If true, proguard preprocessing will be run. This can | 1042 # proguard_preprocess: If true, proguard preprocessing will be run. This can |
1028 # be used to remove unwanted parts of the library. | 1043 # be used to remove unwanted parts of the library. |
1029 # proguard_config: Path to the proguard config for preprocessing. | 1044 # proguard_config: Path to the proguard config for preprocessing. |
1030 # | 1045 # |
1031 # Example | 1046 # Example |
1032 # android_java_prebuilt("foo_java") { | 1047 # android_java_prebuilt("foo_java") { |
1033 # jar_path = "foo.jar" | 1048 # jar_path = "foo.jar" |
1034 # deps = [ | 1049 # deps = [ |
1035 # ":foo_resources", | 1050 # ":foo_resources", |
1036 # ":bar_java" | 1051 # ":bar_java" |
1037 # ] | 1052 # ] |
1038 # } | 1053 # } |
1039 template("android_java_prebuilt") { | 1054 template("android_java_prebuilt") { |
| 1055 set_sources_assignment_filter([]) |
1040 java_prebuilt_impl(target_name) { | 1056 java_prebuilt_impl(target_name) { |
1041 jar_path = invoker.jar_path | 1057 jar_path = invoker.jar_path |
1042 supports_android = true | 1058 supports_android = true |
1043 requires_android = true | 1059 requires_android = true |
1044 if (defined(invoker.testonly)) { | 1060 if (defined(invoker.testonly)) { |
1045 testonly = invoker.testonly | 1061 testonly = invoker.testonly |
1046 } | 1062 } |
1047 if (defined(invoker.deps)) { | 1063 if (defined(invoker.deps)) { |
1048 deps = invoker.deps | 1064 deps = invoker.deps |
1049 } | 1065 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 # ":foo_resources" | 1114 # ":foo_resources" |
1099 # ] | 1115 # ] |
1100 # srcjar_deps = [ | 1116 # srcjar_deps = [ |
1101 # ":foo_generated_enum" | 1117 # ":foo_generated_enum" |
1102 # ] | 1118 # ] |
1103 # native_libs = [ | 1119 # native_libs = [ |
1104 # native_lib_path | 1120 # native_lib_path |
1105 # ] | 1121 # ] |
1106 # } | 1122 # } |
1107 template("android_apk") { | 1123 template("android_apk") { |
| 1124 set_sources_assignment_filter([]) |
1108 if (defined(invoker.testonly)) { | 1125 if (defined(invoker.testonly)) { |
1109 testonly = invoker.testonly | 1126 testonly = invoker.testonly |
1110 } | 1127 } |
1111 | 1128 |
1112 assert(defined(invoker.final_apk_path) || defined(invoker.apk_name)) | 1129 assert(defined(invoker.final_apk_path) || defined(invoker.apk_name)) |
1113 gen_dir = "$target_gen_dir/$target_name" | 1130 gen_dir = "$target_gen_dir/$target_name" |
1114 base_path = "$gen_dir/$target_name" | 1131 base_path = "$gen_dir/$target_name" |
1115 _build_config = "$base_path.build_config" | 1132 _build_config = "$base_path.build_config" |
1116 resources_zip_path = "$base_path.resources.zip" | 1133 resources_zip_path = "$base_path.resources.zip" |
1117 all_resources_zip_path = "$base_path.resources.all.zip" | 1134 all_resources_zip_path = "$base_path.resources.all.zip" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1430 # support executables. | 1447 # support executables. |
1431 # apk_name: The name of the produced apk. If unspecified, it uses the name | 1448 # apk_name: The name of the produced apk. If unspecified, it uses the name |
1432 # of the unittests_dep target postfixed with "_apk" | 1449 # of the unittests_dep target postfixed with "_apk" |
1433 # | 1450 # |
1434 # Example | 1451 # Example |
1435 # unittest_apk("foo_unittests_apk") { | 1452 # unittest_apk("foo_unittests_apk") { |
1436 # deps = [ ":foo_java", ":foo_resources" ] | 1453 # deps = [ ":foo_java", ":foo_resources" ] |
1437 # unittests_dep = ":foo_unittests" | 1454 # unittests_dep = ":foo_unittests" |
1438 # } | 1455 # } |
1439 template("unittest_apk") { | 1456 template("unittest_apk") { |
| 1457 set_sources_assignment_filter([]) |
1440 testonly = true | 1458 testonly = true |
1441 | 1459 |
1442 assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name") | 1460 assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name") |
1443 | 1461 |
1444 test_suite_name = get_label_info(invoker.unittests_dep, "name") | 1462 test_suite_name = get_label_info(invoker.unittests_dep, "name") |
1445 | 1463 |
1446 # This trivial assert is needed in case both unittests_binary and apk_name | 1464 # This trivial assert is needed in case both unittests_binary and apk_name |
1447 # are defined, as otherwise test_suite_name would not be used. | 1465 # are defined, as otherwise test_suite_name would not be used. |
1448 assert(test_suite_name != "") | 1466 assert(test_suite_name != "") |
1449 | 1467 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1501 # | 1519 # |
1502 # Example | 1520 # Example |
1503 # android_aidl("foo_aidl") { | 1521 # android_aidl("foo_aidl") { |
1504 # import_include = "java/src" | 1522 # import_include = "java/src" |
1505 # sources = [ | 1523 # sources = [ |
1506 # "java/src/com/foo/bar/FooBarService.aidl", | 1524 # "java/src/com/foo/bar/FooBarService.aidl", |
1507 # "java/src/com/foo/bar/FooBarServiceCallback.aidl", | 1525 # "java/src/com/foo/bar/FooBarServiceCallback.aidl", |
1508 # ] | 1526 # ] |
1509 # } | 1527 # } |
1510 template("android_aidl") { | 1528 template("android_aidl") { |
| 1529 set_sources_assignment_filter([]) |
1511 if (defined(invoker.testonly)) { | 1530 if (defined(invoker.testonly)) { |
1512 testonly = invoker.testonly | 1531 testonly = invoker.testonly |
1513 } | 1532 } |
1514 | 1533 |
1515 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" | 1534 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" |
1516 aidl_path = "${android_sdk_build_tools}/aidl" | 1535 aidl_path = "${android_sdk_build_tools}/aidl" |
1517 framework_aidl = "$android_sdk/framework.aidl" | 1536 framework_aidl = "$android_sdk/framework.aidl" |
1518 | 1537 |
1519 action(target_name) { | 1538 action(target_name) { |
1520 script = "//build/android/gyp/aidl.py" | 1539 script = "//build/android/gyp/aidl.py" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1576 # dist_dir: Directory for the exe and libraries. Everything in this directory | 1595 # dist_dir: Directory for the exe and libraries. Everything in this directory |
1577 # will be deleted before copying in the exe and libraries. | 1596 # will be deleted before copying in the exe and libraries. |
1578 # binary: Path to (stripped) executable. | 1597 # binary: Path to (stripped) executable. |
1579 # | 1598 # |
1580 # Example | 1599 # Example |
1581 # create_native_executable_dist("foo_dist") { | 1600 # create_native_executable_dist("foo_dist") { |
1582 # dist_dir = "$root_build_dir/foo_dist" | 1601 # dist_dir = "$root_build_dir/foo_dist" |
1583 # binary = "$root_build_dir/exe.stripped/foo" | 1602 # binary = "$root_build_dir/exe.stripped/foo" |
1584 # } | 1603 # } |
1585 template("create_native_executable_dist") { | 1604 template("create_native_executable_dist") { |
| 1605 set_sources_assignment_filter([]) |
1586 if (defined(invoker.testonly)) { | 1606 if (defined(invoker.testonly)) { |
1587 testonly = invoker.testonly | 1607 testonly = invoker.testonly |
1588 } | 1608 } |
1589 | 1609 |
1590 dist_dir = invoker.dist_dir | 1610 dist_dir = invoker.dist_dir |
1591 binary = invoker.binary | 1611 binary = invoker.binary |
1592 final_deps = [] | 1612 final_deps = [] |
1593 template_name = target_name | 1613 template_name = target_name |
1594 | 1614 |
1595 libraries_list = | 1615 libraries_list = |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1656 # Variables | 1676 # Variables |
1657 # sources: Paths to .proto files to compile. | 1677 # sources: Paths to .proto files to compile. |
1658 # proto_path: Root directory of .proto files. | 1678 # proto_path: Root directory of .proto files. |
1659 # | 1679 # |
1660 # Example: | 1680 # Example: |
1661 # proto_java_library("foo_proto_java") { | 1681 # proto_java_library("foo_proto_java") { |
1662 # proto_path = [ "src/foo" ] | 1682 # proto_path = [ "src/foo" ] |
1663 # sources = [ "$proto_path/foo.proto" ] | 1683 # sources = [ "$proto_path/foo.proto" ] |
1664 # } | 1684 # } |
1665 template("proto_java_library") { | 1685 template("proto_java_library") { |
| 1686 set_sources_assignment_filter([]) |
1666 _protoc_dep = "//third_party/android_protobuf:android_protoc($host_toolchain)" | 1687 _protoc_dep = "//third_party/android_protobuf:android_protoc($host_toolchain)" |
1667 _protoc_out_dir = get_label_info(_protoc_dep, "root_out_dir") | 1688 _protoc_out_dir = get_label_info(_protoc_dep, "root_out_dir") |
1668 _protoc_bin = "$_protoc_out_dir/android_protoc" | 1689 _protoc_bin = "$_protoc_out_dir/android_protoc" |
1669 _proto_path = invoker.proto_path | 1690 _proto_path = invoker.proto_path |
1670 | 1691 |
1671 _template_name = target_name | 1692 _template_name = target_name |
1672 | 1693 |
1673 action("${_template_name}__protoc_java") { | 1694 action("${_template_name}__protoc_java") { |
1674 srcjar_path = "$target_gen_dir/$target_name.srcjar" | 1695 srcjar_path = "$target_gen_dir/$target_name.srcjar" |
1675 script = "//build/protoc_java.py" | 1696 script = "//build/protoc_java.py" |
(...skipping 22 matching lines...) Expand all Loading... |
1698 java_files = [] | 1719 java_files = [] |
1699 srcjar_deps = [ ":${_template_name}__protoc_java" ] | 1720 srcjar_deps = [ ":${_template_name}__protoc_java" ] |
1700 deps = [ | 1721 deps = [ |
1701 "//third_party/android_protobuf:protobuf_nano_javalib", | 1722 "//third_party/android_protobuf:protobuf_nano_javalib", |
1702 ] | 1723 ] |
1703 } | 1724 } |
1704 } | 1725 } |
1705 | 1726 |
1706 # TODO(GYP): implement this. | 1727 # TODO(GYP): implement this. |
1707 template("uiautomator_test") { | 1728 template("uiautomator_test") { |
| 1729 set_sources_assignment_filter([]) |
1708 if (defined(invoker.testonly)) { | 1730 if (defined(invoker.testonly)) { |
1709 testonly = invoker.testonly | 1731 testonly = invoker.testonly |
1710 } | 1732 } |
1711 assert(target_name != "") | 1733 assert(target_name != "") |
1712 assert(invoker.deps != [] || true) | 1734 assert(invoker.deps != [] || true) |
1713 group(target_name) { | 1735 group(target_name) { |
1714 } | 1736 } |
1715 } | 1737 } |
OLD | NEW |