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("//sky/build/skyx.gni") | 6 import("//sky/build/skyx.gni") |
7 | 7 |
8 template("sky_app") { | 8 template("sky_app") { |
9 skyx("app") { | 9 skyx("app") { |
10 main_dart = invoker.main_dart | 10 main_dart = invoker.main_dart |
11 | 11 |
12 if (defined(invoker.manifest)) { | 12 if (defined(invoker.manifest)) { |
13 manifest = invoker.manifest | 13 manifest = invoker.manifest |
14 } | 14 } |
15 | 15 |
16 if (defined(invoker.sources)) { | 16 if (defined(invoker.sources)) { |
17 sources = invoker.sources | 17 sources = invoker.sources |
18 } | 18 } |
19 } | 19 } |
20 | 20 |
| 21 bundle_prefix = target_name |
| 22 |
| 23 copy("copy_${bundle_prefix}_bundle") { |
| 24 sources = [ |
| 25 "$target_gen_dir/app.skyx", |
| 26 ] |
| 27 outputs = [ |
| 28 "$target_gen_dir/${bundle_prefix}.skyx", |
| 29 ] |
| 30 |
| 31 deps = [ |
| 32 ":app", |
| 33 ] |
| 34 } |
| 35 |
21 copy_ex("assets") { | 36 copy_ex("assets") { |
22 clear_dir = true | 37 clear_dir = true |
23 dest = "$target_gen_dir/assets" | 38 dest = "$target_gen_dir/assets" |
24 | 39 |
25 sources = [ | 40 sources = [ |
26 "$root_build_dir/icudtl.dat", | 41 "$root_build_dir/icudtl.dat", |
27 ] | 42 ] |
28 deps = [ | 43 deps = [ |
29 "//third_party/icu", | 44 "//third_party/icu", |
30 ] | 45 ] |
31 | 46 |
32 if (enable_skyx) { | 47 if (enable_skyx) { |
33 sources += [ "$target_gen_dir/app.skyx" ] | 48 sources += [ "$target_gen_dir/app.skyx" ] |
34 deps += [ ":app" ] | 49 deps += [ ":copy_${bundle_prefix}_bundle" ] |
| 50 |
| 51 if (defined(invoker.bundles)) { |
| 52 foreach(bundle, invoker.bundles) { |
| 53 bundle_gen_dir = get_label_info(bundle, "target_gen_dir") |
| 54 bundle_name = get_label_info(bundle, "name") |
| 55 |
| 56 sources += [ "$bundle_gen_dir/${bundle_name}.skyx" ] |
| 57 deps += [ bundle ] |
| 58 } |
| 59 } |
35 } | 60 } |
36 } | 61 } |
37 | 62 |
38 android_apk(target_name) { | 63 android_apk(target_name) { |
39 apk_name = invoker.apk_name | 64 apk_name = invoker.apk_name |
40 android_manifest = "apk/AndroidManifest.xml" | 65 android_manifest = "apk/AndroidManifest.xml" |
41 | 66 |
42 native_libs = [ "libsky_shell.so" ] | 67 native_libs = [ "libsky_shell.so" ] |
43 asset_location = "$target_gen_dir/assets" | 68 asset_location = "$target_gen_dir/assets" |
44 | 69 |
45 deps = [ | 70 deps = [ |
46 "//base:base_java", | 71 "//base:base_java", |
47 "//sky/shell:assets", | 72 "//sky/shell:assets", |
48 "//sky/shell:java", | 73 "//sky/shell:java", |
49 "//sky/shell:sky_shell", | 74 "//sky/shell:sky_shell", |
50 ":assets", | 75 ":assets", |
51 ] | 76 ] |
52 | 77 |
53 if (defined(invoker.deps)) { | 78 if (defined(invoker.deps)) { |
54 deps += invoker.deps | 79 deps += invoker.deps |
55 } | 80 } |
56 } | 81 } |
57 } | 82 } |
OLD | NEW |