blob: f2f5120e1fdffc6d6a2d24b54a72318ed49c3daa [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 ],
Andrei Onea55651ce2020-12-09 16:16:43 +000059 jarjar_rules: "jarjar-rules.txt",
Victor Change5b242d2020-10-30 11:39:52 +000060 plugins: [
61 "compat-changeid-annotation-processor",
62 ],
63}
64
Martin Stjernholm3a15e592020-11-11 02:37:00 +000065// A host library containing time zone related classes. Used for
66// host-side tools and tests that have to deal with Android
67// time zone data.
68java_library_host {
69 name: "timezone-host",
70 visibility: [
71 "//packages/modules/RuntimeI18n/apex",
72 "//system/timezone/distro/core",
73 ],
Victor Chang21639cd2020-06-17 15:25:10 +010074 srcs: [
Victor Chang21639cd2020-06-17 15:25:10 +010075 "libcore_bridge/src/java/com/android/i18n/timezone/TzDataSetVersion.java",
76 ],
Martin Stjernholm3a15e592020-11-11 02:37:00 +000077 libs: [
78 "art.module.api.annotations",
79 ],
Victor Chang21639cd2020-06-17 15:25:10 +010080}
81
Victor Chang92c3bcf2019-10-07 11:36:39 +010082// core-repackaged-icu4j contains only the repackaged ICU4J that does not
83// use any internal or android specific code. If it ever did then it could depend on
84// art-module-intra-core-api-stubs-system-modules (a superset) instead.
85// It is important that core-icu4j is restricted to only use stable APIs from the ART module
86// since it is in a different APEX module that can be updated independently.
87java_library_static {
88 name: "core-repackaged-icu4j",
89 installable: false,
90 srcs: [":android_icu4j_repackaged_src_files"],
Artur Satayev2fc4dc32019-12-10 12:12:35 +000091 libs: ["unsupportedappusage"],
Victor Chang92c3bcf2019-10-07 11:36:39 +010092 // The resource files are generated in the downstream branch master-icu-dev.
93 java_resource_dirs: ["resources"],
94
95 sdk_version: "none",
96 system_modules: "art-module-public-api-stubs-system-modules",
97
98 dxflags: ["--core-library"],
Victor Changaaf68452020-05-05 16:02:45 +010099 apex_available: [
100 "com.android.i18n",
101 ],
Victor Chang92c3bcf2019-10-07 11:36:39 +0100102 errorprone: {
103 javacflags: [
104 "-Xep:MissingOverride:OFF", // Ignore missing @Override.
105 "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom
106 ],
107 },
108}
109
Paul Duffind31a0602019-09-26 16:23:55 +0100110// A separated core library that contains ICU4J because ICU4J will be in a different APEX module,
111// not in ART module.
112java_library {
113 name: "core-icu4j",
Victor Change5b242d2020-10-30 11:39:52 +0000114 defaults: ["libcore_icu_bridge_defaults"],
Paul Duffind31a0602019-09-26 16:23:55 +0100115 visibility: [
Victor Changa12ff872020-05-15 18:20:51 +0100116 "//packages/modules/RuntimeI18n/apex",
Paul Duffind31a0602019-09-26 16:23:55 +0100117 "//external/robolectric-shadows",
118 "//frameworks/layoutlib",
Victor Changaaf68452020-05-05 16:02:45 +0100119 "//art/build",
Paul Duffind31a0602019-09-26 16:23:55 +0100120 ],
Jiyong Park0ddd1ef2019-12-19 02:11:30 +0000121 apex_available: [
Victor Changaaf68452020-05-05 16:02:45 +0100122 "com.android.i18n",
123 ],
124 permitted_packages: [
125 "android.icu",
126 "com.android.icu",
Victor Chang21639cd2020-06-17 15:25:10 +0100127 "com.android.i18n.timezone",
Jiyong Park0ddd1ef2019-12-19 02:11:30 +0000128 ],
Paul Duffind31a0602019-09-26 16:23:55 +0100129 installable: true,
Victor Changaaf68452020-05-05 16:02:45 +0100130 hostdex: false,
Paul Duffind31a0602019-09-26 16:23:55 +0100131
Victor Chang92c3bcf2019-10-07 11:36:39 +0100132 static_libs: ["core-repackaged-icu4j"],
Paul Duffin2626a2a2019-10-08 15:17:42 +0100133
Paul Duffind31a0602019-09-26 16:23:55 +0100134 // It is important that core-icu4j is restricted to only use stable APIs from the ART module
135 // since it is in a different APEX module that can be updated independently.
136 sdk_version: "none",
Victor Chang92c3bcf2019-10-07 11:36:39 +0100137 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffind31a0602019-09-26 16:23:55 +0100138
139 dxflags: ["--core-library"],
Paul Duffind31a0602019-09-26 16:23:55 +0100140}
141
Victor Change5b242d2020-10-30 11:39:52 +0000142platform_compat_config {
143 name: "icu4j-platform-compat-config",
144 src: ":core-icu4j",
145}
146
Nicolas Geoffray329d0352020-06-01 16:04:02 +0100147java_sdk_library {
148 name: "i18n.module.public.api",
149 visibility: [
150 "//libcore",
151 "//packages/modules/RuntimeI18n/apex",
152 // Visibility for prebuilt i18n-module-sdk from the prebuilt of
153 // this module.
154 // TODO(b/155921753): Restrict this when prebuilts are in their proper
155 // locations.
156 "//prebuilts:__subpackages__",
157 ],
Paul Duffind31a0602019-09-26 16:23:55 +0100158 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000159 ":android_icu4j_public_api_files",
Paul Duffind31a0602019-09-26 16:23:55 +0100160 ],
Paul Duffind31a0602019-09-26 16:23:55 +0100161 errorprone: {
162 javacflags: [
163 "-Xep:MissingOverride:OFF",
164 ],
165 },
Nicolas Geoffray329d0352020-06-01 16:04:02 +0100166 api_dir: "api/public",
167 api_only: true,
Paul Duffind31a0602019-09-26 16:23:55 +0100168 sdk_version: "none",
169 system_modules: "art-module-public-api-stubs-system-modules",
Paul Duffinb70de992020-11-19 19:26:46 +0000170
171 // Don't copy any output files to the dist.
172 no_dist: true,
Paul Duffind31a0602019-09-26 16:23:55 +0100173}
174
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100175// Referenced implicitly from i18n.module.intra.api.
176filegroup {
177 name: "i18n.module.intra.api.api.public.latest",
178 srcs: [
179 "api/intra/last-api.txt",
180 ],
181}
182
183// Referenced implicitly from i18n.module.intra.api.
184filegroup {
185 name: "i18n.module.intra.api-removed.api.public.latest",
186 srcs: [
187 "api/intra/last-removed.txt",
188 ],
189}
190
Paul Duffincff90fa2019-10-02 10:18:28 +0100191// Generates stub source files for the intra-core API of the I18N module.
192// i.e. every class/member that is either in the public API or annotated with
193// @IntraCoreApi.
194//
195// The API specification .txt files managed by this only contain the additional
196// classes/members that are in the intra-core API but which are not the public
197// API.
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100198java_sdk_library {
199 name: "i18n.module.intra.core.api",
Victor Change5b242d2020-10-30 11:39:52 +0000200 defaults: ["libcore_icu_bridge_defaults"],
Paul Duffincff90fa2019-10-02 10:18:28 +0100201 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000202 ":android_icu4j_repackaged_src_files",
Paul Duffincff90fa2019-10-02 10:18:28 +0100203 ],
Paul Duffincff90fa2019-10-02 10:18:28 +0100204 visibility: [
205 "//libcore:__subpackages__",
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100206 "//packages/modules/RuntimeI18n/apex",
207 // Visibility for prebuilt i18n-module-sdk from the prebuilt of
208 // this module.
209 // TODO(b/155921753): Restrict this when prebuilts are in their proper
210 // locations.
211 "//prebuilts:__subpackages__",
Paul Duffincff90fa2019-10-02 10:18:28 +0100212 ],
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100213 api_dir: "api/intra",
214 api_only: true,
Paul Duffincff90fa2019-10-02 10:18:28 +0100215 sdk_version: "none",
216 system_modules: "art-module-intra-core-api-stubs-system-modules",
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100217
218 droiddoc_options: [
219 "--hide-annotation libcore.api.Hide ",
220 "--show-single-annotation libcore.api.IntraCoreApi ",
221 "--skip-annotation-instance-methods=false ",
222 ],
Paul Duffinb70de992020-11-19 19:26:46 +0000223
224 // Don't copy any output files to the dist.
225 no_dist: true,
Paul Duffincff90fa2019-10-02 10:18:28 +0100226}
227
Pete Gillinecffbde2020-06-05 19:46:45 +0100228// Referenced implicitly from legacy.i18n.module.platform.api.
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100229filegroup {
Pete Gillinecffbde2020-06-05 19:46:45 +0100230 name: "legacy.i18n.module.platform.api.api.public.latest",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100231 srcs: [
Pete Gillinecffbde2020-06-05 19:46:45 +0100232 "api/legacy_platform/last-api.txt",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100233 ],
234}
235
Pete Gillinecffbde2020-06-05 19:46:45 +0100236// Referenced implicitly from legacy.i18n.module.platform.api.
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100237filegroup {
Pete Gillinecffbde2020-06-05 19:46:45 +0100238 name: "legacy.i18n.module.platform.api-removed.api.public.latest",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100239 srcs: [
Pete Gillinecffbde2020-06-05 19:46:45 +0100240 "api/legacy_platform/last-removed.txt",
241 ],
242}
243
244// Referenced implicitly from stable.i18n.module.platform.api.
245filegroup {
246 name: "stable.i18n.module.platform.api.api.public.latest",
247 srcs: [
248 "api/stable_platform/last-api.txt",
249 ],
250}
251
252// Referenced implicitly from stable.i18n.module.platform.api.
253filegroup {
254 name: "stable.i18n.module.platform.api-removed.api.public.latest",
255 srcs: [
256 "api/stable_platform/last-removed.txt",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100257 ],
258}
259
Paul Duffin4321d6b2019-10-03 13:32:26 +0100260// Generates stub source files for the core platform API of the I18N module.
261// i.e. every class/member that is either in the public API or annotated with
262// @CorePlatformApi.
263//
264// The API specification .txt files managed by this only contain the additional
265// classes/members that are in the intra-core API but which are not in the public
266// API.
Pete Gillinecffbde2020-06-05 19:46:45 +0100267//
268// For notes on the legacy and stable versions see mmodules/core_platform_api/Android.bp.
269
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100270java_sdk_library {
Pete Gillinecffbde2020-06-05 19:46:45 +0100271 name: "legacy.i18n.module.platform.api",
Victor Change5b242d2020-10-30 11:39:52 +0000272 defaults: ["libcore_icu_bridge_defaults"],
Paul Duffin4321d6b2019-10-03 13:32:26 +0100273 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000274 ":android_icu4j_repackaged_src_files",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100275 ],
Paul Duffin4321d6b2019-10-03 13:32:26 +0100276 visibility: [
277 "//libcore:__subpackages__",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100278 "//packages/modules/RuntimeI18n/apex",
279 // Visibility for prebuilt i18n-module-sdk from the prebuilt of
280 // this module.
281 // TODO(b/155921753): Restrict this when prebuilts are in their proper
282 // locations.
283 "//prebuilts:__subpackages__",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100284 ],
285 hostdex: true,
Pete Gillinecffbde2020-06-05 19:46:45 +0100286 api_dir: "api/legacy_platform",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100287 api_only: true,
Paul Duffin4321d6b2019-10-03 13:32:26 +0100288 sdk_version: "none",
Pete Gillin5e28f352020-06-02 16:22:22 +0100289 system_modules: "legacy-art-module-platform-api-stubs-system-modules",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100290
291 droiddoc_options: [
292 "--hide-annotation libcore.api.Hide ",
293 "--show-single-annotation libcore.api.CorePlatformApi ",
294 "--skip-annotation-instance-methods=false ",
295 ],
Paul Duffinb70de992020-11-19 19:26:46 +0000296
297 // Don't copy any output files to the dist.
298 no_dist: true,
Paul Duffin4321d6b2019-10-03 13:32:26 +0100299}
300
Pete Gillinecffbde2020-06-05 19:46:45 +0100301java_sdk_library {
302 name: "stable.i18n.module.platform.api",
Victor Change5b242d2020-10-30 11:39:52 +0000303 defaults: ["libcore_icu_bridge_defaults"],
Pete Gillinecffbde2020-06-05 19:46:45 +0100304 srcs: [
305 ":android_icu4j_repackaged_src_files",
Pete Gillinecffbde2020-06-05 19:46:45 +0100306 ],
307 visibility: [
308 "//libcore:__subpackages__",
309 "//packages/modules/RuntimeI18n/apex",
310 // Visibility for prebuilt i18n-module-sdk from the prebuilt of
311 // this module.
312 // TODO(b/155921753): Restrict this when prebuilts are in their proper
313 // locations.
314 "//prebuilts:__subpackages__",
315 ],
316 hostdex: true,
317 api_dir: "api/stable_platform",
318 api_only: true,
319 sdk_version: "none",
320 system_modules: "stable-art-module-platform-api-stubs-system-modules",
321
322 droiddoc_options: [
323 "--hide-annotation libcore.api.Hide ",
324 "--show-single-annotation libcore.api.CorePlatformApi\\(status=libcore.api.CorePlatformApi.Status.STABLE\\)",
325 "--skip-annotation-instance-methods=false ",
326 ],
Paul Duffinb70de992020-11-19 19:26:46 +0000327
328 // Don't copy any output files to the dist.
329 no_dist: true,
Pete Gillinecffbde2020-06-05 19:46:45 +0100330}
331
Colin Cross6e18e292018-09-11 16:41:13 -0700332//==========================================================
333// build repackaged ICU tests
334//
335// Target builds against core-libart and core-oj so that it can access all the
336// repackaged android.icu classes and methods and not just the ones available
337// through the Android API.
Colin Cross6e18e292018-09-11 16:41:13 -0700338//==========================================================
339java_test {
340 name: "android-icu4j-tests",
Paul Duffind772e592019-06-03 16:09:02 +0100341 visibility: [
342 "//cts/tests/tests/icu",
343 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700344
345 srcs: [
346 "src/main/tests/**/*.java",
347 "testing/src/**/*.java",
348 ],
Victor Changd956e992018-11-20 11:07:18 +0000349 java_resource_dirs: [
350 "src/main/tests",
Paul Duffin22d367a2019-06-25 12:06:26 +0100351 "testing/src",
Victor Changd956e992018-11-20 11:07:18 +0000352 ],
Paul Duffincddef922019-10-02 11:46:02 +0100353 libs: [
354 "core-icu4j",
355 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700356 static_libs: [
357 "junit",
358 "junit-params",
Victor Chang21639cd2020-06-17 15:25:10 +0100359 "tzdata-testing",
Colin Cross6e18e292018-09-11 16:41:13 -0700360 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700361
Neil Fuller45359cf2018-10-02 16:42:42 +0100362 patch_module: "java.base",
Paul Duffin7f35fb92019-06-07 14:10:01 +0100363 sdk_version: "none",
Paul Duffincddef922019-10-02 11:46:02 +0100364 system_modules: "art-module-intra-core-api-stubs-system-modules",
Colin Cross6e18e292018-09-11 16:41:13 -0700365}