blob: 369457ed39efff03779458dc51d06c5f61cece6b [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",
Victor Chang92c3bcf2019-10-07 11:36:39 +010029 srcs: [
30 ":android_icu4j_repackaged_src_files",
Victor Chang92c3bcf2019-10-07 11:36:39 +010031 ],
Jiyong Park684fe8a2019-08-19 13:23:42 +090032 path: "src/main/java",
Colin Cross9a51b152017-08-29 16:04:52 -070033}
34
Victor Chang92c3bcf2019-10-07 11:36:39 +010035filegroup {
36 name: "android_icu4j_repackaged_src_files",
37 srcs: ["src/main/java/android/icu/**/*.java"],
38 path: "src/main/java",
39}
40
41// The files contains Android-specific codes to expose intra-core APIs
Victor Chang71d684d2020-05-15 18:17:49 +010042// from ICU4J/ICU4C to libcore or core platform APIs to the framework.
43// The package is com.android.icu.* and should not expose any public APIs.
Victor Chang92c3bcf2019-10-07 11:36:39 +010044filegroup {
45 name: "libcore_icu_bridge_src_files",
Victor Changc9ae0db2019-10-28 18:56:09 +000046 srcs: ["libcore_bridge/src/java/**/*.java"],
47 path: "libcore_bridge/src/java",
Victor Chang92c3bcf2019-10-07 11:36:39 +010048}
49
Victor Change5b242d2020-10-30 11:39:52 +000050java_defaults {
51 name: "libcore_icu_bridge_defaults",
52 srcs: [
53 "libcore_bridge/src/java/**/*.java",
54 ":app-compat-annotations-source",
55 ],
56 plugins: [
57 "compat-changeid-annotation-processor",
58 ],
59}
60
Martin Stjernholm3a15e592020-11-11 02:37:00 +000061// A host library containing time zone related classes. Used for
62// host-side tools and tests that have to deal with Android
63// time zone data.
64java_library_host {
65 name: "timezone-host",
66 visibility: [
67 "//packages/modules/RuntimeI18n/apex",
68 "//system/timezone/distro/core",
69 ],
Victor Chang21639cd2020-06-17 15:25:10 +010070 srcs: [
Victor Chang21639cd2020-06-17 15:25:10 +010071 "libcore_bridge/src/java/com/android/i18n/timezone/TzDataSetVersion.java",
72 ],
Martin Stjernholm3a15e592020-11-11 02:37:00 +000073 libs: [
74 "art.module.api.annotations",
75 ],
Victor Chang21639cd2020-06-17 15:25:10 +010076}
77
Victor Chang92c3bcf2019-10-07 11:36:39 +010078// 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"],
Victor Changaaf68452020-05-05 16:02:45 +010095 apex_available: [
96 "com.android.i18n",
97 ],
Victor Chang92c3bcf2019-10-07 11:36:39 +010098 errorprone: {
99 javacflags: [
100 "-Xep:MissingOverride:OFF", // Ignore missing @Override.
101 "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom
102 ],
103 },
104}
105
Paul Duffind31a0602019-09-26 16:23:55 +0100106// A separated core library that contains ICU4J because ICU4J will be in a different APEX module,
107// not in ART module.
108java_library {
109 name: "core-icu4j",
Victor Change5b242d2020-10-30 11:39:52 +0000110 defaults: ["libcore_icu_bridge_defaults"],
Paul Duffind31a0602019-09-26 16:23:55 +0100111 visibility: [
Victor Changa12ff872020-05-15 18:20:51 +0100112 "//packages/modules/RuntimeI18n/apex",
Paul Duffind31a0602019-09-26 16:23:55 +0100113 "//external/robolectric-shadows",
114 "//frameworks/layoutlib",
Victor Changaaf68452020-05-05 16:02:45 +0100115 "//art/build",
Paul Duffind31a0602019-09-26 16:23:55 +0100116 ],
Jiyong Park0ddd1ef2019-12-19 02:11:30 +0000117 apex_available: [
Victor Changaaf68452020-05-05 16:02:45 +0100118 "com.android.i18n",
119 ],
120 permitted_packages: [
121 "android.icu",
122 "com.android.icu",
Victor Chang21639cd2020-06-17 15:25:10 +0100123 "com.android.i18n.timezone",
Jiyong Park0ddd1ef2019-12-19 02:11:30 +0000124 ],
Paul Duffind31a0602019-09-26 16:23:55 +0100125 installable: true,
Victor Changaaf68452020-05-05 16:02:45 +0100126 hostdex: false,
Paul Duffind31a0602019-09-26 16:23:55 +0100127
Victor Chang92c3bcf2019-10-07 11:36:39 +0100128 static_libs: ["core-repackaged-icu4j"],
Paul Duffin2626a2a2019-10-08 15:17:42 +0100129
Paul Duffind31a0602019-09-26 16:23:55 +0100130 // It is important that core-icu4j is restricted to only use stable APIs from the ART module
131 // since it is in a different APEX module that can be updated independently.
132 sdk_version: "none",
Victor Chang92c3bcf2019-10-07 11:36:39 +0100133 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffind31a0602019-09-26 16:23:55 +0100134
135 dxflags: ["--core-library"],
Paul Duffind31a0602019-09-26 16:23:55 +0100136}
137
Victor Change5b242d2020-10-30 11:39:52 +0000138platform_compat_config {
139 name: "icu4j-platform-compat-config",
140 src: ":core-icu4j",
141}
142
Nicolas Geoffray329d0352020-06-01 16:04:02 +0100143java_sdk_library {
144 name: "i18n.module.public.api",
145 visibility: [
Paul Duffinc5466492020-11-25 15:44:23 +0000146 "//frameworks/base",
147 "//frameworks/base/api",
Nicolas Geoffray329d0352020-06-01 16:04:02 +0100148 "//libcore",
149 "//packages/modules/RuntimeI18n/apex",
150 // Visibility for prebuilt i18n-module-sdk from the prebuilt of
151 // this module.
152 // TODO(b/155921753): Restrict this when prebuilts are in their proper
153 // locations.
154 "//prebuilts:__subpackages__",
155 ],
Paul Duffind31a0602019-09-26 16:23:55 +0100156 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000157 ":android_icu4j_public_api_files",
Paul Duffind31a0602019-09-26 16:23:55 +0100158 ],
Paul Duffind31a0602019-09-26 16:23:55 +0100159 errorprone: {
160 javacflags: [
161 "-Xep:MissingOverride:OFF",
162 ],
163 },
Nicolas Geoffray329d0352020-06-01 16:04:02 +0100164 api_dir: "api/public",
165 api_only: true,
Paul Duffind31a0602019-09-26 16:23:55 +0100166 sdk_version: "none",
167 system_modules: "art-module-public-api-stubs-system-modules",
Paul Duffinb70de992020-11-19 19:26:46 +0000168
Paul Duffinc5466492020-11-25 15:44:23 +0000169 // The base name for the artifacts that are automatically published to the
170 // dist and which end up in one of the sub-directories of prebuilts/sdk.
171 // As long as this matches the name of the artifacts in prebuilts/sdk then
172 // the API will be checked for compatibility against the latest released
173 // version of the API.
174 dist_stem: "runtime-i18n",
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100175}
176
Paul Duffincff90fa2019-10-02 10:18:28 +0100177// Generates stub source files for the intra-core API of the I18N module.
178// i.e. every class/member that is either in the public API or annotated with
179// @IntraCoreApi.
180//
181// The API specification .txt files managed by this only contain the additional
182// classes/members that are in the intra-core API but which are not the public
183// API.
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100184java_sdk_library {
185 name: "i18n.module.intra.core.api",
Victor Change5b242d2020-10-30 11:39:52 +0000186 defaults: ["libcore_icu_bridge_defaults"],
Paul Duffincff90fa2019-10-02 10:18:28 +0100187 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000188 ":android_icu4j_repackaged_src_files",
Paul Duffincff90fa2019-10-02 10:18:28 +0100189 ],
Paul Duffincff90fa2019-10-02 10:18:28 +0100190 visibility: [
191 "//libcore:__subpackages__",
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100192 "//packages/modules/RuntimeI18n/apex",
193 // Visibility for prebuilt i18n-module-sdk from the prebuilt of
194 // this module.
195 // TODO(b/155921753): Restrict this when prebuilts are in their proper
196 // locations.
197 "//prebuilts:__subpackages__",
Paul Duffincff90fa2019-10-02 10:18:28 +0100198 ],
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100199 api_dir: "api/intra",
200 api_only: true,
Paul Duffincff90fa2019-10-02 10:18:28 +0100201 sdk_version: "none",
202 system_modules: "art-module-intra-core-api-stubs-system-modules",
Nicolas Geoffray7f8aaf62020-06-03 14:39:04 +0100203
204 droiddoc_options: [
205 "--hide-annotation libcore.api.Hide ",
206 "--show-single-annotation libcore.api.IntraCoreApi ",
207 "--skip-annotation-instance-methods=false ",
208 ],
Paul Duffinb70de992020-11-19 19:26:46 +0000209
210 // Don't copy any output files to the dist.
211 no_dist: true,
Paul Duffincff90fa2019-10-02 10:18:28 +0100212}
213
Pete Gillinecffbde2020-06-05 19:46:45 +0100214// Referenced implicitly from legacy.i18n.module.platform.api.
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100215filegroup {
Pete Gillinecffbde2020-06-05 19:46:45 +0100216 name: "legacy.i18n.module.platform.api.api.public.latest",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100217 srcs: [
Pete Gillinecffbde2020-06-05 19:46:45 +0100218 "api/legacy_platform/last-api.txt",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100219 ],
220}
221
Pete Gillinecffbde2020-06-05 19:46:45 +0100222// Referenced implicitly from legacy.i18n.module.platform.api.
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100223filegroup {
Pete Gillinecffbde2020-06-05 19:46:45 +0100224 name: "legacy.i18n.module.platform.api-removed.api.public.latest",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100225 srcs: [
Pete Gillinecffbde2020-06-05 19:46:45 +0100226 "api/legacy_platform/last-removed.txt",
227 ],
228}
229
230// Referenced implicitly from stable.i18n.module.platform.api.
231filegroup {
232 name: "stable.i18n.module.platform.api.api.public.latest",
233 srcs: [
234 "api/stable_platform/last-api.txt",
235 ],
236}
237
238// Referenced implicitly from stable.i18n.module.platform.api.
239filegroup {
240 name: "stable.i18n.module.platform.api-removed.api.public.latest",
241 srcs: [
242 "api/stable_platform/last-removed.txt",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100243 ],
244}
245
Paul Duffin4321d6b2019-10-03 13:32:26 +0100246// Generates stub source files for the core platform API of the I18N module.
247// i.e. every class/member that is either in the public API or annotated with
248// @CorePlatformApi.
249//
250// The API specification .txt files managed by this only contain the additional
251// classes/members that are in the intra-core API but which are not in the public
252// API.
Pete Gillinecffbde2020-06-05 19:46:45 +0100253//
254// For notes on the legacy and stable versions see mmodules/core_platform_api/Android.bp.
255
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100256java_sdk_library {
Pete Gillinecffbde2020-06-05 19:46:45 +0100257 name: "legacy.i18n.module.platform.api",
Victor Change5b242d2020-10-30 11:39:52 +0000258 defaults: ["libcore_icu_bridge_defaults"],
Paul Duffin4321d6b2019-10-03 13:32:26 +0100259 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000260 ":android_icu4j_repackaged_src_files",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100261 ],
Paul Duffin4321d6b2019-10-03 13:32:26 +0100262 visibility: [
263 "//libcore:__subpackages__",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100264 "//packages/modules/RuntimeI18n/apex",
265 // Visibility for prebuilt i18n-module-sdk from the prebuilt of
266 // this module.
267 // TODO(b/155921753): Restrict this when prebuilts are in their proper
268 // locations.
269 "//prebuilts:__subpackages__",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100270 ],
271 hostdex: true,
Pete Gillinecffbde2020-06-05 19:46:45 +0100272 api_dir: "api/legacy_platform",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100273 api_only: true,
Paul Duffin4321d6b2019-10-03 13:32:26 +0100274 sdk_version: "none",
Pete Gillin5e28f352020-06-02 16:22:22 +0100275 system_modules: "legacy-art-module-platform-api-stubs-system-modules",
Nicolas Geoffray4f8142a2020-05-29 17:00:48 +0100276
277 droiddoc_options: [
278 "--hide-annotation libcore.api.Hide ",
279 "--show-single-annotation libcore.api.CorePlatformApi ",
280 "--skip-annotation-instance-methods=false ",
281 ],
Paul Duffinb70de992020-11-19 19:26:46 +0000282
283 // Don't copy any output files to the dist.
284 no_dist: true,
Paul Duffin4321d6b2019-10-03 13:32:26 +0100285}
286
Pete Gillinecffbde2020-06-05 19:46:45 +0100287java_sdk_library {
288 name: "stable.i18n.module.platform.api",
Victor Change5b242d2020-10-30 11:39:52 +0000289 defaults: ["libcore_icu_bridge_defaults"],
Pete Gillinecffbde2020-06-05 19:46:45 +0100290 srcs: [
291 ":android_icu4j_repackaged_src_files",
Pete Gillinecffbde2020-06-05 19:46:45 +0100292 ],
293 visibility: [
294 "//libcore:__subpackages__",
295 "//packages/modules/RuntimeI18n/apex",
296 // Visibility for prebuilt i18n-module-sdk from the prebuilt of
297 // this module.
298 // TODO(b/155921753): Restrict this when prebuilts are in their proper
299 // locations.
300 "//prebuilts:__subpackages__",
301 ],
302 hostdex: true,
303 api_dir: "api/stable_platform",
304 api_only: true,
305 sdk_version: "none",
306 system_modules: "stable-art-module-platform-api-stubs-system-modules",
307
308 droiddoc_options: [
309 "--hide-annotation libcore.api.Hide ",
310 "--show-single-annotation libcore.api.CorePlatformApi\\(status=libcore.api.CorePlatformApi.Status.STABLE\\)",
311 "--skip-annotation-instance-methods=false ",
312 ],
Paul Duffinb70de992020-11-19 19:26:46 +0000313
314 // Don't copy any output files to the dist.
315 no_dist: true,
Pete Gillinecffbde2020-06-05 19:46:45 +0100316}
317
Colin Cross6e18e292018-09-11 16:41:13 -0700318//==========================================================
319// build repackaged ICU tests
320//
321// Target builds against core-libart and core-oj so that it can access all the
322// repackaged android.icu classes and methods and not just the ones available
323// through the Android API.
Colin Cross6e18e292018-09-11 16:41:13 -0700324//==========================================================
325java_test {
326 name: "android-icu4j-tests",
Paul Duffind772e592019-06-03 16:09:02 +0100327 visibility: [
328 "//cts/tests/tests/icu",
329 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700330
331 srcs: [
332 "src/main/tests/**/*.java",
333 "testing/src/**/*.java",
334 ],
Victor Changd956e992018-11-20 11:07:18 +0000335 java_resource_dirs: [
336 "src/main/tests",
Paul Duffin22d367a2019-06-25 12:06:26 +0100337 "testing/src",
Victor Changd956e992018-11-20 11:07:18 +0000338 ],
Paul Duffincddef922019-10-02 11:46:02 +0100339 libs: [
340 "core-icu4j",
341 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700342 static_libs: [
343 "junit",
344 "junit-params",
Victor Chang21639cd2020-06-17 15:25:10 +0100345 "tzdata-testing",
Colin Cross6e18e292018-09-11 16:41:13 -0700346 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700347
Neil Fuller45359cf2018-10-02 16:42:42 +0100348 patch_module: "java.base",
Paul Duffin7f35fb92019-06-07 14:10:01 +0100349 sdk_version: "none",
Paul Duffincddef922019-10-02 11:46:02 +0100350 system_modules: "art-module-intra-core-api-stubs-system-modules",
Colin Cross6e18e292018-09-11 16:41:13 -0700351}