| 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("manifest_processor.gni") | 6 import("manifest_processor.gni") |
| 7 import("shell_apk_version.gni") | 7 import("shell_apk_version.gni") |
| 8 | 8 |
| 9 declare_args() { | |
| 10 # The browser that the WebAPK will be bound to. | |
| 11 webapk_runtime_host = "com.google.android.apps.chrome" | |
| 12 | |
| 13 # The application name of the browser that the WebAPK will be bound to. | |
| 14 webapk_runtime_host_application_name = "Chromium" | |
| 15 | |
| 16 # The Url of the Web Manifest file. | |
| 17 webapk_web_manifest_url = "https://pwa.rocks/pwa.webmanifest" | |
| 18 | |
| 19 # Murmur2 hash of the homescreen icon. The hash should be of the icon as it is | |
| 20 # available from the web. The icon bytes should not be transformed (e.g. | |
| 21 # decoded / encoded) prior to taking the hash. | |
| 22 webapk_icon_murmur2_hash = "0" | |
| 23 | |
| 24 # Attributes from Web Manifest. | |
| 25 webapk_start_url = "https://pwa.rocks/" | |
| 26 webapk_scope_url = "https://pwa.rocks/" | |
| 27 webapk_display_mode = "standalone" | |
| 28 webapk_orientation = "portrait" | |
| 29 webapk_theme_color = "2147483648L" # HostBrowserLauncher#MANIFEST_COLOR_INVAL
ID_OR_MISSING | |
| 30 webapk_background_color = "2147483648L" #HostBrowserLauncher#MANIFEST_COLOR_I
NVALID_OR_MISSING | |
| 31 webapk_icon_urls_and_icon_murmur2_hashes = "http://www.pwa.rocks/icon1.png $we
bapk_icon_murmur2_hash http://www.pwa.rocks/icon2.png $webapk_icon_murmur2_hash" | |
| 32 | |
| 33 # Scheme part of |webapk_scope_url|. | |
| 34 webapk_scope_url_scheme = "https" | |
| 35 | |
| 36 # Host part of |webapk_scope_url|. | |
| 37 webapk_scope_url_host = "pwa.rocks" | |
| 38 | |
| 39 # Path part of |webapk_scope_url|. | |
| 40 webapk_scope_url_path = "/" | |
| 41 | |
| 42 # Android version code for the WebAPK. | |
| 43 webapk_version_code = "1" | |
| 44 | |
| 45 # Android version name for the WebAPK. | |
| 46 webapk_version_name = "1.0" | |
| 47 } | |
| 48 | |
| 49 shell_apk_manifest = "$target_gen_dir/shell_apk_manifest/AndroidManifest.xml" | 9 shell_apk_manifest = "$target_gen_dir/shell_apk_manifest/AndroidManifest.xml" |
| 50 unbound_shell_apk_manifest = | 10 unbound_shell_apk_manifest = |
| 51 "$target_gen_dir/unbound_shell_apk_manifest/AndroidManifest.xml" | 11 "$target_gen_dir/unbound_shell_apk_manifest/AndroidManifest.xml" |
| 52 shell_apk_manifest_javatests = | 12 shell_apk_manifest_javatests = |
| 53 "$target_gen_dir/shell_apk_manifest_javatests/AndroidManifest.xml" | 13 "$target_gen_dir/shell_apk_manifest_javatests/AndroidManifest.xml" |
| 54 | 14 |
| 55 manifest_processor_template("shell_apk_manifest") { | 15 manifest_processor_template("shell_apk_manifest") { |
| 56 input = "AndroidManifest.xml" | 16 input = "AndroidManifest.xml" |
| 17 config_file = "bound_manifest_config.json" |
| 57 output = shell_apk_manifest | 18 output = shell_apk_manifest |
| 58 | 19 |
| 59 variables = [ | 20 extra_variables = [ "shell_apk_version=$template_shell_apk_version" ] |
| 60 "shell_apk_version=$template_shell_apk_version", | |
| 61 "manifest_package=org.chromium.webapk", | |
| 62 "runtime_host=$webapk_runtime_host", | |
| 63 "runtime_host_application_name=$webapk_runtime_host_application_name", | |
| 64 "start_url=$webapk_start_url", | |
| 65 "scope_url=$webapk_scope_url", | |
| 66 "display_mode=$webapk_display_mode", | |
| 67 "orientation=$webapk_orientation", | |
| 68 "theme_color=$webapk_theme_color", | |
| 69 "background_color=$webapk_background_color", | |
| 70 "icon_urls_and_icon_murmur2_hashes=$webapk_icon_urls_and_icon_murmur2_hashes
", | |
| 71 "scope_url_scheme=$webapk_scope_url_scheme", | |
| 72 "scope_url_host=$webapk_scope_url_host", | |
| 73 "scope_url_path=$webapk_scope_url_path", | |
| 74 "web_manifest_url=$webapk_web_manifest_url", | |
| 75 "version_code=$webapk_version_code", | |
| 76 "version_name=$webapk_version_name", | |
| 77 ] | |
| 78 } | 21 } |
| 79 | 22 |
| 80 manifest_processor_template("unbound_shell_apk_manifest") { | 23 manifest_processor_template("unbound_shell_apk_manifest") { |
| 81 input = "AndroidManifest.xml" | 24 input = "AndroidManifest.xml" |
| 25 config_file = "unbound_manifest_config.json" |
| 82 output = unbound_shell_apk_manifest | 26 output = unbound_shell_apk_manifest |
| 83 | 27 |
| 84 variables = [ | 28 extra_variables = [ "shell_apk_version=$template_shell_apk_version" ] |
| 85 "shell_apk_version=$template_shell_apk_version", | |
| 86 "manifest_package=org.chromium.arbitrarypackage", | |
| 87 | |
| 88 # Intentionally omitted: "runtime_host=org.chromium.chrome", | |
| 89 "include_label=true", | |
| 90 "start_url=$webapk_start_url", | |
| 91 "scope_url=$webapk_scope_url", | |
| 92 "display_mode=$webapk_display_mode", | |
| 93 "orientation=$webapk_orientation", | |
| 94 "theme_color=$webapk_theme_color", | |
| 95 "background_color=$webapk_background_color", | |
| 96 "icon_urls_and_icon_murmur2_hashes=$webapk_icon_urls_and_icon_murmur2_hashes
", | |
| 97 "scope_url_scheme=$webapk_scope_url_scheme", | |
| 98 "scope_url_host=$webapk_scope_url_host", | |
| 99 "scope_url_path=$webapk_scope_url_path", | |
| 100 "web_manifest_url=$webapk_web_manifest_url", | |
| 101 "version_code=$webapk_version_code", | |
| 102 "version_name=$webapk_version_name", | |
| 103 ] | |
| 104 } | 29 } |
| 105 | 30 |
| 106 # Manifest for instrumentation tests. Cannot be customized via GN args. | 31 # Manifest for instrumentation tests. Cannot be customized via GN args. |
| 107 manifest_processor_template("shell_apk_manifest_javatests") { | 32 manifest_processor_template("shell_apk_manifest_javatests") { |
| 108 input = "AndroidManifest.xml" | 33 input = "AndroidManifest.xml" |
| 34 config_file = "javatest_manifest_config.json" |
| 109 output = shell_apk_manifest_javatests | 35 output = shell_apk_manifest_javatests |
| 110 | 36 |
| 111 variables = [ | 37 extra_variables = [ "shell_apk_version=$template_shell_apk_version" ] |
| 112 "shell_apk_version=$template_shell_apk_version", | |
| 113 "manifest_package=org.chromium.webapk.test", | |
| 114 "runtime_host=org.chromium.chrome", | |
| 115 "start_url=https://pwa.rocks", | |
| 116 "scope_url=https://pwa.rocks", | |
| 117 "display_mode=standalone", | |
| 118 "orientation=portrait", | |
| 119 "theme_color=2147483648L", # HostBrowserLauncher#MANIFEST_COLOR_INVALID_OR_
MISSING | |
| 120 "background_color=2147483648L", # HostBrowserLauncher#MANIFEST_COLOR_INVALI
D_OR_MISSING | |
| 121 "icon_urls_and_icon_murmur2_hashes=", | |
| 122 "scope_url_scheme=https", | |
| 123 "scope_url_host=pwa.rocks", | |
| 124 "scope_url_path=/", | |
| 125 "web_manifest_url=https://pwa.rocks/pwa.webmanifest", | |
| 126 "version_code=1", | |
| 127 "version_name=1.0", | |
| 128 ] | |
| 129 } | 38 } |
| 130 | 39 |
| 131 android_resources("shell_apk_resources") { | 40 android_resources("shell_apk_resources") { |
| 132 resource_dirs = [ "res" ] | 41 resource_dirs = [ "res" ] |
| 133 custom_package = "org.chromium.webapk.shell_apk" | 42 custom_package = "org.chromium.webapk.shell_apk" |
| 134 deps = [ | 43 deps = [ |
| 135 ":webapk_strings_grd", | 44 ":webapk_strings_grd", |
| 136 ] | 45 ] |
| 137 } | 46 } |
| 138 | 47 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 "//chrome/android/webapk/libs/common:common_java", | 181 "//chrome/android/webapk/libs/common:common_java", |
| 273 "//content/public/test/android:content_java_test_support", | 182 "//content/public/test/android:content_java_test_support", |
| 274 "//third_party/android_support_test_runner:runner_java", | 183 "//third_party/android_support_test_runner:runner_java", |
| 275 ] | 184 ] |
| 276 srcjar_deps = [ "javatests/dex_optimizer:dex_optimizer_service_aidl" ] | 185 srcjar_deps = [ "javatests/dex_optimizer:dex_optimizer_service_aidl" ] |
| 277 } | 186 } |
| 278 | 187 |
| 279 junit_binary("webapk_shell_apk_junit_tests") { | 188 junit_binary("webapk_shell_apk_junit_tests") { |
| 280 java_files = [ | 189 java_files = [ |
| 281 "junit/src/org/chromium/webapk/shell_apk/HostBrowserClassLoaderTest.java", | 190 "junit/src/org/chromium/webapk/shell_apk/HostBrowserClassLoaderTest.java", |
| 191 "junit/src/org/chromium/webapk/shell_apk/MainActivityTest.java", |
| 282 "junit/src/org/chromium/webapk/shell_apk/WebApkUtilsTest.java", | 192 "junit/src/org/chromium/webapk/shell_apk/WebApkUtilsTest.java", |
| 283 ] | 193 ] |
| 284 deps = [ | 194 deps = [ |
| 285 ":webapk_java", | 195 ":webapk_java", |
| 286 "//chrome/android/webapk/libs/common:common_java", | 196 "//chrome/android/webapk/libs/common:common_java", |
| 287 "//chrome/android/webapk/test:junit_test_support", | 197 "//chrome/android/webapk/test:junit_test_support", |
| 288 ] | 198 ] |
| 289 } | 199 } |
| OLD | NEW |