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 | 9 |
10 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) | 10 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 action(target_name) { | 78 action(target_name) { |
79 script = "//build/android/gyp/write_build_config.py" | 79 script = "//build/android/gyp/write_build_config.py" |
80 depfile = "$target_gen_dir/$target_name.d" | 80 depfile = "$target_gen_dir/$target_name.d" |
81 inputs = [] | 81 inputs = [] |
82 | 82 |
83 deps = [] | 83 deps = [] |
84 if (defined(invoker.deps)) { | 84 if (defined(invoker.deps)) { |
85 deps += invoker.deps | 85 deps += invoker.deps |
86 } | 86 } |
87 | 87 |
88 outputs = [ | |
89 depfile, | |
90 build_config | |
91 ] | |
92 | |
93 possible_deps_configs = [] | 88 possible_deps_configs = [] |
94 foreach(d, deps) { | 89 foreach(d, deps) { |
95 dep_gen_dir = get_label_info(d, "target_gen_dir") | 90 dep_gen_dir = get_label_info(d, "target_gen_dir") |
96 dep_name = get_label_info(d, "name") | 91 dep_name = get_label_info(d, "name") |
97 possible_deps_configs += [ "$dep_gen_dir/$dep_name.build_config" ] | 92 possible_deps_configs += [ "$dep_gen_dir/$dep_name.build_config" ] |
98 } | 93 } |
99 rebase_possible_deps_configs = rebase_path(possible_deps_configs) | 94 rebase_possible_deps_configs = rebase_path(possible_deps_configs) |
100 | 95 |
| 96 outputs = [ |
| 97 depfile, |
| 98 build_config |
| 99 ] |
| 100 |
101 args = [ | 101 args = [ |
102 "--type", type, | 102 "--type", type, |
103 "--depfile", rebase_path(depfile, root_build_dir), | 103 "--depfile", rebase_path(depfile, root_build_dir), |
104 "--possible-deps-configs=$rebase_possible_deps_configs", | 104 "--possible-deps-configs=$rebase_possible_deps_configs", |
105 "--build-config", rebase_path(build_config, root_build_dir), | 105 "--build-config", rebase_path(build_config, root_build_dir), |
106 ] | 106 ] |
107 | 107 |
108 if (type == "android_library" || type == "android_apk") { | 108 if (type == "android_library" || type == "android_apk") { |
109 args += [ | 109 args += [ |
110 "--jar-path", rebase_path(invoker.jar_path, root_build_dir), | 110 "--jar-path", rebase_path(invoker.jar_path, root_build_dir), |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 | 558 |
559 _srcjars = [] | 559 _srcjars = [] |
560 if (defined(invoker.srcjars)) { | 560 if (defined(invoker.srcjars)) { |
561 _srcjars = invoker.srcjars | 561 _srcjars = invoker.srcjars |
562 } | 562 } |
563 | 563 |
564 _java_files = [] | 564 _java_files = [] |
565 if (defined(invoker.java_files)) { | 565 if (defined(invoker.java_files)) { |
566 _java_files = invoker.java_files | 566 _java_files = invoker.java_files |
567 } else if (defined(invoker.DEPRECATED_java_in_dir)) { | 567 } else if (defined(invoker.DEPRECATED_java_in_dir)) { |
| 568 _src_dir = invoker.DEPRECATED_java_in_dir + "/src" |
| 569 _src_dir_exists = exec_script("//build/dir_exists.py", |
| 570 [ rebase_path(_src_dir, root_build_dir) ], |
| 571 "string") |
| 572 assert(_src_dir_exists == "False", |
| 573 "In GN, java_in_dir should be the fully specified java directory " + |
| 574 "(i.e. including the trailing \"/src\")") |
| 575 |
568 _java_files_build_rel = exec_script( | 576 _java_files_build_rel = exec_script( |
569 "//build/android/gyp/find.py", | 577 "//build/android/gyp/find.py", |
570 [ | 578 [ |
571 "--pattern", | 579 "--pattern", |
572 "*.java", | 580 "*.java", |
573 rebase_path(invoker.DEPRECATED_java_in_dir, root_build_dir) | 581 rebase_path(invoker.DEPRECATED_java_in_dir, root_build_dir) |
574 ], | 582 ], |
575 "list lines" | 583 "list lines" |
576 ) | 584 ) |
577 _java_files = rebase_path(_java_files_build_rel, ".", root_build_dir) | 585 _java_files = rebase_path(_java_files_build_rel, ".", root_build_dir) |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 args += invoker.args | 719 args += invoker.args |
712 } | 720 } |
713 } | 721 } |
714 } | 722 } |
715 | 723 |
716 template("copy_ex") { | 724 template("copy_ex") { |
717 if (defined(invoker.testonly)) { testonly = invoker.testonly } | 725 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
718 | 726 |
719 action(target_name) { | 727 action(target_name) { |
720 script = "//build/android/gyp/copy_ex.py" | 728 script = "//build/android/gyp/copy_ex.py" |
721 depfile = "$target_gen_dir/$target_name.d" | 729 |
722 outputs = [ | 730 if (defined(invoker.deps)) { deps = invoker.deps } |
723 depfile, | 731 |
724 ] | |
725 sources = [] | 732 sources = [] |
726 if (defined(invoker.sources)) { | 733 if (defined(invoker.sources)) { |
727 sources += invoker.sources | 734 sources += invoker.sources |
728 } | 735 } |
729 | 736 |
730 inputs = [] | 737 inputs = [] |
731 if (defined(invoker.inputs)) { | 738 if (defined(invoker.inputs)) { |
732 inputs += invoker.inputs | 739 inputs += invoker.inputs |
733 } | 740 } |
734 | 741 |
| 742 depfile = "$target_gen_dir/$target_name.d" |
| 743 outputs = [ |
| 744 depfile, |
| 745 ] |
| 746 |
735 args = [ | 747 args = [ |
736 "--depfile", rebase_path(depfile, root_build_dir), | 748 "--depfile", rebase_path(depfile, root_build_dir), |
737 "--dest", rebase_path(invoker.dest, root_build_dir), | 749 "--dest", rebase_path(invoker.dest, root_build_dir), |
738 ] | 750 ] |
739 if (defined(invoker.args)) { | |
740 args += invoker.args | |
741 } | |
742 rebased_sources = rebase_path(sources, root_build_dir) | 751 rebased_sources = rebase_path(sources, root_build_dir) |
743 args += [ "--files=$rebased_sources" ] | 752 args += [ "--files=$rebased_sources" ] |
744 | 753 |
745 if (defined(invoker.clear_dir) && invoker.clear_dir) { | 754 if (defined(invoker.clear_dir) && invoker.clear_dir) { |
746 args += ["--clear"] | 755 args += ["--clear"] |
747 } | 756 } |
| 757 |
| 758 if (defined(invoker.args)) { |
| 759 args += invoker.args |
| 760 } |
748 } | 761 } |
749 } | 762 } |
OLD | NEW |