blob: eb18522661904d10d73ae01ba873a6e289bea389 [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_src_files",
visibility: [
"//libcore:__subpackages__",
],
srcs: ["src/main/java/**/*.java"],
path: "src/main/java",
}
// 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: [
"//art/build/apex",
"//external/robolectric-shadows",
"//frameworks/layoutlib",
],
installable: true,
hostdex: true,
srcs: [":android_icu4j_src_files"],
// The resource files are generated in the downstream branch master-icu-dev.
java_resource_dirs: ["resources"],
// We use art-module-public-api-stubs-system-modules when compiling core-icu4j as ICU4J 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.
sdk_version: "none",
system_modules: "art-module-public-api-stubs-system-modules",
dxflags: ["--core-library"],
errorprone: {
javacflags: [
"-Xep:MissingOverride:OFF", // Ignore missing @Override.
"-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom
],
},
}
//
// Guaranteed unstripped versions of core-icu4j.
//
// The build system may or may not strip the core-icu4j. jar,
// but this will not be stripped. See b/24535627.
//
java_library {
name: "core-icu4j-testdex",
installable: true,
static_libs: ["core-icu4j"],
sdk_version: "none",
system_modules: "art-module-public-api-stubs-system-modules",
dxflags: ["--core-library"],
dex_preopt: {
enabled: false,
},
}
// 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_src_files",
],
java_version: "1.9",
installable: false,
sdk_version: "none",
libs: [
"art.module.public.api.stubs",
],
}
// 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_src_files",
],
sdk_version: "none",
libs: [
"art.module.intra.core.api.stubs",
],
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_src_files",
],
sdk_version: "none",
libs: [
"art.module.platform.api.stubs",
],
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",
}