blob: 674999360154d4be79d846cd0029edefb4cb6dce [file] [log] [blame]
//
// Copyright (C) 2017 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package {
default_visibility: ["//visibility:private"],
}
//==========================================================
// build repackaged ICU for target
//
// This is done in the libcore/JavaLibraries.mk file as there are circular
// dependencies between ICU and libcore
//==========================================================
filegroup {
name: "android_icu4j_public_api_files",
visibility: [
"//frameworks/base",
],
srcs: [
":android_icu4j_repackaged_src_files",
],
path: "src/main/java",
}
filegroup {
name: "android_icu4j_repackaged_src_files",
srcs: ["src/main/java/android/icu/**/*.java"],
path: "src/main/java",
}
// The files contains Android-specific codes to expose intra-core APIs
// from ICU4J/ICU4C to libcore or core platform APIs to the framework.
// The package is com.android.icu.* and should not expose any public APIs.
filegroup {
name: "libcore_icu_bridge_src_files",
srcs: ["libcore_bridge/src/java/**/*.java"],
path: "libcore_bridge/src/java",
}
// timezone-related source that is also used in host tests / tools and its
// dependencies.
filegroup {
name: "timezone_host_files",
srcs: [
"libcore_bridge/src/java/com/android/i18n/timezone/TimeZoneDataFiles.java",
"libcore_bridge/src/java/com/android/i18n/timezone/TzDataSetVersion.java",
],
path: "libcore_bridge/src/java",
visibility: ["//libcore"],
}
// core-repackaged-icu4j contains only the repackaged ICU4J that does not
// use any internal or android specific code. If it ever did then it could depend on
// art-module-intra-core-api-stubs-system-modules (a superset) instead.
// It is important that core-icu4j is restricted to only use stable APIs from the ART module
// since it is in a different APEX module that can be updated independently.
java_library_static {
name: "core-repackaged-icu4j",
installable: false,
srcs: [":android_icu4j_repackaged_src_files"],
libs: ["unsupportedappusage"],
// The resource files are generated in the downstream branch master-icu-dev.
java_resource_dirs: ["resources"],
sdk_version: "none",
system_modules: "art-module-public-api-stubs-system-modules",
dxflags: ["--core-library"],
apex_available: [
"com.android.i18n",
],
errorprone: {
javacflags: [
"-Xep:MissingOverride:OFF", // Ignore missing @Override.
"-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom
],
},
}
// A separated core library that contains ICU4J because ICU4J will be in a different APEX module,
// not in ART module.
java_library {
name: "core-icu4j",
visibility: [
"//packages/modules/RuntimeI18n/apex",
"//external/robolectric-shadows",
"//frameworks/layoutlib",
"//art/build",
],
apex_available: [
"com.android.i18n",
],
permitted_packages: [
"android.icu",
"com.android.icu",
"com.android.i18n.timezone",
],
installable: true,
hostdex: false,
srcs: [":libcore_icu_bridge_src_files"],
static_libs: ["core-repackaged-icu4j"],
// It is important that core-icu4j is restricted to only use stable APIs from the ART module
// since it is in a different APEX module that can be updated independently.
sdk_version: "none",
system_modules: "art-module-intra-core-api-stubs-system-modules",
dxflags: ["--core-library"],
}
java_sdk_library {
name: "i18n.module.public.api",
visibility: [
"//libcore",
"//packages/modules/RuntimeI18n/apex",
// Visibility for prebuilt i18n-module-sdk from the prebuilt of
// this module.
// TODO(b/155921753): Restrict this when prebuilts are in their proper
// locations.
"//prebuilts:__subpackages__",
],
srcs: [
":android_icu4j_public_api_files",
],
errorprone: {
javacflags: [
"-Xep:MissingOverride:OFF",
],
},
api_dir: "api/public",
api_only: true,
sdk_version: "none",
system_modules: "art-module-public-api-stubs-system-modules",
}
// Referenced implicitly from i18n.module.intra.api.
filegroup {
name: "i18n.module.intra.api.api.public.latest",
srcs: [
"api/intra/last-api.txt",
],
}
// Referenced implicitly from i18n.module.intra.api.
filegroup {
name: "i18n.module.intra.api-removed.api.public.latest",
srcs: [
"api/intra/last-removed.txt",
],
}
// Generates stub source files for the intra-core API of the I18N module.
// i.e. every class/member that is either in the public API or annotated with
// @IntraCoreApi.
//
// The API specification .txt files managed by this only contain the additional
// classes/members that are in the intra-core API but which are not the public
// API.
java_sdk_library {
name: "i18n.module.intra.core.api",
srcs: [
":android_icu4j_repackaged_src_files",
":libcore_icu_bridge_src_files",
],
visibility: [
"//libcore:__subpackages__",
"//packages/modules/RuntimeI18n/apex",
// Visibility for prebuilt i18n-module-sdk from the prebuilt of
// this module.
// TODO(b/155921753): Restrict this when prebuilts are in their proper
// locations.
"//prebuilts:__subpackages__",
],
api_dir: "api/intra",
api_only: true,
sdk_version: "none",
system_modules: "art-module-intra-core-api-stubs-system-modules",
droiddoc_options: [
"--hide-annotation libcore.api.Hide ",
"--show-single-annotation libcore.api.IntraCoreApi ",
"--skip-annotation-instance-methods=false ",
],
}
// Referenced implicitly from legacy.i18n.module.platform.api.
filegroup {
name: "legacy.i18n.module.platform.api.api.public.latest",
srcs: [
"api/legacy_platform/last-api.txt",
],
}
// Referenced implicitly from legacy.i18n.module.platform.api.
filegroup {
name: "legacy.i18n.module.platform.api-removed.api.public.latest",
srcs: [
"api/legacy_platform/last-removed.txt",
],
}
// Referenced implicitly from stable.i18n.module.platform.api.
filegroup {
name: "stable.i18n.module.platform.api.api.public.latest",
srcs: [
"api/stable_platform/last-api.txt",
],
}
// Referenced implicitly from stable.i18n.module.platform.api.
filegroup {
name: "stable.i18n.module.platform.api-removed.api.public.latest",
srcs: [
"api/stable_platform/last-removed.txt",
],
}
// Generates stub source files for the core platform API of the I18N module.
// i.e. every class/member that is either in the public API or annotated with
// @CorePlatformApi.
//
// The API specification .txt files managed by this only contain the additional
// classes/members that are in the intra-core API but which are not in the public
// API.
//
// For notes on the legacy and stable versions see mmodules/core_platform_api/Android.bp.
java_sdk_library {
name: "legacy.i18n.module.platform.api",
srcs: [
":android_icu4j_repackaged_src_files",
":libcore_icu_bridge_src_files",
],
visibility: [
"//libcore:__subpackages__",
"//packages/modules/RuntimeI18n/apex",
// Visibility for prebuilt i18n-module-sdk from the prebuilt of
// this module.
// TODO(b/155921753): Restrict this when prebuilts are in their proper
// locations.
"//prebuilts:__subpackages__",
],
hostdex: true,
api_dir: "api/legacy_platform",
api_only: true,
sdk_version: "none",
system_modules: "legacy-art-module-platform-api-stubs-system-modules",
droiddoc_options: [
"--hide-annotation libcore.api.Hide ",
"--show-single-annotation libcore.api.CorePlatformApi ",
"--skip-annotation-instance-methods=false ",
],
}
java_sdk_library {
name: "stable.i18n.module.platform.api",
srcs: [
":android_icu4j_repackaged_src_files",
":libcore_icu_bridge_src_files",
],
visibility: [
"//libcore:__subpackages__",
"//packages/modules/RuntimeI18n/apex",
// Visibility for prebuilt i18n-module-sdk from the prebuilt of
// this module.
// TODO(b/155921753): Restrict this when prebuilts are in their proper
// locations.
"//prebuilts:__subpackages__",
],
hostdex: true,
api_dir: "api/stable_platform",
api_only: true,
sdk_version: "none",
system_modules: "stable-art-module-platform-api-stubs-system-modules",
droiddoc_options: [
"--hide-annotation libcore.api.Hide ",
"--show-single-annotation libcore.api.CorePlatformApi\\(status=libcore.api.CorePlatformApi.Status.STABLE\\)",
"--skip-annotation-instance-methods=false ",
],
}
//==========================================================
// build repackaged ICU tests
//
// Target builds against core-libart and core-oj so that it can access all the
// repackaged android.icu classes and methods and not just the ones available
// through the Android API.
//==========================================================
java_test {
name: "android-icu4j-tests",
visibility: [
"//cts/tests/tests/icu",
],
srcs: [
"src/main/tests/**/*.java",
"testing/src/**/*.java",
],
java_resource_dirs: [
"src/main/tests",
"testing/src",
],
libs: [
"core-icu4j",
],
static_libs: [
"junit",
"junit-params",
"tzdata-testing",
],
patch_module: "java.base",
sdk_version: "none",
system_modules: "art-module-intra-core-api-stubs-system-modules",
}