blob: 5759deec5c82c78534bf9ec9e01d3c110a5c7512 [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
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"],
Victor Chang70089942020-04-03 19:01:55 +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",
110 visibility: [
Victor Chang70089942020-04-03 19:01:55 +0100111 "//libcore/apex",
Paul Duffind31a0602019-09-26 16:23:55 +0100112 "//external/robolectric-shadows",
113 "//frameworks/layoutlib",
Victor Chang70089942020-04-03 19:01:55 +0100114 "//art/build",
Paul Duffind31a0602019-09-26 16:23:55 +0100115 ],
Jiyong Park0ddd1ef2019-12-19 02:11:30 +0000116 apex_available: [
Victor Chang70089942020-04-03 19:01:55 +0100117 "com.android.i18n",
118 ],
119 permitted_packages: [
120 "android.icu",
121 "com.android.icu",
Jiyong Park0ddd1ef2019-12-19 02:11:30 +0000122 ],
Paul Duffind31a0602019-09-26 16:23:55 +0100123 installable: true,
Victor Chang70089942020-04-03 19:01:55 +0100124 hostdex: false,
Paul Duffind31a0602019-09-26 16:23:55 +0100125
Victor Chang92c3bcf2019-10-07 11:36:39 +0100126 srcs: [":libcore_icu_bridge_src_files"],
127 static_libs: ["core-repackaged-icu4j"],
Paul Duffin2626a2a2019-10-08 15:17:42 +0100128
Paul Duffind31a0602019-09-26 16:23:55 +0100129 // It is important that core-icu4j is restricted to only use stable APIs from the ART module
130 // since it is in a different APEX module that can be updated independently.
131 sdk_version: "none",
Victor Chang92c3bcf2019-10-07 11:36:39 +0100132 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffind31a0602019-09-26 16:23:55 +0100133
134 dxflags: ["--core-library"],
Paul Duffind31a0602019-09-26 16:23:55 +0100135}
136
Paul Duffind31a0602019-09-26 16:23:55 +0100137// Generates stubs for the parts of the public SDK API provided by the i18n module.
138//
139// Only for use by i18n.module.public.api.stubs target below.
140droidstubs {
141 name: "i18n-module-public-api-stubs-gen",
142 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000143 ":android_icu4j_public_api_files",
Paul Duffind31a0602019-09-26 16:23:55 +0100144 ],
145 java_version: "1.9",
146 installable: false,
147 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100148 system_modules: "art-module-public-api-stubs-system-modules",
Paul Duffind31a0602019-09-26 16:23:55 +0100149}
150
151// A stubs target containing the parts of the public SDK API provided by the i18n module.
152java_library {
153 name: "i18n.module.public.api.stubs",
154 visibility: [
155 "//libcore",
156 ],
157 srcs: [":i18n-module-public-api-stubs-gen"],
158 errorprone: {
159 javacflags: [
160 "-Xep:MissingOverride:OFF",
161 ],
162 },
163 sdk_version: "none",
164 system_modules: "art-module-public-api-stubs-system-modules",
165}
166
Paul Duffincff90fa2019-10-02 10:18:28 +0100167// Generates stub source files for the intra-core API of the I18N module.
168// i.e. every class/member that is either in the public API or annotated with
169// @IntraCoreApi.
170//
171// The API specification .txt files managed by this only contain the additional
172// classes/members that are in the intra-core API but which are not the public
173// API.
174droidstubs {
175 name: "i18n-module-intra-core-api-stubs-source",
176 visibility: [
177 // Needed to build core-all as using the compiled library, i.e.
178 // i18n.module.intra.core.api.stubs does not work due to limitations
179 // in javac.
180 "//libcore:__subpackages__",
181 ],
182 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000183 ":android_icu4j_repackaged_src_files",
184 ":libcore_icu_bridge_src_files",
Paul Duffincff90fa2019-10-02 10:18:28 +0100185 ],
186 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100187 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffincff90fa2019-10-02 10:18:28 +0100188
189 installable: false,
190 args: "--hide-annotation libcore.api.Hide " +
191 "--show-single-annotation libcore.api.IntraCoreApi " +
192 "--skip-annotation-instance-methods=false ",
193
194 api_filename: "api.txt",
195 removed_api_filename: "removed.txt",
196 previous_api: "previous.txt",
197 check_api: {
198 current: {
199 api_file: "api/intra/current-api.txt",
200 removed_api_file: "api/intra/current-removed.txt",
201 },
202 last_released: {
203 api_file: "api/intra/last-api.txt",
204 removed_api_file: "api/intra/last-removed.txt",
205 },
206 },
207}
208
209// A library containing the intra-core API stubs of the I18N module.
210//
211// Intra-core APIs are only intended for the use of other core library modules.
212java_library {
213 name: "i18n.module.intra.core.api.stubs",
214 visibility: [
215 "//libcore:__subpackages__",
216 ],
217 srcs: [
218 ":i18n-module-intra-core-api-stubs-source",
219 ],
220
221 sdk_version: "none",
222 system_modules: "art-module-intra-core-api-stubs-system-modules",
223}
224
Paul Duffin4321d6b2019-10-03 13:32:26 +0100225// Generates stub source files for the core platform API of the I18N module.
226// i.e. every class/member that is either in the public API or annotated with
227// @CorePlatformApi.
228//
229// The API specification .txt files managed by this only contain the additional
230// classes/members that are in the intra-core API but which are not in the public
231// API.
232droidstubs {
233 name: "i18n-module-platform-api-stubs-source",
234 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000235 ":android_icu4j_repackaged_src_files",
236 ":libcore_icu_bridge_src_files",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100237 ],
238 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100239 system_modules: "art-module-platform-api-stubs-system-modules",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100240
241 installable: false,
242 args: "--hide-annotation libcore.api.Hide " +
243 "--show-single-annotation libcore.api.CorePlatformApi " +
244 "--skip-annotation-instance-methods=false ",
245
246 api_filename: "api.txt",
247 removed_api_filename: "removed.txt",
248 previous_api: "previous.txt",
249
250 check_api: {
251 current: {
252 api_file: "api/platform/current-api.txt",
253 removed_api_file: "api/platform/current-removed.txt",
254 },
255 last_released: {
256 api_file: "api/platform/last-api.txt",
257 removed_api_file: "api/platform/last-removed.txt",
258 },
259 },
260}
261
262// A library containing the core platform API stubs of the I18N module.
263//
264// Core platform APIs are only intended for use of other parts of the platform, not the
265// core library modules.
266java_library {
267 name: "i18n.module.platform.api.stubs",
268 visibility: [
269 "//libcore:__subpackages__",
270 ],
271 srcs: [
272 ":i18n-module-platform-api-stubs-source",
273 ],
274 hostdex: true,
275
276 sdk_version: "none",
277 system_modules: "art-module-platform-api-stubs-system-modules",
278}
279
Colin Cross6e18e292018-09-11 16:41:13 -0700280//==========================================================
281// build repackaged ICU tests
282//
283// Target builds against core-libart and core-oj so that it can access all the
284// repackaged android.icu classes and methods and not just the ones available
285// through the Android API.
Colin Cross6e18e292018-09-11 16:41:13 -0700286//==========================================================
287java_test {
288 name: "android-icu4j-tests",
Paul Duffind772e592019-06-03 16:09:02 +0100289 visibility: [
290 "//cts/tests/tests/icu",
291 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700292
293 srcs: [
294 "src/main/tests/**/*.java",
295 "testing/src/**/*.java",
296 ],
Victor Changd956e992018-11-20 11:07:18 +0000297 java_resource_dirs: [
298 "src/main/tests",
Paul Duffin22d367a2019-06-25 12:06:26 +0100299 "testing/src",
Victor Changd956e992018-11-20 11:07:18 +0000300 ],
Paul Duffincddef922019-10-02 11:46:02 +0100301 libs: [
302 "core-icu4j",
303 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700304 static_libs: [
305 "junit",
306 "junit-params",
307 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700308
Neil Fuller45359cf2018-10-02 16:42:42 +0100309 patch_module: "java.base",
Paul Duffin7f35fb92019-06-07 14:10:01 +0100310 sdk_version: "none",
Paul Duffincddef922019-10-02 11:46:02 +0100311 system_modules: "art-module-intra-core-api-stubs-system-modules",
Colin Cross6e18e292018-09-11 16:41:13 -0700312}