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") |
| 7 |
| 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 |
| 10 # |runtime_library_version| is incremented. |
| 11 |
| 12 # Whenever this constant is changed, WebApkUtils#getRuntimeDexName() must also |
| 13 # be changed. |
| 14 runtime_library_dex_asset_name = "webapk$runtime_library_version.dex" |
6 | 15 |
7 android_aidl("webapk_service_aidl") { | 16 android_aidl("webapk_service_aidl") { |
8 import_include = "src/org/chromium/webapk/lib/runtime_library" | 17 import_include = "src/org/chromium/webapk/lib/runtime_library" |
9 interface_file = "src/org/chromium/webapk/lib/runtime_library/common.aidl" | 18 interface_file = "src/org/chromium/webapk/lib/runtime_library/common.aidl" |
10 sources = [ | 19 sources = [ |
11 "src/org/chromium/webapk/lib/runtime_library/IWebApkApi.aidl", | 20 "src/org/chromium/webapk/lib/runtime_library/IWebApkApi.aidl", |
12 ] | 21 ] |
13 } | 22 } |
14 | 23 |
15 android_library("runtime_library") { | 24 android_library("runtime_library") { |
16 dex_path = "$target_gen_dir/web_apk.dex" | 25 dex_path = "$target_gen_dir/$runtime_library_dex_asset_name" |
17 java_files = | 26 java_files = |
18 [ "src/org/chromium/webapk/lib/runtime_library/WebApkServiceImpl.java" ] | 27 [ "src/org/chromium/webapk/lib/runtime_library/WebApkServiceImpl.java" ] |
19 srcjar_deps = [ ":webapk_service_aidl" ] | 28 srcjar_deps = [ ":webapk_service_aidl" ] |
20 } | 29 } |
21 | 30 |
22 android_assets("runtime_library_assets") { | 31 android_assets("runtime_library_assets") { |
| 32 write_file("$target_gen_dir/webapk_dex_version.txt", runtime_library_version) |
| 33 |
23 sources = [ | 34 sources = [ |
24 "$target_gen_dir/web_apk.dex", | 35 "$target_gen_dir/$runtime_library_dex_asset_name", |
| 36 "$target_gen_dir/webapk_dex_version.txt", |
25 ] | 37 ] |
26 disable_compression = true | 38 disable_compression = true |
27 | 39 |
28 deps = [ | 40 deps = [ |
29 ":runtime_library", | 41 ":runtime_library", |
30 ] | 42 ] |
31 } | 43 } |
OLD | NEW |