blob: e2c6a24f9cbfd43e9ae3f280f9551cac257f13dd [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 Chang92c3bcf2019-10-07 11:36:39 +010053// core-repackaged-icu4j contains only the repackaged ICU4J that does not
54// use any internal or android specific code. If it ever did then it could depend on
55// art-module-intra-core-api-stubs-system-modules (a superset) instead.
56// It is important that core-icu4j is restricted to only use stable APIs from the ART module
57// since it is in a different APEX module that can be updated independently.
58java_library_static {
59 name: "core-repackaged-icu4j",
60 installable: false,
61 srcs: [":android_icu4j_repackaged_src_files"],
Artur Satayev2fc4dc32019-12-10 12:12:35 +000062 libs: ["unsupportedappusage"],
Victor Chang92c3bcf2019-10-07 11:36:39 +010063 // The resource files are generated in the downstream branch master-icu-dev.
64 java_resource_dirs: ["resources"],
65
66 sdk_version: "none",
67 system_modules: "art-module-public-api-stubs-system-modules",
68
69 dxflags: ["--core-library"],
Victor Changaaf68452020-05-05 16:02:45 +010070 apex_available: [
71 "com.android.i18n",
72 ],
Victor Chang92c3bcf2019-10-07 11:36:39 +010073 errorprone: {
74 javacflags: [
75 "-Xep:MissingOverride:OFF", // Ignore missing @Override.
76 "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom
77 ],
78 },
79}
80
Paul Duffind31a0602019-09-26 16:23:55 +010081// A separated core library that contains ICU4J because ICU4J will be in a different APEX module,
82// not in ART module.
83java_library {
84 name: "core-icu4j",
85 visibility: [
Victor Changa12ff872020-05-15 18:20:51 +010086 "//packages/modules/RuntimeI18n/apex",
Paul Duffind31a0602019-09-26 16:23:55 +010087 "//external/robolectric-shadows",
88 "//frameworks/layoutlib",
Victor Changaaf68452020-05-05 16:02:45 +010089 "//art/build",
Paul Duffind31a0602019-09-26 16:23:55 +010090 ],
Jiyong Park0ddd1ef2019-12-19 02:11:30 +000091 apex_available: [
Victor Changaaf68452020-05-05 16:02:45 +010092 "com.android.i18n",
93 ],
94 permitted_packages: [
95 "android.icu",
96 "com.android.icu",
Jiyong Park0ddd1ef2019-12-19 02:11:30 +000097 ],
Paul Duffind31a0602019-09-26 16:23:55 +010098 installable: true,
Victor Changaaf68452020-05-05 16:02:45 +010099 hostdex: false,
Paul Duffind31a0602019-09-26 16:23:55 +0100100
Victor Chang92c3bcf2019-10-07 11:36:39 +0100101 srcs: [":libcore_icu_bridge_src_files"],
102 static_libs: ["core-repackaged-icu4j"],
Paul Duffin2626a2a2019-10-08 15:17:42 +0100103
Paul Duffind31a0602019-09-26 16:23:55 +0100104 // It is important that core-icu4j is restricted to only use stable APIs from the ART module
105 // since it is in a different APEX module that can be updated independently.
106 sdk_version: "none",
Victor Chang92c3bcf2019-10-07 11:36:39 +0100107 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffind31a0602019-09-26 16:23:55 +0100108
109 dxflags: ["--core-library"],
Paul Duffind31a0602019-09-26 16:23:55 +0100110}
111
Paul Duffind31a0602019-09-26 16:23:55 +0100112// Generates stubs for the parts of the public SDK API provided by the i18n module.
113//
114// Only for use by i18n.module.public.api.stubs target below.
115droidstubs {
116 name: "i18n-module-public-api-stubs-gen",
117 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000118 ":android_icu4j_public_api_files",
Paul Duffind31a0602019-09-26 16:23:55 +0100119 ],
120 java_version: "1.9",
121 installable: false,
122 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100123 system_modules: "art-module-public-api-stubs-system-modules",
Paul Duffind31a0602019-09-26 16:23:55 +0100124}
125
126// A stubs target containing the parts of the public SDK API provided by the i18n module.
127java_library {
128 name: "i18n.module.public.api.stubs",
129 visibility: [
130 "//libcore",
131 ],
132 srcs: [":i18n-module-public-api-stubs-gen"],
133 errorprone: {
134 javacflags: [
135 "-Xep:MissingOverride:OFF",
136 ],
137 },
138 sdk_version: "none",
139 system_modules: "art-module-public-api-stubs-system-modules",
140}
141
Paul Duffincff90fa2019-10-02 10:18:28 +0100142// Generates stub source files for the intra-core API of the I18N module.
143// i.e. every class/member that is either in the public API or annotated with
144// @IntraCoreApi.
145//
146// The API specification .txt files managed by this only contain the additional
147// classes/members that are in the intra-core API but which are not the public
148// API.
149droidstubs {
150 name: "i18n-module-intra-core-api-stubs-source",
151 visibility: [
152 // Needed to build core-all as using the compiled library, i.e.
153 // i18n.module.intra.core.api.stubs does not work due to limitations
154 // in javac.
155 "//libcore:__subpackages__",
156 ],
157 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000158 ":android_icu4j_repackaged_src_files",
159 ":libcore_icu_bridge_src_files",
Paul Duffincff90fa2019-10-02 10:18:28 +0100160 ],
161 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100162 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffincff90fa2019-10-02 10:18:28 +0100163
164 installable: false,
165 args: "--hide-annotation libcore.api.Hide " +
166 "--show-single-annotation libcore.api.IntraCoreApi " +
167 "--skip-annotation-instance-methods=false ",
168
169 api_filename: "api.txt",
170 removed_api_filename: "removed.txt",
171 previous_api: "previous.txt",
172 check_api: {
173 current: {
174 api_file: "api/intra/current-api.txt",
175 removed_api_file: "api/intra/current-removed.txt",
176 },
177 last_released: {
178 api_file: "api/intra/last-api.txt",
179 removed_api_file: "api/intra/last-removed.txt",
180 },
181 },
182}
183
184// A library containing the intra-core API stubs of the I18N module.
185//
186// Intra-core APIs are only intended for the use of other core library modules.
187java_library {
188 name: "i18n.module.intra.core.api.stubs",
189 visibility: [
190 "//libcore:__subpackages__",
191 ],
192 srcs: [
193 ":i18n-module-intra-core-api-stubs-source",
194 ],
195
196 sdk_version: "none",
197 system_modules: "art-module-intra-core-api-stubs-system-modules",
198}
199
Paul Duffin4321d6b2019-10-03 13:32:26 +0100200// Generates stub source files for the core platform API of the I18N module.
201// i.e. every class/member that is either in the public API or annotated with
202// @CorePlatformApi.
203//
204// The API specification .txt files managed by this only contain the additional
205// classes/members that are in the intra-core API but which are not in the public
206// API.
207droidstubs {
208 name: "i18n-module-platform-api-stubs-source",
209 srcs: [
Victor Changc9ae0db2019-10-28 18:56:09 +0000210 ":android_icu4j_repackaged_src_files",
211 ":libcore_icu_bridge_src_files",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100212 ],
213 sdk_version: "none",
Paul Duffin7d3b9472019-10-11 15:18:54 +0100214 system_modules: "art-module-platform-api-stubs-system-modules",
Paul Duffin4321d6b2019-10-03 13:32:26 +0100215
216 installable: false,
217 args: "--hide-annotation libcore.api.Hide " +
218 "--show-single-annotation libcore.api.CorePlatformApi " +
219 "--skip-annotation-instance-methods=false ",
220
221 api_filename: "api.txt",
222 removed_api_filename: "removed.txt",
223 previous_api: "previous.txt",
224
225 check_api: {
226 current: {
227 api_file: "api/platform/current-api.txt",
228 removed_api_file: "api/platform/current-removed.txt",
229 },
230 last_released: {
231 api_file: "api/platform/last-api.txt",
232 removed_api_file: "api/platform/last-removed.txt",
233 },
234 },
235}
236
237// A library containing the core platform API stubs of the I18N module.
238//
239// Core platform APIs are only intended for use of other parts of the platform, not the
240// core library modules.
241java_library {
242 name: "i18n.module.platform.api.stubs",
243 visibility: [
244 "//libcore:__subpackages__",
245 ],
246 srcs: [
247 ":i18n-module-platform-api-stubs-source",
248 ],
249 hostdex: true,
250
251 sdk_version: "none",
252 system_modules: "art-module-platform-api-stubs-system-modules",
253}
254
Colin Cross6e18e292018-09-11 16:41:13 -0700255//==========================================================
256// build repackaged ICU tests
257//
258// Target builds against core-libart and core-oj so that it can access all the
259// repackaged android.icu classes and methods and not just the ones available
260// through the Android API.
Colin Cross6e18e292018-09-11 16:41:13 -0700261//==========================================================
262java_test {
263 name: "android-icu4j-tests",
Paul Duffind772e592019-06-03 16:09:02 +0100264 visibility: [
265 "//cts/tests/tests/icu",
266 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700267
268 srcs: [
269 "src/main/tests/**/*.java",
270 "testing/src/**/*.java",
271 ],
Victor Changd956e992018-11-20 11:07:18 +0000272 java_resource_dirs: [
273 "src/main/tests",
Paul Duffin22d367a2019-06-25 12:06:26 +0100274 "testing/src",
Victor Changd956e992018-11-20 11:07:18 +0000275 ],
Paul Duffincddef922019-10-02 11:46:02 +0100276 libs: [
277 "core-icu4j",
278 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700279 static_libs: [
280 "junit",
281 "junit-params",
282 ],
Colin Cross6e18e292018-09-11 16:41:13 -0700283
Neil Fuller45359cf2018-10-02 16:42:42 +0100284 patch_module: "java.base",
Paul Duffin7f35fb92019-06-07 14:10:01 +0100285 sdk_version: "none",
Paul Duffincddef922019-10-02 11:46:02 +0100286 system_modules: "art-module-intra-core-api-stubs-system-modules",
Colin Cross6e18e292018-09-11 16:41:13 -0700287}