Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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/rules.gni") | 5 import("//build/config/android/rules.gni") |
| 6 import("//mojo/public/mojo_application.gni") | 6 import("//mojo/public/mojo_application.gni") |
| 7 | 7 |
| 8 servicess_android_path = get_path_info(".", "abspath") | |
|
blundell
2015/05/11 14:49:14
hmm, if this is intended to be available to consum
qsr
2015/05/11 14:56:27
Acknowledged.
| |
| 9 | |
| 8 template("mojo_android_java_application") { | 10 template("mojo_android_java_application") { |
| 9 assert(defined(invoker.mojo_main)) | 11 assert(defined(invoker.mojo_main)) |
| 10 | 12 |
| 11 dex_output_path = "$target_out_dir/${target_name}.dex.jar" | 13 dex_output_path = "$target_out_dir/${target_name}.dex.jar" |
| 14 dex_with_manifest_output_path = | |
| 15 "$target_out_dir/${target_name}_with_manifest.dex.jar" | |
| 12 | 16 |
| 13 android_lib_name = "__${target_name}_lib" | 17 android_lib_name = "__${target_name}_lib" |
| 14 android_standalone_name = "__${target_name}_standalone" | 18 android_standalone_name = "__${target_name}_standalone" |
| 19 android_with_manifest_name = "__${target_name}_with_manifest" | |
| 15 | 20 |
| 16 all_deps = [ | 21 all_deps = [ |
| 17 "//mojo/public/java:bindings", | 22 "//mojo/public/java:bindings", |
| 18 "//mojo/public/java:system", | 23 "//mojo/public/java:system", |
| 19 ] | 24 ] |
| 20 if (defined(invoker.deps)) { | 25 if (defined(invoker.deps)) { |
| 21 all_deps += invoker.deps | 26 all_deps += invoker.deps |
| 22 } | 27 } |
| 23 | 28 |
| 24 android_library(android_lib_name) { | 29 android_library(android_lib_name) { |
| 25 java_files = invoker.sources | 30 java_files = invoker.sources |
| 26 | 31 |
| 27 manifest_entries = [ "Mojo-Class:" + invoker.mojo_main ] | 32 manifest_entries = [ "Mojo-Class:" + invoker.mojo_main ] |
|
blundell
2015/05/11 14:49:14
is there still a point to this?
qsr
2015/05/11 14:56:27
Removed
| |
| 28 | 33 |
| 29 deps = all_deps | 34 deps = all_deps |
| 30 } | 35 } |
| 31 | 36 |
| 32 android_standalone_library(android_standalone_name) { | 37 android_standalone_library(android_standalone_name) { |
| 33 deps = [ ":${android_lib_name}" ] + all_deps | 38 deps = [ ":${android_lib_name}" ] + all_deps |
| 34 | 39 |
| 35 dex_path = dex_output_path | 40 dex_path = dex_output_path |
| 36 | 41 |
| 37 system_gen_dir = get_path_info("//mojo/public/java/BUILD.gn", "gen_dir") | 42 system_gen_dir = get_path_info("//mojo/public/java/BUILD.gn", "gen_dir") |
| 38 excluded_jars = [ "${system_gen_dir}/system.dex.jar" ] | 43 excluded_jars = [ "${system_gen_dir}/system.dex.jar" ] |
| 39 } | 44 } |
| 40 | 45 |
| 46 action(android_with_manifest_name) { | |
| 47 script = "${servicess_android_path}/add_manifest_entry.py" | |
| 48 | |
| 49 input = dex_output_path | |
| 50 inputs = [ | |
| 51 input, | |
| 52 ] | |
| 53 | |
| 54 output = dex_with_manifest_output_path | |
| 55 outputs = [ | |
| 56 output, | |
| 57 ] | |
| 58 | |
| 59 rebase_input = rebase_path(input) | |
| 60 rebase_output = rebase_path(output) | |
| 61 mojo_main = invoker.mojo_main | |
| 62 args = [ | |
| 63 "--input=$rebase_input", | |
| 64 "--output=$rebase_output", | |
| 65 "--key=Mojo-Class", | |
| 66 "--value=$mojo_main", | |
| 67 ] | |
| 68 } | |
| 69 | |
| 41 if (defined(invoker.output_name)) { | 70 if (defined(invoker.output_name)) { |
| 42 mojo_output = "$root_out_dir/" + invoker.output_name + ".mojo" | 71 mojo_output = "$root_out_dir/" + invoker.output_name + ".mojo" |
| 43 } else { | 72 } else { |
| 44 mojo_output = "$root_out_dir/" + target_name + ".mojo" | 73 mojo_output = "$root_out_dir/" + target_name + ".mojo" |
| 45 } | 74 } |
| 46 | 75 |
| 47 action(target_name) { | 76 action(target_name) { |
| 48 script = rebase_path("mojo/public/tools/prepend.py", ".", mojo_root) | 77 script = rebase_path("mojo/public/tools/prepend.py", ".", mojo_root) |
| 49 | 78 |
| 50 input = dex_output_path | 79 input = dex_with_manifest_output_path |
| 51 inputs = [ | 80 inputs = [ |
| 52 input, | 81 input, |
| 53 ] | 82 ] |
| 54 | 83 |
| 55 output = mojo_output | 84 output = mojo_output |
| 56 outputs = [ | 85 outputs = [ |
| 57 output, | 86 output, |
| 58 ] | 87 ] |
| 59 | 88 |
| 60 rebase_input = rebase_path(input, root_build_dir) | 89 rebase_input = rebase_path(input, root_build_dir) |
| 61 rebase_output = rebase_path(output, root_build_dir) | 90 rebase_output = rebase_path(output, root_build_dir) |
| 62 args = [ | 91 args = [ |
| 63 "--input=$rebase_input", | 92 "--input=$rebase_input", |
| 64 "--output=$rebase_output", | 93 "--output=$rebase_output", |
| 65 "--line=#!mojo mojo:java_handler", | 94 "--line=#!mojo mojo:java_handler", |
| 66 ] | 95 ] |
| 67 } | 96 } |
| 68 } | 97 } |
| OLD | NEW |