OLD | NEW |
---|---|
(Empty) | |
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 | |
3 # found in the LICENSE file. | |
4 | |
5 import("//build/config/android/rules.gni") | |
6 import("//mojo/public/mojo_application.gni") | |
7 | |
8 template("mojo_android_java_application") { | |
9 assert(defined(invoker.mojo_main)) | |
10 | |
11 dex_output_path = "$target_out_dir/${target_name}.dex.jar" | |
12 | |
13 android_lib_name = "${target_name}_lib" | |
qsr
2015/02/06 17:16:14
Maybe prepend those names with __
I can imagine s
etiennej
2015/02/09 14:09:52
Done.
| |
14 android_standalone_name = "${target_name}_standalone" | |
15 | |
16 all_deps = [ | |
17 "//mojo/public/java:system", | |
18 "//mojo/public/java:bindings", | |
19 ] | |
20 if (defined(invoker.deps)) { | |
21 all_deps += invoker.deps | |
22 } | |
23 | |
24 android_library(android_lib_name) { | |
25 java_files = invoker.sources | |
26 | |
27 manifest_entries = [ "Mojo-Class:" + invoker.mojo_main ] | |
28 | |
29 deps = all_deps | |
30 } | |
31 | |
32 android_standalone_library(android_standalone_name) { | |
33 deps = [ ":${android_lib_name}" ] + all_deps | |
34 | |
35 dex_path = dex_output_path | |
36 } | |
37 | |
38 if (defined(invoker.output_name)) { | |
39 mojo_output = "$root_out_dir/" + invoker.output_name + ".mojo" | |
40 } else { | |
41 mojo_output = "$root_out_dir/" + target_name + ".mojo" | |
42 } | |
43 | |
44 action(target_name) { | |
45 script = rebase_path("mojo/public/tools/prepend.py", ".", mojo_root) | |
46 | |
47 input = dex_output_path | |
48 inputs = [ | |
49 input, | |
50 ] | |
51 | |
52 output = mojo_output | |
53 outputs = [ | |
54 output, | |
55 ] | |
56 | |
57 rebase_input = rebase_path(input, root_build_dir) | |
58 rebase_output = rebase_path(output, root_build_dir) | |
59 args = [ | |
60 "--input=$rebase_input", | |
61 "--output=$rebase_output", | |
62 "--line=#!mojo mojo:java_handler", | |
63 ] | |
64 } | |
65 } | |
OLD | NEW |