blob: 14542a863eedce5c9ccbcf1fc3634aaf703ed979 [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 Duffin2a0b1a52019-09-30 13:22:57 +010030 "//libcore:__subpackages__",
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: [
108 "//art/build/apex",
109 "//external/robolectric-shadows",
110 "//frameworks/layoutlib",
111 ],
112 installable: true,
113 hostdex: true,
114
Victor Chang92c3bcf2019-10-07 11:36:39 +0100115 srcs: [":libcore_icu_bridge_src_files"],
116 static_libs: ["core-repackaged-icu4j"],
Paul Duffin2626a2a2019-10-08 15:17:42 +0100117
Paul Duffind31a0602019-09-26 16:23:55 +0100118 // It is important that core-icu4j is restricted to only use stable APIs from the ART module
119 // since it is in a different APEX module that can be updated independently.
120 sdk_version: "none",
Victor Chang92c3bcf2019-10-07 11:36:39 +0100121 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffind31a0602019-09-26 16:23:55 +0100122
123 dxflags: ["--core-library"],
Paul Duffind31a0602019-09-26 16:23:55 +0100124}
125
126//
127// Guaranteed unstripped versions of core-icu4j.
128//
129// The build system may or may not strip the core-icu4j. jar,
130// but this will not be stripped. See b/24535627.
131//
132java_library {
133 name: "core-icu4j-testdex",
134 installable: true,
135 static_libs: ["core-icu4j"],
136 sdk_version: "none",
137 system_modules: "art-module-public-api-stubs-system-modules",
138 dxflags: ["--core-library"],
139 dex_preopt: {
140 enabled: false,
141 },
142}
143
144// Generates stubs for the parts of the public SDK API provided by the i18n module.
145//
146// Only for use by i18n.module.public.api.stubs target below.
147droidstubs {
148 name: "i18n-module-public-api-stubs-gen",
149 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000150 ":android_icu4j_public_api_files",
Paul Duffind31a0602019-09-26 16:23:55 +0100151 ],
152 java_version: "1.9",
153 installable: false,
154 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100155 system_modules: "art-module-public-api-stubs-system-modules",
Paul Duffind31a0602019-09-26 16:23:55 +0100156}
157
158// A stubs target containing the parts of the public SDK API provided by the i18n module.
159java_library {
160 name: "i18n.module.public.api.stubs",
161 visibility: [
162 "//libcore",
163 ],
164 srcs: [":i18n-module-public-api-stubs-gen"],
165 errorprone: {
166 javacflags: [
167 "-Xep:MissingOverride:OFF",
168 ],
169 },
170 sdk_version: "none",
171 system_modules: "art-module-public-api-stubs-system-modules",
172}
173
Paul Duffincff90fa2019-10-02 10:18:28 +0100174// Generates stub source files for the intra-core API of the I18N module.
175// i.e. every class/member that is either in the public API or annotated with
176// @IntraCoreApi.
177//
178// The API specification .txt files managed by this only contain the additional
179// classes/members that are in the intra-core API but which are not the public
180// API.
181droidstubs {
182 name: "i18n-module-intra-core-api-stubs-source",
183 visibility: [
184 // Needed to build core-all as using the compiled library, i.e.
185 // i18n.module.intra.core.api.stubs does not work due to limitations
186 // in javac.
187 "//libcore:__subpackages__",
188 ],
189 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000190 ":android_icu4j_repackaged_src_files",
191 ":libcore_icu_bridge_src_files",
Paul Duffincff90fa2019-10-02 10:18:28 +0100192 ],
193 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100194 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffincff90fa2019-10-02 10:18:28 +0100195
196 installable: false,
197 args: "--hide-annotation libcore.api.Hide " +
198 "--show-single-annotation libcore.api.IntraCoreApi " +
199 "--skip-annotation-instance-methods=false ",
200
201 api_filename: "api.txt",
202 removed_api_filename: "removed.txt",
203 previous_api: "previous.txt",
204 check_api: {
205 current: {
206 api_file: "api/intra/current-api.txt",
207 removed_api_file: "api/intra/current-removed.txt",
208 },
209 last_released: {
210 api_file: "api/intra/last-api.txt",
211 removed_api_file: "api/intra/last-removed.txt",
212 },
213 },
214}
215
216// A library containing the intra-core API stubs of the I18N module.
217//
218// Intra-core APIs are only intended for the use of other core library modules.
219java_library {
220 name: "i18n.module.intra.core.api.stubs",
221 visibility: [
222 "//libcore:__subpackages__",
223 ],
224 srcs: [
225 ":i18n-module-intra-core-api-stubs-source",
226 ],
227
228 sdk_version: "none",
229 system_modules: "art-module-intra-core-api-stubs-system-modules",
230}
231
Paul Duffin4321d6b2019-10-03 13:32:26 +0100232// Generates stub source files for the core platform API of the I18N module.
233// i.e. every class/member that is either in the public API or annotated with
234// @CorePlatformApi.
235//
236// The API specification .txt files managed by this only contain the additional
237// classes/members that are in the intra-core API but which are not in the public
238// API.
239droidstubs {
240 name: "i18n-module-platform-api-stubs-source",
241 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000242 ":android_icu4j_repackaged_src_files",
243 ":libcore_icu_bridge_src_files",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100244 ],
245 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100246 system_modules: "art-module-platform-api-stubs-system-modules",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100247
248 installable: false,
249 args: "--hide-annotation libcore.api.Hide " +
250 "--show-single-annotation libcore.api.CorePlatformApi " +
251 "--skip-annotation-instance-methods=false ",
252
253 api_filename: "api.txt",
254 removed_api_filename: "removed.txt",
255 previous_api: "previous.txt",
256
257 check_api: {
258 current: {
259 api_file: "api/platform/current-api.txt",
260 removed_api_file: "api/platform/current-removed.txt",
261 },
262 last_released: {
263 api_file: "api/platform/last-api.txt",
264 removed_api_file: "api/platform/last-removed.txt",
265 },
266 },
267}
268
269// A library containing the core platform API stubs of the I18N module.
270//
271// Core platform APIs are only intended for use of other parts of the platform, not the
272// core library modules.
273java_library {
274 name: "i18n.module.platform.api.stubs",
275 visibility: [
276 "//libcore:__subpackages__",
277 ],
278 srcs: [
279 ":i18n-module-platform-api-stubs-source",
280 ],
281 hostdex: true,
282
283 sdk_version: "none",
284 system_modules: "art-module-platform-api-stubs-system-modules",
285}
286
Colin Cross6e18e292018-09-11 16:41:13 -0700287//==========================================================
288// build repackaged ICU tests
289//
290// Target builds against core-libart and core-oj so that it can access all the
291// repackaged android.icu classes and methods and not just the ones available
292// through the Android API.
Colin Cross6e18e292018-09-11 16:41:13 -0700293//==========================================================
294java_test {
295 name: "android-icu4j-tests",
Paul Duffind772e592019-06-03 16:09:02 +0100296 visibility: [
297 "//cts/tests/tests/icu",
298 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700299
300 srcs: [
301 "src/main/tests/**/*.java",
302 "testing/src/**/*.java",
303 ],
Victor Changd956e992018-11-20 11:07:18 +0000304 java_resource_dirs: [
305 "src/main/tests",
Paul Duffin22d367a2019-06-25 12:06:26 +0100306 "testing/src",
Victor Changd956e992018-11-20 11:07:18 +0000307 ],
Paul Duffincddef922019-10-02 11:46:02 +0100308 libs: [
309 "core-icu4j",
310 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700311 static_libs: [
312 "junit",
313 "junit-params",
314 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700315
Neil Fuller45359cf2018-10-02 16:42:42 +0100316 patch_module: "java.base",
Paul Duffin7f35fb92019-06-07 14:10:01 +0100317 sdk_version: "none",
Paul Duffincddef922019-10-02 11:46:02 +0100318 system_modules: "art-module-intra-core-api-stubs-system-modules",
Colin Cross6e18e292018-09-11 16:41:13 -0700319}