Chromium Code Reviews| 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 | 9 |
| 10 assert(is_android) | 10 assert(is_android) |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 676 # ] | 676 # ] |
| 677 # } | 677 # } |
| 678 template("android_library") { | 678 template("android_library") { |
| 679 if (defined(invoker.testonly)) { testonly = invoker.testonly } | 679 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
| 680 | 680 |
| 681 assert(defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) | 681 assert(defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) |
| 682 || defined(invoker.srcjars)) | 682 || defined(invoker.srcjars)) |
| 683 _base_path = "$target_gen_dir/$target_name" | 683 _base_path = "$target_gen_dir/$target_name" |
| 684 _build_config = _base_path + ".build_config" | 684 _build_config = _base_path + ".build_config" |
| 685 _jar_path = _base_path + ".jar" | 685 _jar_path = _base_path + ".jar" |
| 686 _dex_path = _base_path + ".dex.jar" | 686 _dex_path = _base_path + ".dex.jar" |
|
cjhopman
2014/10/24 01:23:34
We should be able to support a custom dex path by
| |
| 687 | 687 |
| 688 write_build_config("${target_name}__build_config") { | 688 write_build_config("${target_name}__build_config") { |
| 689 type = "android_library" | 689 type = "android_library" |
| 690 | 690 |
| 691 deps = [] | 691 deps = [] |
| 692 if (defined(invoker.deps)) { | 692 if (defined(invoker.deps)) { |
| 693 deps += invoker.deps | 693 deps += invoker.deps |
| 694 } | 694 } |
| 695 | 695 |
| 696 build_config = _build_config | 696 build_config = _build_config |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1048 } else if (defined(invoker.DEPRECATED_java_in_dir)) { | 1048 } else if (defined(invoker.DEPRECATED_java_in_dir)) { |
| 1049 DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir | 1049 DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir |
| 1050 } else { | 1050 } else { |
| 1051 java_files = [] | 1051 java_files = [] |
| 1052 } | 1052 } |
| 1053 srcjar_deps = _srcjar_deps | 1053 srcjar_deps = _srcjar_deps |
| 1054 dex_path = base_path + ".dex.jar" | 1054 dex_path = base_path + ".dex.jar" |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 if (_dist_jar_path != "") { | 1057 if (_dist_jar_path != "") { |
| 1058 final_deps += [ ":${_template_name}__create_dist_jar" ] | |
| 1058 # TODO(cjhopman): This is only ever needed to calculate the list of tests to | 1059 # TODO(cjhopman): This is only ever needed to calculate the list of tests to |
| 1059 # run. See build/android/pylib/instrumentation/test_jar.py. We should be | 1060 # run. See build/android/pylib/instrumentation/test_jar.py. We should be |
| 1060 # able to just do that calculation at build time instead. | 1061 # able to just do that calculation at build time instead. |
| 1061 action("${_template_name}__create_dist_jar") { | 1062 action("${_template_name}__create_dist_jar") { |
| 1062 script = "//build/android/gyp/create_dist_jar.py" | 1063 script = "//build/android/gyp/create_dist_jar.py" |
| 1063 depfile = "$target_gen_dir/$target_name.d" | 1064 depfile = "$target_gen_dir/$target_name.d" |
| 1064 inputs = [ build_config ] | 1065 inputs = [ build_config ] |
| 1065 outputs = [ | 1066 outputs = [ |
| 1066 depfile, | 1067 depfile, |
| 1067 _dist_jar_path, | 1068 _dist_jar_path, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1183 ] | 1184 ] |
| 1184 android_manifest = "//testing/android/java/AndroidManifest.xml" | 1185 android_manifest = "//testing/android/java/AndroidManifest.xml" |
| 1185 unittests_outputs = [ unittests_binary ] | 1186 unittests_outputs = [ unittests_binary ] |
| 1186 native_libs = [unittests_outputs[0]] | 1187 native_libs = [unittests_outputs[0]] |
| 1187 deps = [ "//base:base_java" ] | 1188 deps = [ "//base:base_java" ] |
| 1188 if (defined(invoker.deps)) { | 1189 if (defined(invoker.deps)) { |
| 1189 deps += invoker.deps | 1190 deps += invoker.deps |
| 1190 } | 1191 } |
| 1191 datadeps = [ | 1192 datadeps = [ |
| 1192 "//tools/android/md5sum", | 1193 "//tools/android/md5sum", |
| 1194 "//tools/android/forwarder2", | |
| 1193 ] | 1195 ] |
| 1194 } | 1196 } |
| 1195 } | 1197 } |
| 1196 | 1198 |
| 1197 # Generate .java files from .aidl files. | 1199 # Generate .java files from .aidl files. |
| 1198 # | 1200 # |
| 1199 # This target will store the .java files in a srcjar and should be included in | 1201 # This target will store the .java files in a srcjar and should be included in |
| 1200 # an android_library or android_apk's srcjar_deps. | 1202 # an android_library or android_apk's srcjar_deps. |
| 1201 # | 1203 # |
| 1202 # Variables | 1204 # Variables |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1398 } | 1400 } |
| 1399 | 1401 |
| 1400 # TODO(GYP): implement this. | 1402 # TODO(GYP): implement this. |
| 1401 template("uiautomator_test") { | 1403 template("uiautomator_test") { |
| 1402 if (defined(invoker.testonly)) { testonly = invoker.testonly } | 1404 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
| 1403 assert(target_name != "") | 1405 assert(target_name != "") |
| 1404 assert(invoker.deps != [] || true) | 1406 assert(invoker.deps != [] || true) |
| 1405 group(target_name) { | 1407 group(target_name) { |
| 1406 } | 1408 } |
| 1407 } | 1409 } |
| OLD | NEW |