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 | 093a404 | 2020-03-26 15:36:49 +0000 | [diff] [blame] | 30 | "//frameworks/base", |
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"], |
Victor Chang | 7008994 | 2020-04-03 19:01:55 +0100 | [diff] [blame^] | 95 | apex_available: [ |
| 96 | "com.android.i18n", |
| 97 | ], |
Victor Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 98 | errorprone: { |
| 99 | javacflags: [ |
| 100 | "-Xep:MissingOverride:OFF", // Ignore missing @Override. |
| 101 | "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom |
| 102 | ], |
| 103 | }, |
| 104 | } |
| 105 | |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 106 | // A separated core library that contains ICU4J because ICU4J will be in a different APEX module, |
| 107 | // not in ART module. |
| 108 | java_library { |
| 109 | name: "core-icu4j", |
| 110 | visibility: [ |
Victor Chang | 7008994 | 2020-04-03 19:01:55 +0100 | [diff] [blame^] | 111 | "//libcore/apex", |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 112 | "//external/robolectric-shadows", |
| 113 | "//frameworks/layoutlib", |
Victor Chang | 7008994 | 2020-04-03 19:01:55 +0100 | [diff] [blame^] | 114 | "//art/build", |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 115 | ], |
Jiyong Park | 0ddd1ef | 2019-12-19 02:11:30 +0000 | [diff] [blame] | 116 | apex_available: [ |
Victor Chang | 7008994 | 2020-04-03 19:01:55 +0100 | [diff] [blame^] | 117 | "com.android.i18n", |
| 118 | ], |
| 119 | permitted_packages: [ |
| 120 | "android.icu", |
| 121 | "com.android.icu", |
Jiyong Park | 0ddd1ef | 2019-12-19 02:11:30 +0000 | [diff] [blame] | 122 | ], |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 123 | installable: true, |
Victor Chang | 7008994 | 2020-04-03 19:01:55 +0100 | [diff] [blame^] | 124 | hostdex: false, |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 125 | |
Victor Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 126 | srcs: [":libcore_icu_bridge_src_files"], |
| 127 | static_libs: ["core-repackaged-icu4j"], |
Paul Duffin | 2626a2a | 2019-10-08 15:17:42 +0100 | [diff] [blame] | 128 | |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 129 | // 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 Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 132 | system_modules: "art-module-intra-core-api-stubs-system-modules", |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 133 | |
| 134 | dxflags: ["--core-library"], |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 135 | } |
| 136 | |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 137 | // 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. |
| 140 | droidstubs { |
| 141 | name: "i18n-module-public-api-stubs-gen", |
| 142 | srcs: [ |
Victor Chang | c9ae0db | 2019-10-28 18:56:09 +0000 | [diff] [blame] | 143 | ":android_icu4j_public_api_files", |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 144 | ], |
| 145 | java_version: "1.9", |
| 146 | installable: false, |
| 147 | sdk_version: "none", |
Paul Duffin | 7d3b947 | 2019-10-11 15:18:54 +0100 | [diff] [blame] | 148 | system_modules: "art-module-public-api-stubs-system-modules", |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | // A stubs target containing the parts of the public SDK API provided by the i18n module. |
| 152 | java_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 Duffin | cff90fa | 2019-10-02 10:18:28 +0100 | [diff] [blame] | 167 | // 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. |
| 174 | droidstubs { |
| 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 Chang | c9ae0db | 2019-10-28 18:56:09 +0000 | [diff] [blame] | 183 | ":android_icu4j_repackaged_src_files", |
| 184 | ":libcore_icu_bridge_src_files", |
Paul Duffin | cff90fa | 2019-10-02 10:18:28 +0100 | [diff] [blame] | 185 | ], |
| 186 | sdk_version: "none", |
Paul Duffin | 7d3b947 | 2019-10-11 15:18:54 +0100 | [diff] [blame] | 187 | system_modules: "art-module-intra-core-api-stubs-system-modules", |
Paul Duffin | cff90fa | 2019-10-02 10:18:28 +0100 | [diff] [blame] | 188 | |
| 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. |
| 212 | java_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 Duffin | 4321d6b | 2019-10-03 13:32:26 +0100 | [diff] [blame] | 225 | // 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. |
| 232 | droidstubs { |
| 233 | name: "i18n-module-platform-api-stubs-source", |
| 234 | srcs: [ |
Victor Chang | c9ae0db | 2019-10-28 18:56:09 +0000 | [diff] [blame] | 235 | ":android_icu4j_repackaged_src_files", |
| 236 | ":libcore_icu_bridge_src_files", |
Paul Duffin | 4321d6b | 2019-10-03 13:32:26 +0100 | [diff] [blame] | 237 | ], |
| 238 | sdk_version: "none", |
Paul Duffin | 7d3b947 | 2019-10-11 15:18:54 +0100 | [diff] [blame] | 239 | system_modules: "art-module-platform-api-stubs-system-modules", |
Paul Duffin | 4321d6b | 2019-10-03 13:32:26 +0100 | [diff] [blame] | 240 | |
| 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. |
| 266 | java_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 Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 280 | //========================================================== |
| 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 Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 286 | //========================================================== |
| 287 | java_test { |
| 288 | name: "android-icu4j-tests", |
Paul Duffin | d772e59 | 2019-06-03 16:09:02 +0100 | [diff] [blame] | 289 | visibility: [ |
| 290 | "//cts/tests/tests/icu", |
| 291 | ], |
Colin Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 292 | |
| 293 | srcs: [ |
| 294 | "src/main/tests/**/*.java", |
| 295 | "testing/src/**/*.java", |
| 296 | ], |
Victor Chang | d956e99 | 2018-11-20 11:07:18 +0000 | [diff] [blame] | 297 | java_resource_dirs: [ |
| 298 | "src/main/tests", |
Paul Duffin | 22d367a | 2019-06-25 12:06:26 +0100 | [diff] [blame] | 299 | "testing/src", |
Victor Chang | d956e99 | 2018-11-20 11:07:18 +0000 | [diff] [blame] | 300 | ], |
Paul Duffin | cddef92 | 2019-10-02 11:46:02 +0100 | [diff] [blame] | 301 | libs: [ |
| 302 | "core-icu4j", |
| 303 | ], |
Colin Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 304 | static_libs: [ |
| 305 | "junit", |
| 306 | "junit-params", |
| 307 | ], |
Colin Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 308 | |
Neil Fuller | 45359cf | 2018-10-02 16:42:42 +0100 | [diff] [blame] | 309 | patch_module: "java.base", |
Paul Duffin | 7f35fb9 | 2019-06-07 14:10:01 +0100 | [diff] [blame] | 310 | sdk_version: "none", |
Paul Duffin | cddef92 | 2019-10-02 11:46:02 +0100 | [diff] [blame] | 311 | system_modules: "art-module-intra-core-api-stubs-system-modules", |
Colin Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 312 | } |