blob: 12f393e7af863bde566ed9df22e717a59e97f88d [file] [log] [blame]
Colin Cross9a51b152017-08-29 16:04:52 -07001//
2// Copyright (C) 2017 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
Paul Duffind772e592019-06-03 16:09:02 +010017package {
18 default_visibility: ["//visibility:private"],
19}
20
Colin Cross9a51b152017-08-29 16:04:52 -070021//==========================================================
22// build repackaged ICU for target
23//
24// This is done in the libcore/JavaLibraries.mk file as there are circular
25// dependencies between ICU and libcore
26//==========================================================
27filegroup {
Victor Changc9ae0db2019-10-28 18:56:09 +000028 name: "android_icu4j_public_api_files",
Paul Duffind772e592019-06-03 16:09:02 +010029 visibility: [
Paul Duffin2a0b1a52019-09-30 13:22:57 +010030 "//libcore:__subpackages__",
Paul Duffind772e592019-06-03 16:09:02 +010031 ],
Victor Chang92c3bcf2019-10-07 11:36:39 +010032 srcs: [
33 ":android_icu4j_repackaged_src_files",
Victor Chang92c3bcf2019-10-07 11:36:39 +010034 ],
Jiyong Park684fe8a2019-08-19 13:23:42 +090035 path: "src/main/java",
Colin Cross9a51b152017-08-29 16:04:52 -070036}
37
Victor Chang92c3bcf2019-10-07 11:36:39 +010038filegroup {
39 name: "android_icu4j_repackaged_src_files",
40 srcs: ["src/main/java/android/icu/**/*.java"],
41 path: "src/main/java",
42}
43
44// The files contains Android-specific codes to expose intra-core APIs
45// from ICU4J/ICU4C to libcore. The package is com.android.icu.* and should not
46// expose any public APIs.
47filegroup {
48 name: "libcore_icu_bridge_src_files",
Victor Changc9ae0db2019-10-28 18:56:09 +000049 srcs: ["libcore_bridge/src/java/**/*.java"],
50 path: "libcore_bridge/src/java",
Victor Chang92c3bcf2019-10-07 11:36:39 +010051}
52
53// Rule generating resource lib for android_icu4j.
54// In the downstream branch master-icu-dev, the resource files are generated.
55java_library {
56 name: "android_icu4j_resources_lib",
57 visibility: [
58 "//libcore",
59 ],
60 java_resource_dirs: ["resources"],
61 sdk_version: "none",
62 system_modules: "none",
63}
64
65// Same as android_icu4j_resources_lib but compiling against core_current sdk
66// in order to avoid using non-public API from core-libart and core-oj
67// because core-icu4j will be in a different i18n APEX module.
68
69java_library {
70 name: "android_icu4j_resources_lib_sdk_core_current",
71 visibility: [
72 "//libcore",
73 ],
74 java_resource_dirs: ["resources"],
75 sdk_version: "core_current",
76}
77
78// core-repackaged-icu4j contains only the repackaged ICU4J that does not
79// use any internal or android specific code. If it ever did then it could depend on
80// art-module-intra-core-api-stubs-system-modules (a superset) instead.
81// It is important that core-icu4j is restricted to only use stable APIs from the ART module
82// since it is in a different APEX module that can be updated independently.
83java_library_static {
84 name: "core-repackaged-icu4j",
85 installable: false,
86 srcs: [":android_icu4j_repackaged_src_files"],
Artur Satayev2fc4dc32019-12-10 12:12:35 +000087 libs: ["unsupportedappusage"],
Victor Chang92c3bcf2019-10-07 11:36:39 +010088 // The resource files are generated in the downstream branch master-icu-dev.
89 java_resource_dirs: ["resources"],
90
91 sdk_version: "none",
92 system_modules: "art-module-public-api-stubs-system-modules",
93
94 dxflags: ["--core-library"],
95 errorprone: {
96 javacflags: [
97 "-Xep:MissingOverride:OFF", // Ignore missing @Override.
98 "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom
99 ],
100 },
101}
102
Paul Duffind31a0602019-09-26 16:23:55 +0100103// A separated core library that contains ICU4J because ICU4J will be in a different APEX module,
104// not in ART module.
105java_library {
106 name: "core-icu4j",
107 visibility: [
108 "//art/build/apex",
109 "//external/robolectric-shadows",
110 "//frameworks/layoutlib",
111 ],
Jiyong Park0ddd1ef2019-12-19 02:11:30 +0000112 apex_available: [
113 "com.android.art.release",
114 "com.android.art.debug",
115 ],
Paul Duffind31a0602019-09-26 16:23:55 +0100116 installable: true,
117 hostdex: true,
118
Victor Chang92c3bcf2019-10-07 11:36:39 +0100119 srcs: [":libcore_icu_bridge_src_files"],
120 static_libs: ["core-repackaged-icu4j"],
Paul Duffin2626a2a2019-10-08 15:17:42 +0100121
Paul Duffind31a0602019-09-26 16:23:55 +0100122 // It is important that core-icu4j is restricted to only use stable APIs from the ART module
123 // since it is in a different APEX module that can be updated independently.
124 sdk_version: "none",
Victor Chang92c3bcf2019-10-07 11:36:39 +0100125 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffind31a0602019-09-26 16:23:55 +0100126
127 dxflags: ["--core-library"],
Paul Duffind31a0602019-09-26 16:23:55 +0100128}
129
130//
131// Guaranteed unstripped versions of core-icu4j.
132//
133// The build system may or may not strip the core-icu4j. jar,
134// but this will not be stripped. See b/24535627.
135//
136java_library {
137 name: "core-icu4j-testdex",
138 installable: true,
139 static_libs: ["core-icu4j"],
140 sdk_version: "none",
141 system_modules: "art-module-public-api-stubs-system-modules",
142 dxflags: ["--core-library"],
143 dex_preopt: {
144 enabled: false,
145 },
146}
147
148// Generates stubs for the parts of the public SDK API provided by the i18n module.
149//
150// Only for use by i18n.module.public.api.stubs target below.
151droidstubs {
152 name: "i18n-module-public-api-stubs-gen",
153 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000154 ":android_icu4j_public_api_files",
Paul Duffind31a0602019-09-26 16:23:55 +0100155 ],
156 java_version: "1.9",
157 installable: false,
158 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100159 system_modules: "art-module-public-api-stubs-system-modules",
Paul Duffind31a0602019-09-26 16:23:55 +0100160}
161
162// A stubs target containing the parts of the public SDK API provided by the i18n module.
163java_library {
164 name: "i18n.module.public.api.stubs",
165 visibility: [
166 "//libcore",
167 ],
168 srcs: [":i18n-module-public-api-stubs-gen"],
169 errorprone: {
170 javacflags: [
171 "-Xep:MissingOverride:OFF",
172 ],
173 },
174 sdk_version: "none",
175 system_modules: "art-module-public-api-stubs-system-modules",
176}
177
Paul Duffincff90fa2019-10-02 10:18:28 +0100178// Generates stub source files for the intra-core API of the I18N module.
179// i.e. every class/member that is either in the public API or annotated with
180// @IntraCoreApi.
181//
182// The API specification .txt files managed by this only contain the additional
183// classes/members that are in the intra-core API but which are not the public
184// API.
185droidstubs {
186 name: "i18n-module-intra-core-api-stubs-source",
187 visibility: [
188 // Needed to build core-all as using the compiled library, i.e.
189 // i18n.module.intra.core.api.stubs does not work due to limitations
190 // in javac.
191 "//libcore:__subpackages__",
192 ],
193 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000194 ":android_icu4j_repackaged_src_files",
195 ":libcore_icu_bridge_src_files",
Paul Duffincff90fa2019-10-02 10:18:28 +0100196 ],
197 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100198 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffincff90fa2019-10-02 10:18:28 +0100199
200 installable: false,
201 args: "--hide-annotation libcore.api.Hide " +
202 "--show-single-annotation libcore.api.IntraCoreApi " +
203 "--skip-annotation-instance-methods=false ",
204
205 api_filename: "api.txt",
206 removed_api_filename: "removed.txt",
207 previous_api: "previous.txt",
208 check_api: {
209 current: {
210 api_file: "api/intra/current-api.txt",
211 removed_api_file: "api/intra/current-removed.txt",
212 },
213 last_released: {
214 api_file: "api/intra/last-api.txt",
215 removed_api_file: "api/intra/last-removed.txt",
216 },
217 },
218}
219
220// A library containing the intra-core API stubs of the I18N module.
221//
222// Intra-core APIs are only intended for the use of other core library modules.
223java_library {
224 name: "i18n.module.intra.core.api.stubs",
225 visibility: [
226 "//libcore:__subpackages__",
227 ],
228 srcs: [
229 ":i18n-module-intra-core-api-stubs-source",
230 ],
231
232 sdk_version: "none",
233 system_modules: "art-module-intra-core-api-stubs-system-modules",
234}
235
Paul Duffin4321d6b2019-10-03 13:32:26 +0100236// Generates stub source files for the core platform API of the I18N module.
237// i.e. every class/member that is either in the public API or annotated with
238// @CorePlatformApi.
239//
240// The API specification .txt files managed by this only contain the additional
241// classes/members that are in the intra-core API but which are not in the public
242// API.
243droidstubs {
244 name: "i18n-module-platform-api-stubs-source",
245 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000246 ":android_icu4j_repackaged_src_files",
247 ":libcore_icu_bridge_src_files",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100248 ],
249 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100250 system_modules: "art-module-platform-api-stubs-system-modules",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100251
252 installable: false,
253 args: "--hide-annotation libcore.api.Hide " +
254 "--show-single-annotation libcore.api.CorePlatformApi " +
255 "--skip-annotation-instance-methods=false ",
256
257 api_filename: "api.txt",
258 removed_api_filename: "removed.txt",
259 previous_api: "previous.txt",
260
261 check_api: {
262 current: {
263 api_file: "api/platform/current-api.txt",
264 removed_api_file: "api/platform/current-removed.txt",
265 },
266 last_released: {
267 api_file: "api/platform/last-api.txt",
268 removed_api_file: "api/platform/last-removed.txt",
269 },
270 },
271}
272
273// A library containing the core platform API stubs of the I18N module.
274//
275// Core platform APIs are only intended for use of other parts of the platform, not the
276// core library modules.
277java_library {
278 name: "i18n.module.platform.api.stubs",
279 visibility: [
280 "//libcore:__subpackages__",
281 ],
282 srcs: [
283 ":i18n-module-platform-api-stubs-source",
284 ],
285 hostdex: true,
286
287 sdk_version: "none",
288 system_modules: "art-module-platform-api-stubs-system-modules",
289}
290
Colin Cross6e18e292018-09-11 16:41:13 -0700291//==========================================================
292// build repackaged ICU tests
293//
294// Target builds against core-libart and core-oj so that it can access all the
295// repackaged android.icu classes and methods and not just the ones available
296// through the Android API.
Colin Cross6e18e292018-09-11 16:41:13 -0700297//==========================================================
298java_test {
299 name: "android-icu4j-tests",
Paul Duffind772e592019-06-03 16:09:02 +0100300 visibility: [
301 "//cts/tests/tests/icu",
302 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700303
304 srcs: [
305 "src/main/tests/**/*.java",
306 "testing/src/**/*.java",
307 ],
Victor Changd956e992018-11-20 11:07:18 +0000308 java_resource_dirs: [
309 "src/main/tests",
Paul Duffin22d367a2019-06-25 12:06:26 +0100310 "testing/src",
Victor Changd956e992018-11-20 11:07:18 +0000311 ],
Paul Duffincddef922019-10-02 11:46:02 +0100312 libs: [
313 "core-icu4j",
314 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700315 static_libs: [
316 "junit",
317 "junit-params",
318 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700319
Neil Fuller45359cf2018-10-02 16:42:42 +0100320 patch_module: "java.base",
Paul Duffin7f35fb92019-06-07 14:10:01 +0100321 sdk_version: "none",
Paul Duffincddef922019-10-02 11:46:02 +0100322 system_modules: "art-module-intra-core-api-stubs-system-modules",
Colin Cross6e18e292018-09-11 16:41:13 -0700323}