blob: f95a672b29ed1fc6b2f1385f220f196cd92ce756 [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"],
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: [
vichangedff2872020-05-05 11:11:30 +0000108 "//art/build/apex",
Paul Duffind31a0602019-09-26 16:23:55 +0100109 "//external/robolectric-shadows",
110 "//frameworks/layoutlib",
111 ],
Jiyong Park0ddd1ef2019-12-19 02:11:30 +0000112 apex_available: [
vichangedff2872020-05-05 11:11:30 +0000113 "com.android.art.release",
114 "com.android.art.debug",
Jiyong Park0ddd1ef2019-12-19 02:11:30 +0000115 ],
Paul Duffind31a0602019-09-26 16:23:55 +0100116 installable: true,
vichangedff2872020-05-05 11:11:30 +0000117 hostdex: true,
Paul Duffind31a0602019-09-26 16:23:55 +0100118
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
Paul Duffind31a0602019-09-26 16:23:55 +0100130// Generates stubs for the parts of the public SDK API provided by the i18n module.
131//
132// Only for use by i18n.module.public.api.stubs target below.
133droidstubs {
134 name: "i18n-module-public-api-stubs-gen",
135 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000136 ":android_icu4j_public_api_files",
Paul Duffind31a0602019-09-26 16:23:55 +0100137 ],
138 java_version: "1.9",
139 installable: false,
140 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100141 system_modules: "art-module-public-api-stubs-system-modules",
Paul Duffind31a0602019-09-26 16:23:55 +0100142}
143
144// A stubs target containing the parts of the public SDK API provided by the i18n module.
145java_library {
146 name: "i18n.module.public.api.stubs",
147 visibility: [
148 "//libcore",
149 ],
150 srcs: [":i18n-module-public-api-stubs-gen"],
151 errorprone: {
152 javacflags: [
153 "-Xep:MissingOverride:OFF",
154 ],
155 },
156 sdk_version: "none",
157 system_modules: "art-module-public-api-stubs-system-modules",
158}
159
Paul Duffincff90fa2019-10-02 10:18:28 +0100160// Generates stub source files for the intra-core API of the I18N module.
161// i.e. every class/member that is either in the public API or annotated with
162// @IntraCoreApi.
163//
164// The API specification .txt files managed by this only contain the additional
165// classes/members that are in the intra-core API but which are not the public
166// API.
167droidstubs {
168 name: "i18n-module-intra-core-api-stubs-source",
169 visibility: [
170 // Needed to build core-all as using the compiled library, i.e.
171 // i18n.module.intra.core.api.stubs does not work due to limitations
172 // in javac.
173 "//libcore:__subpackages__",
174 ],
175 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000176 ":android_icu4j_repackaged_src_files",
177 ":libcore_icu_bridge_src_files",
Paul Duffincff90fa2019-10-02 10:18:28 +0100178 ],
179 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100180 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffincff90fa2019-10-02 10:18:28 +0100181
182 installable: false,
183 args: "--hide-annotation libcore.api.Hide " +
184 "--show-single-annotation libcore.api.IntraCoreApi " +
185 "--skip-annotation-instance-methods=false ",
186
187 api_filename: "api.txt",
188 removed_api_filename: "removed.txt",
189 previous_api: "previous.txt",
190 check_api: {
191 current: {
192 api_file: "api/intra/current-api.txt",
193 removed_api_file: "api/intra/current-removed.txt",
194 },
195 last_released: {
196 api_file: "api/intra/last-api.txt",
197 removed_api_file: "api/intra/last-removed.txt",
198 },
199 },
200}
201
202// A library containing the intra-core API stubs of the I18N module.
203//
204// Intra-core APIs are only intended for the use of other core library modules.
205java_library {
206 name: "i18n.module.intra.core.api.stubs",
207 visibility: [
208 "//libcore:__subpackages__",
209 ],
210 srcs: [
211 ":i18n-module-intra-core-api-stubs-source",
212 ],
213
214 sdk_version: "none",
215 system_modules: "art-module-intra-core-api-stubs-system-modules",
216}
217
Paul Duffin4321d6b2019-10-03 13:32:26 +0100218// Generates stub source files for the core platform API of the I18N module.
219// i.e. every class/member that is either in the public API or annotated with
220// @CorePlatformApi.
221//
222// The API specification .txt files managed by this only contain the additional
223// classes/members that are in the intra-core API but which are not in the public
224// API.
225droidstubs {
226 name: "i18n-module-platform-api-stubs-source",
227 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000228 ":android_icu4j_repackaged_src_files",
229 ":libcore_icu_bridge_src_files",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100230 ],
231 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100232 system_modules: "art-module-platform-api-stubs-system-modules",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100233
234 installable: false,
235 args: "--hide-annotation libcore.api.Hide " +
236 "--show-single-annotation libcore.api.CorePlatformApi " +
237 "--skip-annotation-instance-methods=false ",
238
239 api_filename: "api.txt",
240 removed_api_filename: "removed.txt",
241 previous_api: "previous.txt",
242
243 check_api: {
244 current: {
245 api_file: "api/platform/current-api.txt",
246 removed_api_file: "api/platform/current-removed.txt",
247 },
248 last_released: {
249 api_file: "api/platform/last-api.txt",
250 removed_api_file: "api/platform/last-removed.txt",
251 },
252 },
253}
254
255// A library containing the core platform API stubs of the I18N module.
256//
257// Core platform APIs are only intended for use of other parts of the platform, not the
258// core library modules.
259java_library {
260 name: "i18n.module.platform.api.stubs",
261 visibility: [
262 "//libcore:__subpackages__",
263 ],
264 srcs: [
265 ":i18n-module-platform-api-stubs-source",
266 ],
267 hostdex: true,
268
269 sdk_version: "none",
270 system_modules: "art-module-platform-api-stubs-system-modules",
271}
272
Colin Cross6e18e292018-09-11 16:41:13 -0700273//==========================================================
274// build repackaged ICU tests
275//
276// Target builds against core-libart and core-oj so that it can access all the
277// repackaged android.icu classes and methods and not just the ones available
278// through the Android API.
Colin Cross6e18e292018-09-11 16:41:13 -0700279//==========================================================
280java_test {
281 name: "android-icu4j-tests",
Paul Duffind772e592019-06-03 16:09:02 +0100282 visibility: [
283 "//cts/tests/tests/icu",
284 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700285
286 srcs: [
287 "src/main/tests/**/*.java",
288 "testing/src/**/*.java",
289 ],
Victor Changd956e992018-11-20 11:07:18 +0000290 java_resource_dirs: [
291 "src/main/tests",
Paul Duffin22d367a2019-06-25 12:06:26 +0100292 "testing/src",
Victor Changd956e992018-11-20 11:07:18 +0000293 ],
Paul Duffincddef922019-10-02 11:46:02 +0100294 libs: [
295 "core-icu4j",
296 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700297 static_libs: [
298 "junit",
299 "junit-params",
300 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700301
Neil Fuller45359cf2018-10-02 16:42:42 +0100302 patch_module: "java.base",
Paul Duffin7f35fb92019-06-07 14:10:01 +0100303 sdk_version: "none",
Paul Duffincddef922019-10-02 11:46:02 +0100304 system_modules: "art-module-intra-core-api-stubs-system-modules",
Colin Cross6e18e292018-09-11 16:41:13 -0700305}