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 | 6 |
7 declare_args() { | 7 declare_args() { |
8 # The origin URL of the WebAPK. Used to generate a unique package name for | 8 # The origin URL of the WebAPK. Used to generate a unique package name for |
9 # WebAPK. Example: "foo.com" | 9 # WebAPK. Example: "foo.com" |
10 webapk_manifest_package_origin = "template" | 10 webapk_manifest_package_origin = "template" |
11 | 11 |
12 # The URL that the WebAPK should navigate to when it is launched. | 12 # The URL that the WebAPK should navigate to when it is launched. |
13 webapk_start_url = "https://www.template.com/home_page" | 13 webapk_start_url = "https://www.template.com/home_page" |
14 | 14 |
15 # The browser that the WebAPK will be bound to. | 15 # The browser that the WebAPK will be bound to. |
16 webapk_runtime_host = "com.google.android.apps.chrome" | 16 webapk_runtime_host = "com.google.android.apps.chrome" |
17 | 17 |
18 # The message authentication code from Chrome for identity verification. | 18 # The message authentication code from Chrome for identity verification. |
19 webapk_mac = "template" | 19 webapk_mac = "template" |
20 | 20 |
21 # The scope of the urls that the WebAPK can navigate to. | 21 # The scope of the urls that the WebAPK can navigate to. |
22 webapk_scope = "https://www.template.com" | 22 webapk_scope_url = "https://www.template.com" |
| 23 |
| 24 # Host part of |webapk_scope|. |
| 25 webapk_scope_url_host = "www.template.com" |
23 } | 26 } |
24 | 27 |
25 shell_apk_manifest_package = | 28 shell_apk_manifest_package = |
26 "org.chromium.webapk.$webapk_manifest_package_origin" | 29 "org.chromium.webapk.$webapk_manifest_package_origin" |
27 | 30 |
28 shell_apk_manifest = "$target_gen_dir/shell_apk_manifest/AndroidManifest.xml" | 31 shell_apk_manifest = "$target_gen_dir/shell_apk_manifest/AndroidManifest.xml" |
29 | 32 |
30 jinja_template("shell_apk_manifest") { | 33 jinja_template("shell_apk_manifest") { |
31 input = "AndroidManifest.xml" | 34 input = "AndroidManifest.xml" |
32 output = shell_apk_manifest | 35 output = shell_apk_manifest |
33 | 36 |
34 variables = [ | 37 variables = [ |
35 "manifest_package=$shell_apk_manifest_package", | 38 "manifest_package=$shell_apk_manifest_package", |
36 "host_url=$webapk_start_url", | 39 "host_url=$webapk_start_url", |
37 "runtime_host=$webapk_runtime_host", | 40 "runtime_host=$webapk_runtime_host", |
38 "mac=$webapk_mac", | 41 "mac=$webapk_mac", |
39 "scope=$webapk_scope", | 42 "scope_url=$webapk_scope_url", |
| 43 "scope_url_host=$webapk_scope_url_host", |
40 ] | 44 ] |
41 } | 45 } |
42 | 46 |
43 android_resources("shell_apk_resources") { | 47 android_resources("shell_apk_resources") { |
44 resource_dirs = [ "res" ] | 48 resource_dirs = [ "res" ] |
45 custom_package = "org.chromium.webapk.shell_apk" | 49 custom_package = "org.chromium.webapk.shell_apk" |
46 } | 50 } |
47 | 51 |
48 # Template for WebAPK. When a WebAPK is generated: | 52 # Template for WebAPK. When a WebAPK is generated: |
49 # - Android manifest is customized to the website. | 53 # - Android manifest is customized to the website. |
50 # - App icon is extracted from the website and added to the APK's resources. | 54 # - App icon is extracted from the website and added to the APK's resources. |
51 android_apk("webapk") { | 55 android_apk("webapk") { |
52 android_manifest = shell_apk_manifest | 56 android_manifest = shell_apk_manifest |
53 apk_name = "WebApk.$webapk_manifest_package_origin" | 57 apk_name = "WebApk.$webapk_manifest_package_origin" |
54 java_files = [ "src/org/chromium/webapk/shell_apk/MainActivity.java" ] | 58 java_files = [ "src/org/chromium/webapk/shell_apk/MainActivity.java" ] |
55 deps = [ | 59 deps = [ |
56 ":shell_apk_manifest", | 60 ":shell_apk_manifest", |
57 ":shell_apk_resources", | 61 ":shell_apk_resources", |
58 "//chrome/android/webapk/libs/common", | 62 "//chrome/android/webapk/libs/common", |
59 ] | 63 ] |
60 } | 64 } |
OLD | NEW |