OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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("//chrome/android/webapk/libs/runtime_library_version.gni") | 6 import("//chrome/android/webapk/libs/runtime_library_version.gni") |
7 | 7 |
8 # runtime_library_version.gni must be updated whenever the runtime library is | 8 # runtime_library_version.gni must be updated whenever the runtime library is |
9 # updated. The WebAPK re-extracts the runtime library from the Chrome APK when | 9 # updated. The WebAPK re-extracts the runtime library from the Chrome APK when |
10 # |runtime_library_version| is incremented. | 10 # |runtime_library_version| is incremented. |
11 | 11 |
12 # Whenever this constant is changed, WebApkUtils#getRuntimeDexName() must also | 12 # Whenever this constant is changed, WebApkUtils#getRuntimeDexName() must also |
13 # be changed. | 13 # be changed. |
14 runtime_library_dex_asset_name = "webapk$runtime_library_version.dex" | 14 runtime_library_dex_asset_name = "webapk$runtime_library_version.dex" |
15 | 15 |
16 android_aidl("webapk_service_aidl") { | 16 android_aidl("webapk_service_aidl") { |
17 import_include = "src/org/chromium/webapk/lib/runtime_library" | 17 import_include = "src/org/chromium/webapk/lib/runtime_library" |
18 interface_file = "src/org/chromium/webapk/lib/runtime_library/common.aidl" | 18 interface_file = "src/org/chromium/webapk/lib/runtime_library/common.aidl" |
19 sources = [ | 19 sources = [ |
20 "src/org/chromium/webapk/lib/runtime_library/IWebApkApi.aidl", | 20 "src/org/chromium/webapk/lib/runtime_library/IWebApkApi.aidl", |
21 ] | 21 ] |
22 } | 22 } |
23 | 23 |
24 android_library("runtime_library_java") { | 24 android_library("runtime_library_java") { |
25 dex_path = "$target_gen_dir/$runtime_library_dex_asset_name" | 25 # The dx tool expects files ending in .dex.jar |
| 26 dex_path = "$target_gen_dir/$runtime_library_dex_asset_name.jar" |
26 java_files = [ | 27 java_files = [ |
27 "src/org/chromium/webapk/lib/runtime_library/HostBrowserLauncher.java", | 28 "src/org/chromium/webapk/lib/runtime_library/HostBrowserLauncher.java", |
28 "src/org/chromium/webapk/lib/runtime_library/WebApkServiceImpl.java", | 29 "src/org/chromium/webapk/lib/runtime_library/WebApkServiceImpl.java", |
29 ] | 30 ] |
30 srcjar_deps = [ ":webapk_service_aidl" ] | 31 srcjar_deps = [ ":webapk_service_aidl" ] |
31 deps = [ | 32 deps = [ |
32 "//chrome/android/webapk/libs/common:common_java", | 33 "//chrome/android/webapk/libs/common:common_java", |
33 ] | 34 ] |
34 } | 35 } |
35 | 36 |
36 android_assets("runtime_library_assets") { | 37 android_assets("runtime_library_assets") { |
37 write_file("$target_gen_dir/webapk_dex_version.txt", runtime_library_version) | 38 write_file("$target_gen_dir/webapk_dex_version.txt", runtime_library_version) |
38 | 39 |
39 sources = [ | 40 sources = [ |
40 "$target_gen_dir/$runtime_library_dex_asset_name", | |
41 "$target_gen_dir/webapk_dex_version.txt", | 41 "$target_gen_dir/webapk_dex_version.txt", |
42 ] | 42 ] |
| 43 renaming_sources = [ "$target_gen_dir/$runtime_library_dex_asset_name.jar" ] |
| 44 renaming_destinations = [ "$runtime_library_dex_asset_name" ] |
43 disable_compression = true | 45 disable_compression = true |
44 | 46 |
45 deps = [ | 47 deps = [ |
46 ":runtime_library_java", | 48 ":runtime_library_java", |
47 ] | 49 ] |
48 } | 50 } |
49 | 51 |
50 junit_binary("webapk_runtime_library_junit_tests") { | 52 android_library("runtime_library_javatests") { |
51 java_files = [ "junit/src/org/chromium/webapk/lib/runtime_library/WebApkServic
eImplTest.java" ] | 53 testonly = true |
| 54 java_files = [ "javatests/src/org/chromium/webapk/lib/runtime_library/WebApkSe
rviceImplTest.java" ] |
52 deps = [ | 55 deps = [ |
53 ":runtime_library_java", | 56 ":runtime_library_java", |
54 "//base:base_junit_test_support", | 57 "//base:base_java_test_support", |
| 58 "//chrome/test/android:chrome_java_test_support", |
| 59 "//content/public/test/android:content_java_test_support", |
55 ] | 60 ] |
56 } | 61 } |
OLD | NEW |