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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 if (defined(invoker.testonly)) { testonly = invoker.testonly } | 413 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
414 | 414 |
415 assert(defined(invoker.resources)) | 415 assert(defined(invoker.resources)) |
416 assert(defined(invoker.res_dir)) | 416 assert(defined(invoker.res_dir)) |
417 | 417 |
418 _base_path = "$target_gen_dir/$target_name" | 418 _base_path = "$target_gen_dir/$target_name" |
419 _resources_zip = _base_path + ".resources.zip" | 419 _resources_zip = _base_path + ".resources.zip" |
420 _build_config = _base_path + ".build_config" | 420 _build_config = _base_path + ".build_config" |
421 | 421 |
422 write_build_config("${target_name}__build_config") { | 422 write_build_config("${target_name}__build_config") { |
| 423 build_config = _build_config |
| 424 resources_zip = _resources_zip |
423 type = "android_resources" | 425 type = "android_resources" |
424 } | 426 } |
425 | 427 |
426 action("${target_name}__template") { | 428 action("${target_name}__template") { |
427 sources = invoker.resources | 429 sources = invoker.resources |
428 script = "//build/android/gyp/jinja_template.py" | 430 script = "//build/android/gyp/jinja_template.py" |
429 depfile = "$target_gen_dir/$target_name.d" | 431 depfile = "$target_gen_dir/$target_name.d" |
430 | 432 |
431 outputs = [ | 433 outputs = [ |
432 depfile, | 434 depfile, |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 # ":foo_generated_enum" | 674 # ":foo_generated_enum" |
673 # ] | 675 # ] |
674 # jar_excluded_patterns = [ | 676 # jar_excluded_patterns = [ |
675 # "*/FooService.class", "*/FooService##*.class" | 677 # "*/FooService.class", "*/FooService##*.class" |
676 # ] | 678 # ] |
677 # } | 679 # } |
678 template("android_library") { | 680 template("android_library") { |
679 if (defined(invoker.testonly)) { testonly = invoker.testonly } | 681 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
680 | 682 |
681 assert(defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) | 683 assert(defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) |
682 || defined(invoker.srcjars)) | 684 || defined(invoker.srcjars) || defined(invoker.srcjar_deps)) |
683 _base_path = "$target_gen_dir/$target_name" | 685 _base_path = "$target_gen_dir/$target_name" |
684 _build_config = _base_path + ".build_config" | 686 _build_config = _base_path + ".build_config" |
685 _jar_path = _base_path + ".jar" | 687 _jar_path = _base_path + ".jar" |
686 _dex_path = _base_path + ".dex.jar" | 688 _dex_path = _base_path + ".dex.jar" |
687 | 689 |
688 write_build_config("${target_name}__build_config") { | 690 write_build_config("${target_name}__build_config") { |
689 type = "android_library" | 691 type = "android_library" |
690 | 692 |
691 deps = [] | 693 deps = [] |
692 if (defined(invoker.deps)) { | 694 if (defined(invoker.deps)) { |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 } | 984 } |
983 | 985 |
984 _native_libs = invoker.native_libs | 986 _native_libs = invoker.native_libs |
985 _native_libs_dir = base_path + "/libs" | 987 _native_libs_dir = base_path + "/libs" |
986 | 988 |
987 if (_use_chromium_linker) { | 989 if (_use_chromium_linker) { |
988 _native_libs += [ | 990 _native_libs += [ |
989 "$root_build_dir/lib.stripped/libchromium_android_linker.so" | 991 "$root_build_dir/lib.stripped/libchromium_android_linker.so" |
990 ] | 992 ] |
991 } | 993 } |
| 994 |
| 995 _enable_relocation_packing = false |
| 996 if (_use_chromium_linker && defined(invoker.enable_relocation_packing) && |
| 997 invoker.enable_relocation_packing) { |
| 998 _enable_relocation_packing = true |
| 999 } |
992 } | 1000 } |
993 | 1001 |
994 _rebased_build_config = rebase_path(build_config, root_build_dir) | 1002 _rebased_build_config = rebase_path(build_config, root_build_dir) |
995 | 1003 |
996 write_build_config("${_template_name}__build_config") { | 1004 write_build_config("${_template_name}__build_config") { |
997 type = "android_apk" | 1005 type = "android_apk" |
998 dex_path = final_dex_path | 1006 dex_path = final_dex_path |
999 resources_zip = resources_zip_path | 1007 resources_zip = resources_zip_path |
1000 | 1008 |
1001 if (defined(invoker.deps)) { | 1009 if (defined(invoker.deps)) { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 } | 1158 } |
1151 | 1159 |
1152 final_deps += [":${_template_name}__create"] | 1160 final_deps += [":${_template_name}__create"] |
1153 create_apk("${_template_name}__create") { | 1161 create_apk("${_template_name}__create") { |
1154 apk_path = _final_apk_path | 1162 apk_path = _final_apk_path |
1155 android_manifest = invoker.android_manifest | 1163 android_manifest = invoker.android_manifest |
1156 resources_zip = all_resources_zip_path | 1164 resources_zip = all_resources_zip_path |
1157 dex_path = final_dex_path | 1165 dex_path = final_dex_path |
1158 load_library_from_apk = _load_library_from_apk | 1166 load_library_from_apk = _load_library_from_apk |
1159 | 1167 |
| 1168 version_code = "1" |
| 1169 if (defined(invoker.version_code)) { |
| 1170 version_code = invoker.version_code |
| 1171 } |
| 1172 |
| 1173 version_name = "Developer Build" |
| 1174 if (defined(invoker.version_name)) { |
| 1175 version_name = invoker.version_name |
| 1176 } |
| 1177 |
1160 if (defined(invoker.asset_location)) { | 1178 if (defined(invoker.asset_location)) { |
1161 asset_location = invoker.asset_location | 1179 asset_location = invoker.asset_location |
1162 } | 1180 } |
1163 | 1181 |
1164 keystore_name = _keystore_name | 1182 keystore_name = _keystore_name |
1165 keystore_path = _keystore_path | 1183 keystore_path = _keystore_path |
1166 keystore_password = _keystore_password | 1184 keystore_password = _keystore_password |
1167 | 1185 |
1168 if (_native_libs != []) { | 1186 if (_native_libs != []) { |
1169 native_libs_dir = _native_libs_dir | 1187 native_libs_dir = _native_libs_dir |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 } | 1457 } |
1440 | 1458 |
1441 # TODO(GYP): implement this. | 1459 # TODO(GYP): implement this. |
1442 template("uiautomator_test") { | 1460 template("uiautomator_test") { |
1443 if (defined(invoker.testonly)) { testonly = invoker.testonly } | 1461 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
1444 assert(target_name != "") | 1462 assert(target_name != "") |
1445 assert(invoker.deps != [] || true) | 1463 assert(invoker.deps != [] || true) |
1446 group(target_name) { | 1464 group(target_name) { |
1447 } | 1465 } |
1448 } | 1466 } |
OLD | NEW |