blob: c910983f8c5ef40ce5a2bb4585596af2914db858 [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 Duffin093a4042020-03-26 15:36:49 +000030 "//frameworks/base",
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
Victor Chang71d684d2020-05-15 18:17:49 +010045// from ICU4J/ICU4C to libcore or core platform APIs to the framework.
46// The package is com.android.icu.* and should not expose any public APIs.
Victor Chang92c3bcf2019-10-07 11:36:39 +010047filegroup {
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
Victor Change5b242d2020-10-30 11:39:52 +000053java_defaults {
54 name: "libcore_icu_bridge_defaults",
55 srcs: [
56 "libcore_bridge/src/java/**/*.java",
57 ":app-compat-annotations-source",
58 ],
59 plugins: [
60 "compat-changeid-annotation-processor",
61 ],
62}
63
Martin Stjernholm3a15e592020-11-11 02:37:00 +000064// A host library containing time zone related classes. Used for
65// host-side tools and tests that have to deal with Android
66// time zone data.
67java_library_host {
68 name: "timezone-host",
69 visibility: [
70 "//packages/modules/RuntimeI18n/apex",
71 "//system/timezone/distro/core",
72 ],
Victor Chang21639cd2020-06-17 15:25:10 +010073 srcs: [
Victor Chang21639cd2020-06-17 15:25:10 +010074 "libcore_bridge/src/java/com/android/i18n/timezone/TzDataSetVersion.java",
75 ],
Martin Stjernholm3a15e592020-11-11 02:37:00 +000076 libs: [
77 "art.module.api.annotations",
78 ],
Victor Chang21639cd2020-06-17 15:25:10 +010079}
80
Victor Chang92c3bcf2019-10-07 11:36:39 +010081// core-repackaged-icu4j contains only the repackaged ICU4J that does not
82// use any internal or android specific code. If it ever did then it could depend on
83// art-module-intra-core-api-stubs-system-modules (a superset) instead.
84// It is important that core-icu4j is restricted to only use stable APIs from the ART module
85// since it is in a different APEX module that can be updated independently.
86java_library_static {
87 name: "core-repackaged-icu4j",
88 installable: false,
89 srcs: [":android_icu4j_repackaged_src_files"],
Artur Satayev2fc4dc32019-12-10 12:12:35 +000090 libs: ["unsupportedappusage"],
Victor Chang92c3bcf2019-10-07 11:36:39 +010091 // The resource files are generated in the downstream branch master-icu-dev.
92 java_resource_dirs: ["resources"],
93
94 sdk_version: "none",
95 system_modules: "art-module-public-api-stubs-system-modules",
96
97 dxflags: ["--core-library"],
Victor Changaaf68452020-05-05 16:02:45 +010098 apex_available: [
99 "com.android.i18n",
100 ],
Victor Chang92c3bcf2019-10-07 11:36:39 +0100101 errorprone: {
102 javacflags: [
103 "-Xep:MissingOverride:OFF", // Ignore missing @Override.
104 "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom
105 ],
106 },
107}
108
Paul Duffind31a0602019-09-26 16:23:55 +0100109// A separated core library that contains ICU4J because ICU4J will be in a different APEX module,
110// not in ART module.
111java_library {
112 name: "core-icu4j",
Victor Change5b242d2020-10-30 11:39:52 +0000113 defaults: ["libcore_icu_bridge_defaults"],
Paul Duffind31a0602019-09-26 16:23:55 +0100114 visibility: [
Victor Changa12ff872020-05-15 18:20:51 +0100115 "//packages/modules/RuntimeI18n/apex",
Paul Duffind31a0602019-09-26 16:23:55 +0100116 "//external/robolectric-shadows",
117 "//frameworks/layoutlib",
Victor Changaaf68452020-05-05 16:02:45 +0100118 "//art/build",
Paul Duffind31a0602019-09-26 16:23:55 +0100119 ],
Jiyong Park0ddd1ef2019-12-19 02:11:30 +0000120 apex_available: [
Victor Changaaf68452020-05-05 16:02:45 +0100121 "com.android.i18n",
122 ],
123 permitted_packages: [
124 "android.icu",
125 "com.android.icu",
Victor Chang21639cd2020-06-17 15:25:10 +0100126 "com.android.i18n.timezone",
Jiyong Park0ddd1ef2019-12-19 02:11:30 +0000127 ],
Paul Duffind31a0602019-09-26 16:23:55 +0100128 installable: true,
Victor Changaaf68452020-05-05 16:02:45 +0100129 hostdex: false,
Paul Duffind31a0602019-09-26 16:23:55 +0100130
Victor Chang92c3bcf2019-10-07 11:36:39 +0100131 static_libs: ["core-repackaged-icu4j"],
Paul Duffin2626a2a2019-10-08 15:17:42 +0100132
Paul Duffind31a0602019-09-26 16:23:55 +0100133 // It is important that core-icu4j is restricted to only use stable APIs from the ART module
134 // since it is in a different APEX module that can be updated independently.
135 sdk_version: "none",
Victor Chang92c3bcf2019-10-07 11:36:39 +0100136 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffind31a0602019-09-26 16:23:55 +0100137
138 dxflags: ["--core-library"],
Paul Duffind31a0602019-09-26 16:23:55 +0100139}
140
Victor Change5b242d2020-10-30 11:39:52 +0000141platform_compat_config {
142 name: "icu4j-platform-compat-config",
143 src: ":core-icu4j",
144}
145
Nicolas Geoffray329d0352020-06-01 16:04:02 +0100146java_sdk_library {
147 name: "i18n.module.public.api",
148 visibility: [
149 "//libcore",
150 "//packages/modules/RuntimeI18n/apex",
151 // Visibility for prebuilt i18n-module-sdk from the prebuilt of
152 // this module.
153 // TODO(b/155921753): Restrict this when prebuilts are in their proper
154 // locations.
155 "//prebuilts:__subpackages__",
156 ],
Paul Duffind31a0602019-09-26 16:23:55 +0100157 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000158 ":android_icu4j_public_api_files",
Paul Duffind31a0602019-09-26 16:23:55 +0100159 ],
Paul Duffind31a0602019-09-26 16:23:55 +0100160 errorprone: {
161 javacflags: [
162 "-Xep:MissingOverride:OFF",
163 ],
164 },
Nicolas Geoffray329d0352020-06-01 16:04:02 +0100165 api_dir: "api/public",
166 api_only: true,
Paul Duffind31a0602019-09-26 16:23:55 +0100167 sdk_version: "none",
168 system_modules: "art-module-public-api-stubs-system-modules",
Paul Duffinb70de992020-11-19 19:26:46 +0000169
170 // Don't copy any output files to the dist.
171 no_dist: true,
Paul Duffind31a0602019-09-26 16:23:55 +0100172}
173
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100174// Referenced implicitly from i18n.module.intra.api.
175filegroup {
176 name: "i18n.module.intra.api.api.public.latest",
177 srcs: [
178 "api/intra/last-api.txt",
179 ],
180}
181
182// Referenced implicitly from i18n.module.intra.api.
183filegroup {
184 name: "i18n.module.intra.api-removed.api.public.latest",
185 srcs: [
186 "api/intra/last-removed.txt",
187 ],
188}
189
Paul Duffincff90fa2019-10-02 10:18:28 +0100190// Generates stub source files for the intra-core API of the I18N module.
191// i.e. every class/member that is either in the public API or annotated with
192// @IntraCoreApi.
193//
194// The API specification .txt files managed by this only contain the additional
195// classes/members that are in the intra-core API but which are not the public
196// API.
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100197java_sdk_library {
198 name: "i18n.module.intra.core.api",
Victor Change5b242d2020-10-30 11:39:52 +0000199 defaults: ["libcore_icu_bridge_defaults"],
Paul Duffincff90fa2019-10-02 10:18:28 +0100200 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000201 ":android_icu4j_repackaged_src_files",
Paul Duffincff90fa2019-10-02 10:18:28 +0100202 ],
Paul Duffincff90fa2019-10-02 10:18:28 +0100203 visibility: [
204 "//libcore:__subpackages__",
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100205 "//packages/modules/RuntimeI18n/apex",
206 // Visibility for prebuilt i18n-module-sdk from the prebuilt of
207 // this module.
208 // TODO(b/155921753): Restrict this when prebuilts are in their proper
209 // locations.
210 "//prebuilts:__subpackages__",
Paul Duffincff90fa2019-10-02 10:18:28 +0100211 ],
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100212 api_dir: "api/intra",
213 api_only: true,
Paul Duffincff90fa2019-10-02 10:18:28 +0100214 sdk_version: "none",
215 system_modules: "art-module-intra-core-api-stubs-system-modules",
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100216
217 droiddoc_options: [
218 "--hide-annotation libcore.api.Hide ",
219 "--show-single-annotation libcore.api.IntraCoreApi ",
220 "--skip-annotation-instance-methods=false ",
221 ],
Paul Duffinb70de992020-11-19 19:26:46 +0000222
223 // Don't copy any output files to the dist.
224 no_dist: true,
Paul Duffincff90fa2019-10-02 10:18:28 +0100225}
226
Pete Gillinecffbde2020-06-05 19:46:45 +0100227// Referenced implicitly from legacy.i18n.module.platform.api.
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100228filegroup {
Pete Gillinecffbde2020-06-05 19:46:45 +0100229 name: "legacy.i18n.module.platform.api.api.public.latest",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100230 srcs: [
Pete Gillinecffbde2020-06-05 19:46:45 +0100231 "api/legacy_platform/last-api.txt",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100232 ],
233}
234
Pete Gillinecffbde2020-06-05 19:46:45 +0100235// Referenced implicitly from legacy.i18n.module.platform.api.
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100236filegroup {
Pete Gillinecffbde2020-06-05 19:46:45 +0100237 name: "legacy.i18n.module.platform.api-removed.api.public.latest",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100238 srcs: [
Pete Gillinecffbde2020-06-05 19:46:45 +0100239 "api/legacy_platform/last-removed.txt",
240 ],
241}
242
243// Referenced implicitly from stable.i18n.module.platform.api.
244filegroup {
245 name: "stable.i18n.module.platform.api.api.public.latest",
246 srcs: [
247 "api/stable_platform/last-api.txt",
248 ],
249}
250
251// Referenced implicitly from stable.i18n.module.platform.api.
252filegroup {
253 name: "stable.i18n.module.platform.api-removed.api.public.latest",
254 srcs: [
255 "api/stable_platform/last-removed.txt",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100256 ],
257}
258
Paul Duffin4321d6b2019-10-03 13:32:26 +0100259// Generates stub source files for the core platform API of the I18N module.
260// i.e. every class/member that is either in the public API or annotated with
261// @CorePlatformApi.
262//
263// The API specification .txt files managed by this only contain the additional
264// classes/members that are in the intra-core API but which are not in the public
265// API.
Pete Gillinecffbde2020-06-05 19:46:45 +0100266//
267// For notes on the legacy and stable versions see mmodules/core_platform_api/Android.bp.
268
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100269java_sdk_library {
Pete Gillinecffbde2020-06-05 19:46:45 +0100270 name: "legacy.i18n.module.platform.api",
Victor Change5b242d2020-10-30 11:39:52 +0000271 defaults: ["libcore_icu_bridge_defaults"],
Paul Duffin4321d6b2019-10-03 13:32:26 +0100272 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000273 ":android_icu4j_repackaged_src_files",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100274 ],
Paul Duffin4321d6b2019-10-03 13:32:26 +0100275 visibility: [
276 "//libcore:__subpackages__",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100277 "//packages/modules/RuntimeI18n/apex",
278 // Visibility for prebuilt i18n-module-sdk from the prebuilt of
279 // this module.
280 // TODO(b/155921753): Restrict this when prebuilts are in their proper
281 // locations.
282 "//prebuilts:__subpackages__",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100283 ],
284 hostdex: true,
Pete Gillinecffbde2020-06-05 19:46:45 +0100285 api_dir: "api/legacy_platform",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100286 api_only: true,
Paul Duffin4321d6b2019-10-03 13:32:26 +0100287 sdk_version: "none",
Pete Gillin5e28f352020-06-02 16:22:22 +0100288 system_modules: "legacy-art-module-platform-api-stubs-system-modules",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100289
290 droiddoc_options: [
291 "--hide-annotation libcore.api.Hide ",
292 "--show-single-annotation libcore.api.CorePlatformApi ",
293 "--skip-annotation-instance-methods=false ",
294 ],
Paul Duffinb70de992020-11-19 19:26:46 +0000295
296 // Don't copy any output files to the dist.
297 no_dist: true,
Paul Duffin4321d6b2019-10-03 13:32:26 +0100298}
299
Pete Gillinecffbde2020-06-05 19:46:45 +0100300java_sdk_library {
301 name: "stable.i18n.module.platform.api",
Victor Change5b242d2020-10-30 11:39:52 +0000302 defaults: ["libcore_icu_bridge_defaults"],
Pete Gillinecffbde2020-06-05 19:46:45 +0100303 srcs: [
304 ":android_icu4j_repackaged_src_files",
Pete Gillinecffbde2020-06-05 19:46:45 +0100305 ],
306 visibility: [
307 "//libcore:__subpackages__",
308 "//packages/modules/RuntimeI18n/apex",
309 // Visibility for prebuilt i18n-module-sdk from the prebuilt of
310 // this module.
311 // TODO(b/155921753): Restrict this when prebuilts are in their proper
312 // locations.
313 "//prebuilts:__subpackages__",
314 ],
315 hostdex: true,
316 api_dir: "api/stable_platform",
317 api_only: true,
318 sdk_version: "none",
319 system_modules: "stable-art-module-platform-api-stubs-system-modules",
320
321 droiddoc_options: [
322 "--hide-annotation libcore.api.Hide ",
323 "--show-single-annotation libcore.api.CorePlatformApi\\(status=libcore.api.CorePlatformApi.Status.STABLE\\)",
324 "--skip-annotation-instance-methods=false ",
325 ],
Paul Duffinb70de992020-11-19 19:26:46 +0000326
327 // Don't copy any output files to the dist.
328 no_dist: true,
Pete Gillinecffbde2020-06-05 19:46:45 +0100329}
330
Colin Cross6e18e292018-09-11 16:41:13 -0700331//==========================================================
332// build repackaged ICU tests
333//
334// Target builds against core-libart and core-oj so that it can access all the
335// repackaged android.icu classes and methods and not just the ones available
336// through the Android API.
Colin Cross6e18e292018-09-11 16:41:13 -0700337//==========================================================
338java_test {
339 name: "android-icu4j-tests",
Paul Duffind772e592019-06-03 16:09:02 +0100340 visibility: [
341 "//cts/tests/tests/icu",
342 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700343
344 srcs: [
345 "src/main/tests/**/*.java",
346 "testing/src/**/*.java",
347 ],
Victor Changd956e992018-11-20 11:07:18 +0000348 java_resource_dirs: [
349 "src/main/tests",
Paul Duffin22d367a2019-06-25 12:06:26 +0100350 "testing/src",
Victor Changd956e992018-11-20 11:07:18 +0000351 ],
Paul Duffincddef922019-10-02 11:46:02 +0100352 libs: [
353 "core-icu4j",
354 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700355 static_libs: [
356 "junit",
357 "junit-params",
Victor Chang21639cd2020-06-17 15:25:10 +0100358 "tzdata-testing",
Colin Cross6e18e292018-09-11 16:41:13 -0700359 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700360
Neil Fuller45359cf2018-10-02 16:42:42 +0100361 patch_module: "java.base",
Paul Duffin7f35fb92019-06-07 14:10:01 +0100362 sdk_version: "none",
Paul Duffincddef922019-10-02 11:46:02 +0100363 system_modules: "art-module-intra-core-api-stubs-system-modules",
Colin Cross6e18e292018-09-11 16:41:13 -0700364}