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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 build_config = "$base_path.build_config" | 499 build_config = "$base_path.build_config" |
500 resources_zip_path = "$base_path.resources.zip" | 500 resources_zip_path = "$base_path.resources.zip" |
501 all_resources_zip_path = "$base_path.resources.all.zip" | 501 all_resources_zip_path = "$base_path.resources.all.zip" |
502 resource_srcjar_path = "$base_path.resources.srcjar" | 502 resource_srcjar_path = "$base_path.resources.srcjar" |
503 jar_path = "$base_path.jar" | 503 jar_path = "$base_path.jar" |
504 final_dex_path = "$gen_dir/classes.dex" | 504 final_dex_path = "$gen_dir/classes.dex" |
505 | 505 |
506 # Just mark these as used for now. | 506 # Just mark these as used for now. |
507 assert(!defined(invoker.native_libs) | 507 assert(!defined(invoker.native_libs) |
508 || invoker.native_libs == [] || true) | 508 || invoker.native_libs == [] || true) |
509 assert(!defined(invoker.final_apk_path) | |
510 || invoker.final_apk_path == "" || true) | |
511 | 509 |
| 510 _keystore_path = android_default_keystore_path |
| 511 _keystore_name = android_default_keystore_name |
| 512 _keystore_password = android_default_keystore_password |
| 513 |
| 514 if (defined(invoker.keystore_path)) { |
| 515 _keystore_path = invoker.keystore_path |
| 516 _keystore_name = invoker.keystore_name |
| 517 _keystore_password = invoker.keystore_password |
| 518 } |
512 | 519 |
513 # TODO(cjhopman): Remove this once we correctly generate the real | 520 # TODO(cjhopman): Remove this once we correctly generate the real |
514 # NativeLibraries.java | 521 # NativeLibraries.java |
515 srcjar_deps = [ "//base:base_native_libraries_gen" ] | 522 srcjar_deps = [ "//base:base_native_libraries_gen" ] |
516 if (defined(invoker.srcjar_deps)) { | 523 if (defined(invoker.srcjar_deps)) { |
517 srcjar_deps += invoker.srcjar_deps | 524 srcjar_deps += invoker.srcjar_deps |
518 } | 525 } |
519 | 526 |
520 write_build_config("${target_name}__build_config") { | 527 write_build_config("${target_name}__build_config") { |
521 type = "android_apk" | 528 type = "android_apk" |
(...skipping 29 matching lines...) Expand all Loading... |
551 | 558 |
552 final_deps += [":${target_name}__final_dex"] | 559 final_deps += [":${target_name}__final_dex"] |
553 dex("${target_name}__final_dex") { | 560 dex("${target_name}__final_dex") { |
554 sources = [jar_path] | 561 sources = [jar_path] |
555 inputs = [build_config] | 562 inputs = [build_config] |
556 output = final_dex_path | 563 output = final_dex_path |
557 dex_arg_key = "${rebased_build_config}:apk_dex:dependency_dex_files" | 564 dex_arg_key = "${rebased_build_config}:apk_dex:dependency_dex_files" |
558 args = ["--inputs=@FileArg($dex_arg_key)"] | 565 args = ["--inputs=@FileArg($dex_arg_key)"] |
559 } | 566 } |
560 | 567 |
| 568 final_deps += [":${target_name}__create"] |
| 569 create_apk("${target_name}__create") { |
| 570 apk_path = invoker.final_apk_path |
| 571 android_manifest = invoker.android_manifest |
| 572 resources_zip = all_resources_zip_path |
| 573 dex_path = final_dex_path |
| 574 |
| 575 keystore_name = _keystore_name |
| 576 keystore_path = _keystore_path |
| 577 keystore_password = _keystore_password |
| 578 |
| 579 # TODO: native libs |
| 580 } |
| 581 |
561 group(target_name) { | 582 group(target_name) { |
562 deps = final_deps | 583 deps = final_deps |
563 } | 584 } |
564 } | 585 } |
565 | 586 |
566 | 587 |
567 # Declare an Android gtest apk | 588 # Declare an Android gtest apk |
568 # | 589 # |
569 # This target creates an Android apk for running gtest-based unittests. | 590 # This target creates an Android apk for running gtest-based unittests. |
570 # | 591 # |
(...skipping 18 matching lines...) Expand all Loading... |
589 "//testing/android/java/src/org/chromium/native_test/ChromeNativeTestActiv
ity.java" | 610 "//testing/android/java/src/org/chromium/native_test/ChromeNativeTestActiv
ity.java" |
590 ] | 611 ] |
591 android_manifest = "//testing/android/java/AndroidManifest.xml" | 612 android_manifest = "//testing/android/java/AndroidManifest.xml" |
592 unittests_outputs = get_target_outputs(invoker.unittests_dep) | 613 unittests_outputs = get_target_outputs(invoker.unittests_dep) |
593 native_libs = [unittests_outputs[0]] | 614 native_libs = [unittests_outputs[0]] |
594 if (defined(invoker.deps)) { | 615 if (defined(invoker.deps)) { |
595 deps = invoker.deps | 616 deps = invoker.deps |
596 } | 617 } |
597 } | 618 } |
598 } | 619 } |
OLD | NEW |