| OLD | NEW |
| (Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import("//build/config/android/rules.gni") |
| 6 |
| 7 declare_args() { |
| 8 # The origin URL of minted apks, for example: "foo.com" |
| 9 manifest_package_minting_origin = "template" |
| 10 |
| 11 # The browser to which WebAPKs will be bound. |
| 12 runtime_host = "com.google.android.apps.chrome" |
| 13 |
| 14 # The URL for the minted apks, for example: "https://foo.com" |
| 15 host_url = "https://www.template.com/home_page" |
| 16 scope_url_host = "www.template.com" |
| 17 |
| 18 # The message authentication code from Chrome for identity verification. |
| 19 mac = "template" |
| 20 |
| 21 # The scope of the Urls that the Minted APKs could navigate to. |
| 22 scope = "https://www.template.com" |
| 23 } |
| 24 |
| 25 manifest_package_minting = "org.chromium.minting" |
| 26 |
| 27 shell_apk_manifest = "$target_gen_dir/shell_apk_manifest/AndroidManifest.xml" |
| 28 |
| 29 jinja_template("shell_apk_manifest") { |
| 30 input = "AndroidManifest.xml" |
| 31 output = shell_apk_manifest |
| 32 |
| 33 # The variable values must be non empty and globally unique in |
| 34 # AndroidManifest.xml in order for the string substitution in APKMinting.java |
| 35 # to work. |
| 36 variables = [ |
| 37 "manifest_package=$manifest_package_minting.$manifest_package_minting_origin
", |
| 38 "min_sdk_version=16", |
| 39 "target_sdk_version=23", |
| 40 "host_url=$host_url", |
| 41 "runtime_host=$runtime_host", |
| 42 "scope_url_host=$scope_url_host", |
| 43 "mac=$mac", |
| 44 "scope=$scope", |
| 45 ] |
| 46 } |
| 47 |
| 48 android_resources("shell_apk_resources") { |
| 49 resource_dirs = [ "res" ] |
| 50 custom_package = "org.chromium.webapk.shell_apk" |
| 51 } |
| 52 |
| 53 android_library("dex_loader_lib") { |
| 54 java_files = [ "src/org/chromium/webapk/shell_apk/DexLoader.java" ] |
| 55 } |
| 56 |
| 57 android_apk("shell_apk") { |
| 58 android_manifest = shell_apk_manifest |
| 59 apk_name = "MintingExample.$manifest_package_minting_origin" |
| 60 native_lib_placeholders = [ "libfoo.so" ] |
| 61 java_files = [ |
| 62 "src/org/chromium/webapk/shell_apk/MainActivity.java", |
| 63 "src/org/chromium/webapk/shell_apk/WebApkApplication.java", |
| 64 "src/org/chromium/webapk/shell_apk/WebApkServiceFactory.java", |
| 65 "src/org/chromium/webapk/shell_apk/Reflect.java", |
| 66 ] |
| 67 chromium_code = false |
| 68 proguard_enabled = true |
| 69 proguard_configs = [ "proguard.flags" ] |
| 70 deps = [ |
| 71 ":dex_loader_lib", |
| 72 ":shell_apk_manifest", |
| 73 ":shell_apk_resources", |
| 74 "//webapk/libs/common", |
| 75 ] |
| 76 } |
| 77 |
| 78 android_library("shell_apk_javatests") { |
| 79 testonly = true |
| 80 java_files = |
| 81 [ "javatests/src/org/chromium/webapk/shell_apk/DexLoaderTest.java" ] |
| 82 deps = [ |
| 83 ":dex_loader_lib", |
| 84 "//base:base_java", |
| 85 "//content/public/test/android:content_java_test_support", |
| 86 "//webapk/libs/common", |
| 87 ] |
| 88 srcjar_deps = [ "javatests/dex_optimizer:dex_optimizer_service_aidl" ] |
| 89 } |
| OLD | NEW |