Colin Cross | 9a51b15 | 2017-08-29 16:04:52 -0700 | [diff] [blame] | 1 | // |
| 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 Duffin | d772e59 | 2019-06-03 16:09:02 +0100 | [diff] [blame] | 17 | package { |
| 18 | default_visibility: ["//visibility:private"], |
| 19 | } |
| 20 | |
Colin Cross | 9a51b15 | 2017-08-29 16:04:52 -0700 | [diff] [blame] | 21 | //========================================================== |
| 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 | //========================================================== |
| 27 | filegroup { |
Victor Chang | c9ae0db | 2019-10-28 18:56:09 +0000 | [diff] [blame] | 28 | name: "android_icu4j_public_api_files", |
Paul Duffin | d772e59 | 2019-06-03 16:09:02 +0100 | [diff] [blame] | 29 | visibility: [ |
Paul Duffin | 2a0b1a5 | 2019-09-30 13:22:57 +0100 | [diff] [blame] | 30 | "//libcore:__subpackages__", |
Paul Duffin | d772e59 | 2019-06-03 16:09:02 +0100 | [diff] [blame] | 31 | ], |
Victor Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 32 | srcs: [ |
| 33 | ":android_icu4j_repackaged_src_files", |
Victor Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 34 | ], |
Jiyong Park | 684fe8a | 2019-08-19 13:23:42 +0900 | [diff] [blame] | 35 | path: "src/main/java", |
Colin Cross | 9a51b15 | 2017-08-29 16:04:52 -0700 | [diff] [blame] | 36 | } |
| 37 | |
Victor Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 38 | filegroup { |
| 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. |
| 47 | filegroup { |
| 48 | name: "libcore_icu_bridge_src_files", |
Victor Chang | c9ae0db | 2019-10-28 18:56:09 +0000 | [diff] [blame] | 49 | srcs: ["libcore_bridge/src/java/**/*.java"], |
| 50 | path: "libcore_bridge/src/java", |
Victor Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | // Rule generating resource lib for android_icu4j. |
| 54 | // In the downstream branch master-icu-dev, the resource files are generated. |
| 55 | java_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 | |
| 69 | java_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. |
| 83 | java_library_static { |
| 84 | name: "core-repackaged-icu4j", |
| 85 | installable: false, |
| 86 | srcs: [":android_icu4j_repackaged_src_files"], |
Artur Satayev | 2fc4dc3 | 2019-12-10 12:12:35 +0000 | [diff] [blame^] | 87 | libs: ["unsupportedappusage"], |
Victor Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 88 | // 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 Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 103 | // A separated core library that contains ICU4J because ICU4J will be in a different APEX module, |
| 104 | // not in ART module. |
| 105 | java_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 Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 115 | srcs: [":libcore_icu_bridge_src_files"], |
| 116 | static_libs: ["core-repackaged-icu4j"], |
Paul Duffin | 2626a2a | 2019-10-08 15:17:42 +0100 | [diff] [blame] | 117 | |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 118 | // 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 Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 121 | system_modules: "art-module-intra-core-api-stubs-system-modules", |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 122 | |
| 123 | dxflags: ["--core-library"], |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 124 | } |
| 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 | // |
| 132 | java_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. |
| 147 | droidstubs { |
| 148 | name: "i18n-module-public-api-stubs-gen", |
| 149 | srcs: [ |
Victor Chang | c9ae0db | 2019-10-28 18:56:09 +0000 | [diff] [blame] | 150 | ":android_icu4j_public_api_files", |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 151 | ], |
| 152 | java_version: "1.9", |
| 153 | installable: false, |
| 154 | sdk_version: "none", |
Paul Duffin | 7d3b947 | 2019-10-11 15:18:54 +0100 | [diff] [blame] | 155 | system_modules: "art-module-public-api-stubs-system-modules", |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 156 | } |
| 157 | |
| 158 | // A stubs target containing the parts of the public SDK API provided by the i18n module. |
| 159 | java_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 Duffin | cff90fa | 2019-10-02 10:18:28 +0100 | [diff] [blame] | 174 | // 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. |
| 181 | droidstubs { |
| 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 Chang | c9ae0db | 2019-10-28 18:56:09 +0000 | [diff] [blame] | 190 | ":android_icu4j_repackaged_src_files", |
| 191 | ":libcore_icu_bridge_src_files", |
Paul Duffin | cff90fa | 2019-10-02 10:18:28 +0100 | [diff] [blame] | 192 | ], |
| 193 | sdk_version: "none", |
Paul Duffin | 7d3b947 | 2019-10-11 15:18:54 +0100 | [diff] [blame] | 194 | system_modules: "art-module-intra-core-api-stubs-system-modules", |
Paul Duffin | cff90fa | 2019-10-02 10:18:28 +0100 | [diff] [blame] | 195 | |
| 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. |
| 219 | java_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 Duffin | 4321d6b | 2019-10-03 13:32:26 +0100 | [diff] [blame] | 232 | // 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. |
| 239 | droidstubs { |
| 240 | name: "i18n-module-platform-api-stubs-source", |
| 241 | srcs: [ |
Victor Chang | c9ae0db | 2019-10-28 18:56:09 +0000 | [diff] [blame] | 242 | ":android_icu4j_repackaged_src_files", |
| 243 | ":libcore_icu_bridge_src_files", |
Paul Duffin | 4321d6b | 2019-10-03 13:32:26 +0100 | [diff] [blame] | 244 | ], |
| 245 | sdk_version: "none", |
Paul Duffin | 7d3b947 | 2019-10-11 15:18:54 +0100 | [diff] [blame] | 246 | system_modules: "art-module-platform-api-stubs-system-modules", |
Paul Duffin | 4321d6b | 2019-10-03 13:32:26 +0100 | [diff] [blame] | 247 | |
| 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. |
| 273 | java_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 Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 287 | //========================================================== |
| 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 Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 293 | //========================================================== |
| 294 | java_test { |
| 295 | name: "android-icu4j-tests", |
Paul Duffin | d772e59 | 2019-06-03 16:09:02 +0100 | [diff] [blame] | 296 | visibility: [ |
| 297 | "//cts/tests/tests/icu", |
| 298 | ], |
Colin Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 299 | |
| 300 | srcs: [ |
| 301 | "src/main/tests/**/*.java", |
| 302 | "testing/src/**/*.java", |
| 303 | ], |
Victor Chang | d956e99 | 2018-11-20 11:07:18 +0000 | [diff] [blame] | 304 | java_resource_dirs: [ |
| 305 | "src/main/tests", |
Paul Duffin | 22d367a | 2019-06-25 12:06:26 +0100 | [diff] [blame] | 306 | "testing/src", |
Victor Chang | d956e99 | 2018-11-20 11:07:18 +0000 | [diff] [blame] | 307 | ], |
Paul Duffin | cddef92 | 2019-10-02 11:46:02 +0100 | [diff] [blame] | 308 | libs: [ |
| 309 | "core-icu4j", |
| 310 | ], |
Colin Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 311 | static_libs: [ |
| 312 | "junit", |
| 313 | "junit-params", |
| 314 | ], |
Colin Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 315 | |
Neil Fuller | 45359cf | 2018-10-02 16:42:42 +0100 | [diff] [blame] | 316 | patch_module: "java.base", |
Paul Duffin | 7f35fb9 | 2019-06-07 14:10:01 +0100 | [diff] [blame] | 317 | sdk_version: "none", |
Paul Duffin | cddef92 | 2019-10-02 11:46:02 +0100 | [diff] [blame] | 318 | system_modules: "art-module-intra-core-api-stubs-system-modules", |
Colin Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 319 | } |