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 | 6 |
7 assert(is_android) | 7 assert(is_android) |
8 | 8 |
9 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) | 9 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) |
10 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) | 10 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 } | 527 } |
528 } | 528 } |
529 | 529 |
530 action("${target_name}__package") { | 530 action("${target_name}__package") { |
531 script = "//build/android/gyp/ant.py" | 531 script = "//build/android/gyp/ant.py" |
532 _ant_script = "//build/android/ant/apk-package.xml" | 532 _ant_script = "//build/android/ant/apk-package.xml" |
533 | 533 |
534 depfile = "$target_gen_dir/$target_name.d" | 534 depfile = "$target_gen_dir/$target_name.d" |
535 | 535 |
536 inputs = [ | 536 inputs = [ |
537 _dex_path, | |
538 _resource_packaged_apk_path, | 537 _resource_packaged_apk_path, |
539 _ant_script, | 538 _ant_script, |
540 ] | 539 ] |
| 540 if (defined(_dex_path)) { |
| 541 inputs += [ _dex_path ] |
| 542 } |
541 | 543 |
542 outputs = [ | 544 outputs = [ |
543 depfile, | 545 depfile, |
544 _packaged_apk_path, | 546 _packaged_apk_path, |
545 ] | 547 ] |
546 | 548 |
547 _rebased_emma_jar = "" | 549 _rebased_emma_jar = "" |
548 _rebased_resource_packaged_apk_path = | 550 _rebased_resource_packaged_apk_path = |
549 rebase_path(_resource_packaged_apk_path, root_build_dir) | 551 rebase_path(_resource_packaged_apk_path, root_build_dir) |
550 _rebased_packaged_apk_path = rebase_path(_packaged_apk_path, root_build_dir) | 552 _rebased_packaged_apk_path = rebase_path(_packaged_apk_path, root_build_dir) |
551 _rebased_native_libs_dir = rebase_path(_native_libs_dir, root_build_dir) | 553 _rebased_native_libs_dir = rebase_path(_native_libs_dir, root_build_dir) |
552 _rebased_dex_path = rebase_path(_dex_path, root_build_dir) | |
553 args = [ | 554 args = [ |
554 "--depfile", | 555 "--depfile", |
555 rebase_path(depfile, root_build_dir), | 556 rebase_path(depfile, root_build_dir), |
556 "--", | 557 "--", |
557 "-quiet", | 558 "-quiet", |
558 "-DANDROID_SDK_ROOT=$rebased_android_sdk_root", | 559 "-DANDROID_SDK_ROOT=$rebased_android_sdk_root", |
559 "-DANDROID_SDK_TOOLS=$rebased_android_sdk_build_tools", | 560 "-DANDROID_SDK_TOOLS=$rebased_android_sdk_build_tools", |
560 "-DRESOURCE_PACKAGED_APK_NAME=$_rebased_resource_packaged_apk_path", | 561 "-DRESOURCE_PACKAGED_APK_NAME=$_rebased_resource_packaged_apk_path", |
561 "-DCONFIGURATION_NAME=$_configuration_name", | 562 "-DCONFIGURATION_NAME=$_configuration_name", |
562 "-DNATIVE_LIBS_DIR=$_rebased_native_libs_dir", | 563 "-DNATIVE_LIBS_DIR=$_rebased_native_libs_dir", |
563 "-DOUT_DIR=", | 564 "-DOUT_DIR=", |
564 "-DUNSIGNED_APK_PATH=$_rebased_packaged_apk_path", | 565 "-DUNSIGNED_APK_PATH=$_rebased_packaged_apk_path", |
565 "-DEMMA_INSTRUMENT=0", | 566 "-DEMMA_INSTRUMENT=0", |
566 "-DEMMA_DEVICE_JAR=$_rebased_emma_jar", | 567 "-DEMMA_DEVICE_JAR=$_rebased_emma_jar", |
567 "-DDEX_FILE_PATH=$_rebased_dex_path", | |
568 "-Dbasedir=.", | 568 "-Dbasedir=.", |
569 "-buildfile", | 569 "-buildfile", |
570 rebase_path(_ant_script, root_build_dir), | 570 rebase_path(_ant_script, root_build_dir), |
571 ] | 571 ] |
| 572 if (defined(_dex_path)) { |
| 573 _rebased_dex_path = rebase_path(_dex_path, root_build_dir) |
| 574 args += [ |
| 575 "-DDEX_FILE_PATH=$_rebased_dex_path", |
| 576 "-DHAS_CODE=true", |
| 577 ] |
| 578 } else { |
| 579 args += [ "-DHAS_CODE=false" ] |
| 580 } |
572 } | 581 } |
573 | 582 |
574 action("${target_name}__finalize") { | 583 action("${target_name}__finalize") { |
575 script = "//build/android/gyp/finalize_apk.py" | 584 script = "//build/android/gyp/finalize_apk.py" |
576 depfile = "$target_gen_dir/$target_name.d" | 585 depfile = "$target_gen_dir/$target_name.d" |
577 | 586 |
578 sources = [ | 587 sources = [ |
579 _packaged_apk_path, | 588 _packaged_apk_path, |
580 ] | 589 ] |
581 inputs = [ | 590 inputs = [ |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1221 outputs = [ | 1230 outputs = [ |
1222 depfile, | 1231 depfile, |
1223 invoker.out_manifest, | 1232 invoker.out_manifest, |
1224 ] | 1233 ] |
1225 inputs = [ | 1234 inputs = [ |
1226 invoker.main_manifest, | 1235 invoker.main_manifest, |
1227 ] | 1236 ] |
1228 args = _args | 1237 args = _args |
1229 } | 1238 } |
1230 } | 1239 } |
OLD | NEW |