| 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("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
| 6 import("//build/config/android/internal_rules.gni") | 6 import("//build/config/android/internal_rules.gni") |
| 7 import("//tools/grit/grit_rule.gni") | 7 import("//tools/grit/grit_rule.gni") |
| 8 | 8 |
| 9 assert(is_android) | 9 assert(is_android) |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 # | 22 # |
| 23 # Example | 23 # Example |
| 24 # generate_jni("foo_jni") { | 24 # generate_jni("foo_jni") { |
| 25 # sources = [ | 25 # sources = [ |
| 26 # "android/java/src/org/chromium/foo/Foo.java", | 26 # "android/java/src/org/chromium/foo/Foo.java", |
| 27 # "android/java/src/org/chromium/foo/FooUtil.java", | 27 # "android/java/src/org/chromium/foo/FooUtil.java", |
| 28 # ] | 28 # ] |
| 29 # jni_package = "foo" | 29 # jni_package = "foo" |
| 30 # } | 30 # } |
| 31 template("generate_jni") { | 31 template("generate_jni") { |
| 32 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
| 33 |
| 32 assert(defined(invoker.sources)) | 34 assert(defined(invoker.sources)) |
| 33 assert(defined(invoker.jni_package)) | 35 assert(defined(invoker.jni_package)) |
| 34 jni_package = invoker.jni_package | 36 jni_package = invoker.jni_package |
| 35 base_output_dir = "${root_gen_dir}/${target_name}/${jni_package}" | 37 base_output_dir = "${root_gen_dir}/${target_name}/${jni_package}" |
| 36 jni_output_dir = "${base_output_dir}/jni" | 38 jni_output_dir = "${base_output_dir}/jni" |
| 37 | 39 |
| 38 jni_generator_include = "//base/android/jni_generator/jni_generator_helper.h" | 40 jni_generator_include = "//base/android/jni_generator/jni_generator_helper.h" |
| 39 | 41 |
| 40 foreach_target_name = "${target_name}__jni_gen" | 42 foreach_target_name = "${target_name}__jni_gen" |
| 41 action_foreach(foreach_target_name) { | 43 action_foreach(foreach_target_name) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 # deps, forward_dependent_configs_from: As normal | 100 # deps, forward_dependent_configs_from: As normal |
| 99 # | 101 # |
| 100 # Example | 102 # Example |
| 101 # generate_jar_jni("foo_jni") { | 103 # generate_jar_jni("foo_jni") { |
| 102 # classes = [ | 104 # classes = [ |
| 103 # "android/view/Foo.class", | 105 # "android/view/Foo.class", |
| 104 # ] | 106 # ] |
| 105 # jni_package = "foo" | 107 # jni_package = "foo" |
| 106 # } | 108 # } |
| 107 template("generate_jar_jni") { | 109 template("generate_jar_jni") { |
| 110 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
| 111 |
| 108 assert(defined(invoker.classes)) | 112 assert(defined(invoker.classes)) |
| 109 assert(defined(invoker.jni_package)) | 113 assert(defined(invoker.jni_package)) |
| 110 | 114 |
| 111 if (defined(invoker.jar_file)) { | 115 if (defined(invoker.jar_file)) { |
| 112 jar_file = invoker.jar_file | 116 jar_file = invoker.jar_file |
| 113 } else { | 117 } else { |
| 114 jar_file = android_sdk_jar | 118 jar_file = android_sdk_jar |
| 115 } | 119 } |
| 116 | 120 |
| 117 jni_package = invoker.jni_package | 121 jni_package = invoker.jni_package |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 # "android/java/templates/Foo.template", | 201 # "android/java/templates/Foo.template", |
| 198 # ] | 202 # ] |
| 199 # inputs = [ | 203 # inputs = [ |
| 200 # "android/java/templates/native_foo_header.h", | 204 # "android/java/templates/native_foo_header.h", |
| 201 # ] | 205 # ] |
| 202 # | 206 # |
| 203 # package_name = "org/chromium/base/library_loader" | 207 # package_name = "org/chromium/base/library_loader" |
| 204 # include_path = "android/java/templates" | 208 # include_path = "android/java/templates" |
| 205 # } | 209 # } |
| 206 template("java_cpp_template") { | 210 template("java_cpp_template") { |
| 211 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
| 212 |
| 207 assert(defined(invoker.sources)) | 213 assert(defined(invoker.sources)) |
| 208 package_name = invoker.package_name + "" | 214 package_name = invoker.package_name + "" |
| 209 | 215 |
| 210 if (defined(invoker.include_path)) { | 216 if (defined(invoker.include_path)) { |
| 211 include_path = invoker.include_path + "" | 217 include_path = invoker.include_path + "" |
| 212 } else { | 218 } else { |
| 213 include_path = "//" | 219 include_path = "//" |
| 214 } | 220 } |
| 215 | 221 |
| 216 action_foreach("${target_name}__apply_gcc") { | 222 action_foreach("${target_name}__apply_gcc") { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 # Example | 288 # Example |
| 283 # java_cpp_enum("foo_generated_enum") { | 289 # java_cpp_enum("foo_generated_enum") { |
| 284 # sources = [ | 290 # sources = [ |
| 285 # "src/native_foo_header.h", | 291 # "src/native_foo_header.h", |
| 286 # ] | 292 # ] |
| 287 # outputs = [ | 293 # outputs = [ |
| 288 # "org/chromium/FooEnum.java", | 294 # "org/chromium/FooEnum.java", |
| 289 # ] | 295 # ] |
| 290 # } | 296 # } |
| 291 template("java_cpp_enum") { | 297 template("java_cpp_enum") { |
| 298 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
| 299 |
| 292 assert(defined(invoker.sources)) | 300 assert(defined(invoker.sources)) |
| 293 assert(defined(invoker.outputs)) | 301 assert(defined(invoker.outputs)) |
| 294 | 302 |
| 295 action("${target_name}__generate_enum") { | 303 action("${target_name}__generate_enum") { |
| 296 sources = rebase_path(invoker.sources, root_build_dir) | 304 sources = rebase_path(invoker.sources, root_build_dir) |
| 297 script = "//build/android/gyp/java_cpp_enum.py" | 305 script = "//build/android/gyp/java_cpp_enum.py" |
| 298 gen_dir = "${target_gen_dir}/${target_name}/enums" | 306 gen_dir = "${target_gen_dir}/${target_name}/enums" |
| 299 outputs = get_path_info( | 307 outputs = get_path_info( |
| 300 rebase_path(invoker.outputs, ".", gen_dir), "abspath") | 308 rebase_path(invoker.outputs, ".", gen_dir), "abspath") |
| 301 | 309 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 # build/android/gyp/generate_v14_compatible_resources.py). Defaults to | 357 # build/android/gyp/generate_v14_compatible_resources.py). Defaults to |
| 350 # false. | 358 # false. |
| 351 # | 359 # |
| 352 # Example | 360 # Example |
| 353 # android_resources("foo_resources") { | 361 # android_resources("foo_resources") { |
| 354 # deps = [":foo_strings_grd"] | 362 # deps = [":foo_strings_grd"] |
| 355 # resource_dirs = ["res"] | 363 # resource_dirs = ["res"] |
| 356 # custom_package = "org.chromium.foo" | 364 # custom_package = "org.chromium.foo" |
| 357 # } | 365 # } |
| 358 template("android_resources") { | 366 template("android_resources") { |
| 367 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
| 368 |
| 359 assert(defined(invoker.resource_dirs)) | 369 assert(defined(invoker.resource_dirs)) |
| 360 assert(defined(invoker.android_manifest) || defined(invoker.custom_package)) | 370 assert(defined(invoker.android_manifest) || defined(invoker.custom_package)) |
| 361 | 371 |
| 362 base_path = "$target_gen_dir/$target_name" | 372 base_path = "$target_gen_dir/$target_name" |
| 363 zip_path = base_path + ".resources.zip" | 373 zip_path = base_path + ".resources.zip" |
| 364 srcjar_path = base_path + ".srcjar" | 374 srcjar_path = base_path + ".srcjar" |
| 365 build_config = base_path + ".build_config" | 375 build_config = base_path + ".build_config" |
| 366 | 376 |
| 367 write_build_config("${target_name}__build_config") { | 377 write_build_config("${target_name}__build_config") { |
| 368 type = "android_resources" | 378 type = "android_resources" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 # Variables | 416 # Variables |
| 407 # deps: Specifies the dependencies of this target. | 417 # deps: Specifies the dependencies of this target. |
| 408 # grd_file: Path to the .grd file to generate strings.xml from. | 418 # grd_file: Path to the .grd file to generate strings.xml from. |
| 409 # outputs: Expected grit outputs (see grit rule). | 419 # outputs: Expected grit outputs (see grit rule). |
| 410 # | 420 # |
| 411 # Example | 421 # Example |
| 412 # java_strings_grd("foo_strings_grd") { | 422 # java_strings_grd("foo_strings_grd") { |
| 413 # grd_file = "foo_strings.grd" | 423 # grd_file = "foo_strings.grd" |
| 414 # } | 424 # } |
| 415 template("java_strings_grd") { | 425 template("java_strings_grd") { |
| 426 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
| 427 |
| 416 base_path = "$target_gen_dir/$target_name" | 428 base_path = "$target_gen_dir/$target_name" |
| 417 resources_zip = base_path + ".resources.zip" | 429 resources_zip = base_path + ".resources.zip" |
| 418 build_config = base_path + ".build_config" | 430 build_config = base_path + ".build_config" |
| 419 | 431 |
| 420 write_build_config("${target_name}__build_config") { | 432 write_build_config("${target_name}__build_config") { |
| 421 type = "android_resources" | 433 type = "android_resources" |
| 422 if (defined(invoker.deps)) { | 434 if (defined(invoker.deps)) { |
| 423 deps = invoker.deps | 435 deps = invoker.deps |
| 424 } | 436 } |
| 425 } | 437 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 # ":bar_java" | 504 # ":bar_java" |
| 493 # ] | 505 # ] |
| 494 # srcjar_deps = [ | 506 # srcjar_deps = [ |
| 495 # ":foo_generated_enum" | 507 # ":foo_generated_enum" |
| 496 # ] | 508 # ] |
| 497 # jar_excluded_patterns = [ | 509 # jar_excluded_patterns = [ |
| 498 # "*/FooService.class", "*/FooService##*.class" | 510 # "*/FooService.class", "*/FooService##*.class" |
| 499 # ] | 511 # ] |
| 500 # } | 512 # } |
| 501 template("android_library") { | 513 template("android_library") { |
| 514 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
| 515 |
| 502 assert(defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir)) | 516 assert(defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir)) |
| 503 _base_path = "$target_gen_dir/$target_name" | 517 _base_path = "$target_gen_dir/$target_name" |
| 504 _build_config = _base_path + ".build_config" | 518 _build_config = _base_path + ".build_config" |
| 505 _jar_path = _base_path + ".jar" | 519 _jar_path = _base_path + ".jar" |
| 506 _dex_path = _base_path + ".dex.jar" | 520 _dex_path = _base_path + ".dex.jar" |
| 507 | 521 |
| 508 write_build_config("${target_name}__build_config") { | 522 write_build_config("${target_name}__build_config") { |
| 509 type = "android_library" | 523 type = "android_library" |
| 510 | 524 |
| 511 deps = [] | 525 deps = [] |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 # | 584 # |
| 571 # Example | 585 # Example |
| 572 # android_java_prebuilt("foo_java") { | 586 # android_java_prebuilt("foo_java") { |
| 573 # jar_path = "foo.jar" | 587 # jar_path = "foo.jar" |
| 574 # deps = [ | 588 # deps = [ |
| 575 # ":foo_resources", | 589 # ":foo_resources", |
| 576 # ":bar_java" | 590 # ":bar_java" |
| 577 # ] | 591 # ] |
| 578 # } | 592 # } |
| 579 template("android_java_prebuilt") { | 593 template("android_java_prebuilt") { |
| 594 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
| 595 |
| 580 assert(defined(invoker.jar_path)) | 596 assert(defined(invoker.jar_path)) |
| 581 _base_path = "${target_gen_dir}/$target_name" | 597 _base_path = "${target_gen_dir}/$target_name" |
| 582 _jar_path = _base_path + ".jar" | 598 _jar_path = _base_path + ".jar" |
| 583 _dex_path = _base_path + ".dex.jar" | 599 _dex_path = _base_path + ".dex.jar" |
| 584 _build_config = _base_path + ".build_config" | 600 _build_config = _base_path + ".build_config" |
| 585 | 601 |
| 586 write_build_config("${target_name}__build_config") { | 602 write_build_config("${target_name}__build_config") { |
| 587 type = "android_library" | 603 type = "android_library" |
| 588 | 604 |
| 589 deps = [] | 605 deps = [] |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 # ":foo_resources" | 678 # ":foo_resources" |
| 663 # ] | 679 # ] |
| 664 # srcjar_deps = [ | 680 # srcjar_deps = [ |
| 665 # ":foo_generated_enum" | 681 # ":foo_generated_enum" |
| 666 # ] | 682 # ] |
| 667 # native_libs = [ | 683 # native_libs = [ |
| 668 # native_lib_path | 684 # native_lib_path |
| 669 # ] | 685 # ] |
| 670 # } | 686 # } |
| 671 template("android_apk") { | 687 template("android_apk") { |
| 688 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
| 689 |
| 672 assert(defined(invoker.final_apk_path) || defined(invoker.apk_name)) | 690 assert(defined(invoker.final_apk_path) || defined(invoker.apk_name)) |
| 673 gen_dir = "$target_gen_dir/$target_name" | 691 gen_dir = "$target_gen_dir/$target_name" |
| 674 base_path = "$gen_dir/$target_name" | 692 base_path = "$gen_dir/$target_name" |
| 675 build_config = "$base_path.build_config" | 693 build_config = "$base_path.build_config" |
| 676 resources_zip_path = "$base_path.resources.zip" | 694 resources_zip_path = "$base_path.resources.zip" |
| 677 all_resources_zip_path = "$base_path.resources.all.zip" | 695 all_resources_zip_path = "$base_path.resources.all.zip" |
| 678 jar_path = "$base_path.jar" | 696 jar_path = "$base_path.jar" |
| 679 final_dex_path = "$gen_dir/classes.dex" | 697 final_dex_path = "$gen_dir/classes.dex" |
| 680 _template_name = target_name | 698 _template_name = target_name |
| 681 _final_apk_path = "" | 699 _final_apk_path = "" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 _rebased_build_config = rebase_path(build_config, root_build_dir) | 732 _rebased_build_config = rebase_path(build_config, root_build_dir) |
| 715 | 733 |
| 716 write_build_config("${_template_name}__build_config") { | 734 write_build_config("${_template_name}__build_config") { |
| 717 type = "android_apk" | 735 type = "android_apk" |
| 718 dex_path = final_dex_path | 736 dex_path = final_dex_path |
| 719 resources_zip = resources_zip_path | 737 resources_zip = resources_zip_path |
| 720 | 738 |
| 721 if (defined(invoker.deps)) { | 739 if (defined(invoker.deps)) { |
| 722 deps = invoker.deps | 740 deps = invoker.deps |
| 723 } | 741 } |
| 724 if (defined(invoker.testonly)) { | |
| 725 testonly = invoker.testonly | |
| 726 } | |
| 727 | 742 |
| 728 native_libs = _native_libs | 743 native_libs = _native_libs |
| 729 } | 744 } |
| 730 | 745 |
| 731 final_deps = [] | 746 final_deps = [] |
| 732 | 747 |
| 733 final_deps += [":${_template_name}__process_resources"] | 748 final_deps += [":${_template_name}__process_resources"] |
| 734 process_resources("${_template_name}__process_resources") { | 749 process_resources("${_template_name}__process_resources") { |
| 735 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" | 750 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" |
| 736 android_manifest = invoker.android_manifest | 751 android_manifest = invoker.android_manifest |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 | 874 |
| 860 if (_native_libs != []) { | 875 if (_native_libs != []) { |
| 861 native_libs_dir = _native_libs_dir | 876 native_libs_dir = _native_libs_dir |
| 862 deps = [":${_template_name}__prepare_native"] | 877 deps = [":${_template_name}__prepare_native"] |
| 863 } | 878 } |
| 864 } | 879 } |
| 865 | 880 |
| 866 group(target_name) { | 881 group(target_name) { |
| 867 deps = final_deps | 882 deps = final_deps |
| 868 if (defined(invoker.datadeps)) { | 883 if (defined(invoker.datadeps)) { |
| 869 datadeps = invoker.datadeps | 884 # TODO(cjhopman): Fix this when group datadeps works. |
| 885 deps += invoker.datadeps |
| 870 } | 886 } |
| 871 } | 887 } |
| 872 } | 888 } |
| 873 | 889 |
| 874 | 890 |
| 875 # Declare an Android gtest apk | 891 # Declare an Android gtest apk |
| 876 # | 892 # |
| 877 # This target creates an Android apk for running gtest-based unittests. | 893 # This target creates an Android apk for running gtest-based unittests. |
| 878 # | 894 # |
| 879 # Variables | 895 # Variables |
| 880 # deps: Specifies the dependencies of this target. These will be passed to | 896 # deps: Specifies the dependencies of this target. These will be passed to |
| 881 # the underlying android_apk invocation and should include the java and | 897 # the underlying android_apk invocation and should include the java and |
| 882 # resource dependencies of the apk. | 898 # resource dependencies of the apk. |
| 883 # unittests_dep: This should be the label of the gtest native target. This | 899 # unittests_dep: This should be the label of the gtest native target. This |
| 884 # target must be defined previously in the same file. | 900 # target must be defined previously in the same file. |
| 885 # unittests_binary: The name of the binary produced by the unittests_dep | 901 # unittests_binary: The name of the binary produced by the unittests_dep |
| 886 # target, relative to the root build directory. If unspecified, it assumes | 902 # target, relative to the root build directory. If unspecified, it assumes |
| 887 # the name of the unittests_dep target (which will be correct unless that | 903 # the name of the unittests_dep target (which will be correct unless that |
| 888 # target specifies an "output_name". | 904 # target specifies an "output_name". |
| 889 # TODO(brettw) make this automatic by allowing get_target_outputs to | 905 # TODO(brettw) make this automatic by allowing get_target_outputs to |
| 890 # support executables. | 906 # support executables. |
| 891 # | 907 # |
| 892 # Example | 908 # Example |
| 893 # unittest_apk("foo_unittests_apk") { | 909 # unittest_apk("foo_unittests_apk") { |
| 894 # deps = [ ":foo_java", ":foo_resources" ] | 910 # deps = [ ":foo_java", ":foo_resources" ] |
| 895 # unittests_dep = ":foo_unittests" | 911 # unittests_dep = ":foo_unittests" |
| 896 # } | 912 # } |
| 897 template("unittest_apk") { | 913 template("unittest_apk") { |
| 914 testonly = true |
| 915 |
| 898 assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name") | 916 assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name") |
| 899 | 917 |
| 900 test_suite_name = get_label_info(invoker.unittests_dep, "name") | 918 test_suite_name = get_label_info(invoker.unittests_dep, "name") |
| 901 | 919 |
| 902 if (defined(invoker.unittests_binary)) { | 920 if (defined(invoker.unittests_binary)) { |
| 903 unittests_binary = root_out_dir + "/" + invoker.unittests_binary | 921 unittests_binary = root_out_dir + "/" + invoker.unittests_binary |
| 904 } else { | 922 } else { |
| 905 unittests_binary = root_out_dir + "/lib.stripped/lib" + test_suite_name + ".
so" | 923 unittests_binary = root_out_dir + "/lib.stripped/lib" + test_suite_name + ".
so" |
| 906 } | 924 } |
| 907 | 925 |
| 908 android_apk(target_name) { | 926 android_apk(target_name) { |
| 909 _apk_name = test_suite_name | 927 _apk_name = test_suite_name |
| 910 final_apk_path = "$root_build_dir/${_apk_name}_apk/${_apk_name}-debug.apk" | 928 final_apk_path = "$root_build_dir/${_apk_name}_apk/${_apk_name}-debug.apk" |
| 911 java_files = [ | 929 java_files = [ |
| 912 "//testing/android/java/src/org/chromium/native_test/ChromeNativeTestActiv
ity.java" | 930 "//testing/android/java/src/org/chromium/native_test/ChromeNativeTestActiv
ity.java" |
| 913 ] | 931 ] |
| 914 android_manifest = "//testing/android/java/AndroidManifest.xml" | 932 android_manifest = "//testing/android/java/AndroidManifest.xml" |
| 915 unittests_outputs = [ unittests_binary ] | 933 unittests_outputs = [ unittests_binary ] |
| 916 native_libs = [unittests_outputs[0]] | 934 native_libs = [unittests_outputs[0]] |
| 917 if (defined(invoker.deps)) { | 935 if (defined(invoker.deps)) { |
| 918 deps = invoker.deps | 936 deps = invoker.deps |
| 919 } | 937 } |
| 920 datadeps = [ | 938 datadeps = [ |
| 921 "//tools/android/md5sum", | 939 "//tools/android/md5sum", |
| 922 ] | 940 ] |
| 923 testonly = true | |
| 924 } | 941 } |
| 925 } | 942 } |
| 926 | 943 |
| 927 # Generate .java files from .aidl files. | 944 # Generate .java files from .aidl files. |
| 928 # | 945 # |
| 929 # This target will store the .java files in a srcjar and should be included in | 946 # This target will store the .java files in a srcjar and should be included in |
| 930 # an android_library or android_apk's srcjar_deps. | 947 # an android_library or android_apk's srcjar_deps. |
| 931 # | 948 # |
| 932 # Variables | 949 # Variables |
| 933 # sources: Paths to .aidl files to compile. | 950 # sources: Paths to .aidl files to compile. |
| 934 # import_include: Path to directory containing .java files imported by the | 951 # import_include: Path to directory containing .java files imported by the |
| 935 # .aidl files. | 952 # .aidl files. |
| 936 # interface_file: Preprocessed aidl file to import. | 953 # interface_file: Preprocessed aidl file to import. |
| 937 # | 954 # |
| 938 # Example | 955 # Example |
| 939 # android_aidl("foo_aidl") { | 956 # android_aidl("foo_aidl") { |
| 940 # import_include = "java/src" | 957 # import_include = "java/src" |
| 941 # sources = [ | 958 # sources = [ |
| 942 # "java/src/com/foo/bar/FooBarService.aidl", | 959 # "java/src/com/foo/bar/FooBarService.aidl", |
| 943 # "java/src/com/foo/bar/FooBarServiceCallback.aidl", | 960 # "java/src/com/foo/bar/FooBarServiceCallback.aidl", |
| 944 # ] | 961 # ] |
| 945 # } | 962 # } |
| 946 template("android_aidl") { | 963 template("android_aidl") { |
| 964 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
| 965 |
| 947 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" | 966 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" |
| 948 aidl_path = "${android_sdk_build_tools}/aidl" | 967 aidl_path = "${android_sdk_build_tools}/aidl" |
| 949 framework_aidl = "$android_sdk/framework.aidl" | 968 framework_aidl = "$android_sdk/framework.aidl" |
| 950 | 969 |
| 951 action(target_name) { | 970 action(target_name) { |
| 952 script = "//build/android/gyp/aidl.py" | 971 script = "//build/android/gyp/aidl.py" |
| 953 sources = invoker.sources | 972 sources = invoker.sources |
| 954 | 973 |
| 955 imports = [ framework_aidl ] | 974 imports = [ framework_aidl ] |
| 956 if (defined(invoker.interface_file)) { | 975 if (defined(invoker.interface_file)) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 # dist_dir: Directory for the exe and libraries. Everything in this directory | 1027 # dist_dir: Directory for the exe and libraries. Everything in this directory |
| 1009 # will be deleted before copying in the exe and libraries. | 1028 # will be deleted before copying in the exe and libraries. |
| 1010 # binary: Path to (stripped) executable. | 1029 # binary: Path to (stripped) executable. |
| 1011 # | 1030 # |
| 1012 # Example | 1031 # Example |
| 1013 # create_native_executable_dist("foo_dist") { | 1032 # create_native_executable_dist("foo_dist") { |
| 1014 # dist_dir = "$root_build_dir/foo_dist" | 1033 # dist_dir = "$root_build_dir/foo_dist" |
| 1015 # binary = "$root_build_dir/exe.stripped/foo" | 1034 # binary = "$root_build_dir/exe.stripped/foo" |
| 1016 # } | 1035 # } |
| 1017 template("create_native_executable_dist") { | 1036 template("create_native_executable_dist") { |
| 1037 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
| 1038 |
| 1018 dist_dir = invoker.dist_dir | 1039 dist_dir = invoker.dist_dir |
| 1019 binary = invoker.binary | 1040 binary = invoker.binary |
| 1020 final_deps = [] | 1041 final_deps = [] |
| 1021 template_name = target_name | 1042 template_name = target_name |
| 1022 | 1043 |
| 1023 libraries_list = "${target_gen_dir}/${template_name}_library_dependencies.list
" | 1044 libraries_list = "${target_gen_dir}/${template_name}_library_dependencies.list
" |
| 1024 | 1045 |
| 1025 # TODO(gyp) | 1046 # TODO(gyp) |
| 1026 #'dependencies': [ | 1047 #'dependencies': [ |
| 1027 #'<(DEPTH)/build/android/setup.gyp:copy_system_libraries', | 1048 #'<(DEPTH)/build/android/setup.gyp:copy_system_libraries', |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 args = [ | 1084 args = [ |
| 1064 "--files=$rebased_binaries_list", | 1085 "--files=$rebased_binaries_list", |
| 1065 "--files=@FileArg($rebased_libraries_list:libraries)", | 1086 "--files=@FileArg($rebased_libraries_list:libraries)", |
| 1066 ] | 1087 ] |
| 1067 } | 1088 } |
| 1068 | 1089 |
| 1069 group(target_name) { | 1090 group(target_name) { |
| 1070 deps = final_deps | 1091 deps = final_deps |
| 1071 } | 1092 } |
| 1072 } | 1093 } |
| OLD | NEW |