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 |
Victor Chang | 71d684d | 2020-05-15 18:17:49 +0100 | [diff] [blame] | 45 | // 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 Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 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 | |
Victor Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 53 | // 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. |
| 58 | java_library_static { |
| 59 | name: "core-repackaged-icu4j", |
| 60 | installable: false, |
| 61 | srcs: [":android_icu4j_repackaged_src_files"], |
Artur Satayev | 2fc4dc3 | 2019-12-10 12:12:35 +0000 | [diff] [blame] | 62 | libs: ["unsupportedappusage"], |
Victor Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 63 | // 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 Chang | aaf6845 | 2020-05-05 16:02:45 +0100 | [diff] [blame] | 70 | apex_available: [ |
| 71 | "com.android.i18n", |
| 72 | ], |
Victor Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 73 | errorprone: { |
| 74 | javacflags: [ |
| 75 | "-Xep:MissingOverride:OFF", // Ignore missing @Override. |
| 76 | "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom |
| 77 | ], |
| 78 | }, |
| 79 | } |
| 80 | |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 81 | // A separated core library that contains ICU4J because ICU4J will be in a different APEX module, |
| 82 | // not in ART module. |
| 83 | java_library { |
| 84 | name: "core-icu4j", |
| 85 | visibility: [ |
Victor Chang | a12ff87 | 2020-05-15 18:20:51 +0100 | [diff] [blame] | 86 | "//packages/modules/RuntimeI18n/apex", |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 87 | "//external/robolectric-shadows", |
| 88 | "//frameworks/layoutlib", |
Victor Chang | aaf6845 | 2020-05-05 16:02:45 +0100 | [diff] [blame] | 89 | "//art/build", |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 90 | ], |
Jiyong Park | 0ddd1ef | 2019-12-19 02:11:30 +0000 | [diff] [blame] | 91 | apex_available: [ |
Victor Chang | aaf6845 | 2020-05-05 16:02:45 +0100 | [diff] [blame] | 92 | "com.android.i18n", |
| 93 | ], |
| 94 | permitted_packages: [ |
| 95 | "android.icu", |
| 96 | "com.android.icu", |
Jiyong Park | 0ddd1ef | 2019-12-19 02:11:30 +0000 | [diff] [blame] | 97 | ], |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 98 | installable: true, |
Victor Chang | aaf6845 | 2020-05-05 16:02:45 +0100 | [diff] [blame] | 99 | hostdex: false, |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 100 | |
Victor Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 101 | srcs: [":libcore_icu_bridge_src_files"], |
| 102 | static_libs: ["core-repackaged-icu4j"], |
Paul Duffin | 2626a2a | 2019-10-08 15:17:42 +0100 | [diff] [blame] | 103 | |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 104 | // 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 Chang | 92c3bcf | 2019-10-07 11:36:39 +0100 | [diff] [blame] | 107 | system_modules: "art-module-intra-core-api-stubs-system-modules", |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 108 | |
| 109 | dxflags: ["--core-library"], |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 110 | } |
| 111 | |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 112 | // 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. |
| 115 | droidstubs { |
| 116 | name: "i18n-module-public-api-stubs-gen", |
| 117 | srcs: [ |
Victor Chang | c9ae0db | 2019-10-28 18:56:09 +0000 | [diff] [blame] | 118 | ":android_icu4j_public_api_files", |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 119 | ], |
| 120 | java_version: "1.9", |
| 121 | installable: false, |
| 122 | sdk_version: "none", |
Paul Duffin | 7d3b947 | 2019-10-11 15:18:54 +0100 | [diff] [blame] | 123 | system_modules: "art-module-public-api-stubs-system-modules", |
Paul Duffin | d31a060 | 2019-09-26 16:23:55 +0100 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | // A stubs target containing the parts of the public SDK API provided by the i18n module. |
| 127 | java_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 Duffin | cff90fa | 2019-10-02 10:18:28 +0100 | [diff] [blame] | 142 | // 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. |
| 149 | droidstubs { |
| 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 Chang | c9ae0db | 2019-10-28 18:56:09 +0000 | [diff] [blame] | 158 | ":android_icu4j_repackaged_src_files", |
| 159 | ":libcore_icu_bridge_src_files", |
Paul Duffin | cff90fa | 2019-10-02 10:18:28 +0100 | [diff] [blame] | 160 | ], |
| 161 | sdk_version: "none", |
Paul Duffin | 7d3b947 | 2019-10-11 15:18:54 +0100 | [diff] [blame] | 162 | system_modules: "art-module-intra-core-api-stubs-system-modules", |
Paul Duffin | cff90fa | 2019-10-02 10:18:28 +0100 | [diff] [blame] | 163 | |
| 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. |
| 187 | java_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 Duffin | 4321d6b | 2019-10-03 13:32:26 +0100 | [diff] [blame] | 200 | // 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. |
| 207 | droidstubs { |
| 208 | name: "i18n-module-platform-api-stubs-source", |
| 209 | srcs: [ |
Victor Chang | c9ae0db | 2019-10-28 18:56:09 +0000 | [diff] [blame] | 210 | ":android_icu4j_repackaged_src_files", |
| 211 | ":libcore_icu_bridge_src_files", |
Paul Duffin | 4321d6b | 2019-10-03 13:32:26 +0100 | [diff] [blame] | 212 | ], |
| 213 | sdk_version: "none", |
Paul Duffin | 7d3b947 | 2019-10-11 15:18:54 +0100 | [diff] [blame] | 214 | system_modules: "art-module-platform-api-stubs-system-modules", |
Paul Duffin | 4321d6b | 2019-10-03 13:32:26 +0100 | [diff] [blame] | 215 | |
| 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. |
| 241 | java_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 Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 255 | //========================================================== |
| 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 Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 261 | //========================================================== |
| 262 | java_test { |
| 263 | name: "android-icu4j-tests", |
Paul Duffin | d772e59 | 2019-06-03 16:09:02 +0100 | [diff] [blame] | 264 | visibility: [ |
| 265 | "//cts/tests/tests/icu", |
| 266 | ], |
Colin Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 267 | |
| 268 | srcs: [ |
| 269 | "src/main/tests/**/*.java", |
| 270 | "testing/src/**/*.java", |
| 271 | ], |
Victor Chang | d956e99 | 2018-11-20 11:07:18 +0000 | [diff] [blame] | 272 | java_resource_dirs: [ |
| 273 | "src/main/tests", |
Paul Duffin | 22d367a | 2019-06-25 12:06:26 +0100 | [diff] [blame] | 274 | "testing/src", |
Victor Chang | d956e99 | 2018-11-20 11:07:18 +0000 | [diff] [blame] | 275 | ], |
Paul Duffin | cddef92 | 2019-10-02 11:46:02 +0100 | [diff] [blame] | 276 | libs: [ |
| 277 | "core-icu4j", |
| 278 | ], |
Colin Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 279 | static_libs: [ |
| 280 | "junit", |
| 281 | "junit-params", |
| 282 | ], |
Colin Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 283 | |
Neil Fuller | 45359cf | 2018-10-02 16:42:42 +0100 | [diff] [blame] | 284 | patch_module: "java.base", |
Paul Duffin | 7f35fb9 | 2019-06-07 14:10:01 +0100 | [diff] [blame] | 285 | sdk_version: "none", |
Paul Duffin | cddef92 | 2019-10-02 11:46:02 +0100 | [diff] [blame] | 286 | system_modules: "art-module-intra-core-api-stubs-system-modules", |
Colin Cross | 6e18e29 | 2018-09-11 16:41:13 -0700 | [diff] [blame] | 287 | } |