blob: 5759deec5c82c78534bf9ec9e01d3c110a5c7512 [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. 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",
}
// Rule generating resource lib for android_icu4j.
// In the downstream branch master-icu-dev, the resource files are generated.
java_library {
name: "android_icu4j_resources_lib",
visibility: [
"//libcore",
],
java_resource_dirs: ["resources"],
sdk_version: "none",
system_modules: "none",
}
// Same as android_icu4j_resources_lib but compiling against core_current sdk
// in order to avoid using non-public API from core-libart and core-oj
// because core-icu4j will be in a different i18n APEX module.
java_library {
name: "android_icu4j_resources_lib_sdk_core_current",
visibility: [
"//libcore",
],
java_resource_dirs: ["resources"],
sdk_version: "core_current",
}
// 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: [
"//libcore/apex",
"//external/robolectric-shadows",
"//frameworks/layoutlib",
"//art/build",
],
apex_available: [
"com.android.i18n",
],
permitted_packages: [
"android.icu",
"com.android.icu",
],
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"],
}
// Generates stubs for the parts of the public SDK API provided by the i18n module.
//
// Only for use by i18n.module.public.api.stubs target below.
droidstubs {
name: "i18n-module-public-api-stubs-gen",
srcs: [
":android_icu4j_public_api_files",
],
java_version: "1.9",
installable: false,
sdk_version: "none",
system_modules: "art-module-public-api-stubs-system-modules",
}
// A stubs target containing the parts of the public SDK API provided by the i18n module.
java_library {
name: "i18n.module.public.api.stubs",
visibility: [
"//libcore",
],
srcs: [":i18n-module-public-api-stubs-gen"],
errorprone: {
javacflags: [
"-Xep:MissingOverride:OFF",
],
},
sdk_version: "none",
system_modules: "art-module-public-api-stubs-system-modules",
}
// 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.
droidstubs {
name: "i18n-module-intra-core-api-stubs-source",
visibility: [
// Needed to build core-all as using the compiled library, i.e.
// i18n.module.intra.core.api.stubs does not work due to limitations
// in javac.
"//libcore:__subpackages__",
],
srcs: [
":android_icu4j_repackaged_src_files",
":libcore_icu_bridge_src_files",
],
sdk_version: "none",
system_modules: "art-module-intra-core-api-stubs-system-modules",
installable: false,
args: "--hide-annotation libcore.api.Hide " +
"--show-single-annotation libcore.api.IntraCoreApi " +
"--skip-annotation-instance-methods=false ",
api_filename: "api.txt",
removed_api_filename: "removed.txt",
previous_api: "previous.txt",
check_api: {
current: {
api_file: "api/intra/current-api.txt",
removed_api_file: "api/intra/current-removed.txt",
},
last_released: {
api_file: "api/intra/last-api.txt",
removed_api_file: "api/intra/last-removed.txt",
},
},
}
// A library containing the intra-core API stubs of the I18N module.
//
// Intra-core APIs are only intended for the use of other core library modules.
java_library {
name: "i18n.module.intra.core.api.stubs",
visibility: [
"//libcore:__subpackages__",
],
srcs: [
":i18n-module-intra-core-api-stubs-source",
],
sdk_version: "none",
system_modules: "art-module-intra-core-api-stubs-system-modules",
}
// 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.
droidstubs {
name: "i18n-module-platform-api-stubs-source",
srcs: [
":android_icu4j_repackaged_src_files",
":libcore_icu_bridge_src_files",
],
sdk_version: "none",
system_modules: "art-module-platform-api-stubs-system-modules",
installable: false,
args: "--hide-annotation libcore.api.Hide " +
"--show-single-annotation libcore.api.CorePlatformApi " +
"--skip-annotation-instance-methods=false ",
api_filename: "api.txt",
removed_api_filename: "removed.txt",
previous_api: "previous.txt",
check_api: {
current: {
api_file: "api/platform/current-api.txt",
removed_api_file: "api/platform/current-removed.txt",
},
last_released: {
api_file: "api/platform/last-api.txt",
removed_api_file: "api/platform/last-removed.txt",
},
},
}
// A library containing the core platform API stubs of the I18N module.
//
// Core platform APIs are only intended for use of other parts of the platform, not the
// core library modules.
java_library {
name: "i18n.module.platform.api.stubs",
visibility: [
"//libcore:__subpackages__",
],
srcs: [
":i18n-module-platform-api-stubs-source",
],
hostdex: true,
sdk_version: "none",
system_modules: "art-module-platform-api-stubs-system-modules",
}
//==========================================================
// 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",
],
patch_module: "java.base",
sdk_version: "none",
system_modules: "art-module-intra-core-api-stubs-system-modules",
}