Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: web_apks/minting_example/BUILD.gn

Issue 1945303005: Change webapk packages and directory structure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « web_apks/minting_example/AndroidManifest.xml ('k') | web_apks/minting_example/OWNERS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 minting_example_dir = "//web_apks/minting_example"
27 minting_libs_dir = "$minting_example_dir/libs"
28 minting_client_dir = "$minting_libs_dir/client"
29 minting_common_dir = "$minting_libs_dir/common"
30 minting_runtime_library_dir = "$minting_libs_dir/runtime_library"
31 minting_runtime_library_junit_dir =
32 "$minting_example_dir/junit/libs/runtime_library"
33
34 runtime_dex_version = 1
35 runtime_dex_asset_name = "web_apk$runtime_dex_version.dex"
36
37 minting_example_manifest =
38 "$target_gen_dir/minting_example_manifest/AndroidManifest.xml"
39
40 jinja_template("minting_example_manifest") {
41 input = "$minting_example_dir/AndroidManifest.xml"
42 output = minting_example_manifest
43
44 # The variable values must be non empty and globally unique in
45 # AndroidManifest.xml in order for the string substitution in APKMinting.java
46 # to work.
47 variables = [
48 "manifest_package=$manifest_package_minting.$manifest_package_minting_origin ",
49 "min_sdk_version=16",
50 "target_sdk_version=23",
51 "host_url=$host_url",
52 "runtime_host=$runtime_host",
53 "scope_url_host=$scope_url_host",
54 "mac=$mac",
55 "scope=$scope",
56 ]
57 }
58
59 android_resources("minting_apk_resources") {
60 resource_dirs = [ "$minting_example_dir/res" ]
61 custom_package = "$manifest_package_minting"
62 }
63
64 android_library("minting_client_lib") {
65 java_files = [
66 "$minting_client_dir/org/chromium/minting/lib/client/DexOptimizer.java",
67 "$minting_client_dir/org/chromium/minting/lib/client/WebApkStateParams.java" ,
68 "$minting_client_dir/org/chromium/minting/lib/client/NavigationClient.java",
69 "$minting_client_dir/org/chromium/minting/lib/client/NotificationBuilderDele gate.java",
70 "$minting_client_dir/org/chromium/minting/lib/client/NotificationClient.java ",
71 "$minting_client_dir/org/chromium/minting/lib/client/WebApkValidator.java",
72 "$minting_client_dir/org/chromium/minting/lib/client/WebApkSwitches.java",
73 "$minting_client_dir/org/chromium/minting/lib/client/WebApkVersionManager.ja va",
74 ]
75 deps = [
76 ":minting_common_lib",
77 "//base:base_java",
78 "//third_party/android_tools:android_support_v13_java",
79 ]
80 srcjar_deps = [
81 ":minting_service_aidl",
82 ":runtime_dex_version_java",
83 ]
84 }
85
86 java_cpp_template("runtime_dex_version_java") {
87 package_name = "org/chromium/minting/lib/client"
88 sources = [
89 "$minting_client_dir/org/chromium/minting/lib/client/WebApkVersion.template" ,
90 ]
91 defines = [ "CURRENT_RUNTIME_DEX_VERSION_VALUE=$runtime_dex_version" ]
92 }
93
94 android_library("minting_common_lib") {
95 java_files = [
96 "$minting_common_dir/org/chromium/minting/lib/common/WebApkConstants.java",
97 "$minting_common_dir/org/chromium/minting/lib/common/WebApkUtils.java",
98 ]
99 }
100
101 android_aidl("minting_service_aidl") {
102 import_include = "$minting_runtime_library_dir/src/org/chromium/minting/libs/r untime_library"
103 interface_file = "$minting_runtime_library_dir/src/org/chromium/minting/libs/r untime_library/common.aidl"
104 sources = [
105 "$minting_runtime_library_dir/src/org/chromium/minting/libs/runtime_library/ IWebApkApi.aidl",
106 ]
107 }
108
109 android_library("minting_runtime_library") {
110 dex_path = "$target_gen_dir/$runtime_dex_asset_name"
111 java_files = [ "$minting_runtime_library_dir/src/org/chromium/minting/libs/run time_library/WebApkServiceImpl.java" ]
112 chromium_code = false
113 srcjar_deps = [ ":minting_service_aidl" ]
114 }
115
116 android_assets("minting_runtime_library_assets") {
117 write_file("$target_gen_dir/web_apk_dex_version.txt", runtime_dex_version)
118
119 sources = [
120 "$target_gen_dir/$runtime_dex_asset_name",
121 "$target_gen_dir/web_apk_dex_version.txt",
122 ]
123 disable_compression = true
124
125 deps = [
126 ":minting_runtime_library",
127 ]
128 }
129
130 android_library("dex_loader_lib") {
131 java_files =
132 [ "$minting_example_dir/src/org/chromium/minting/DexLoader.java" ]
133 }
134
135 android_apk("minting_example_apk") {
136 android_manifest = minting_example_manifest
137 apk_name = "MintingExample.$manifest_package_minting_origin"
138 native_lib_placeholders = [ "libfoo.so" ]
139 java_files = [
140 "$minting_example_dir/src/org/chromium/minting/MainActivity.java",
141 "$minting_example_dir/src/org/chromium/minting/WebApkApplication.java",
142 "$minting_example_dir/src/org/chromium/minting/WebApkServiceFactory.java",
143 "$minting_example_dir/src/org/chromium/minting/Reflect.java",
144 ]
145 chromium_code = false
146 proguard_enabled = true
147 proguard_configs = [ "proguard.flags" ]
148 deps = [
149 ":dex_loader_lib",
150 ":minting_apk_resources",
151 ":minting_common_lib",
152 ":minting_example_manifest",
153 ]
154 }
155
156 android_library("web_apk_javatests") {
157 testonly = true
158 java_files = [ "$minting_example_dir/javatests/src/org/chromium/minting/DexLoa derTest.java" ]
159 deps = [
160 ":dex_loader_lib",
161 ":minting_common_lib",
162 "//base:base_java",
163 "//content/public/test/android:content_java_test_support",
164 ]
165 srcjar_deps = [ "//web_apks/minting_example/javatests/dex_optimizer:dex_optimi zer_service_aidl" ]
166 }
167
168 junit_binary("minting_runtime_library_junit_tests") {
169 java_files = [ "$minting_runtime_library_junit_dir/src/org/chromium/minting/li bs/runtime_library/WebApkServiceImplTest.java" ]
170 deps = [
171 ":minting_runtime_library",
172 "//base:base_java",
173 "//base:base_junit_test_support",
174 ]
175 }
OLDNEW
« no previous file with comments | « web_apks/minting_example/AndroidManifest.xml ('k') | web_apks/minting_example/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698