You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

225 lines
7.3 KiB

//
// Copyright (C) 2014 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"],
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "external_icu_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
// SPDX-license-identifier-BSD
// SPDX-license-identifier-ICU
// SPDX-license-identifier-MIT
// SPDX-license-identifier-Unicode-DFS
// legacy_unencumbered
default_applicable_licenses: ["external_icu_license"],
}
java_defaults {
name: "icu4j-defaults",
host_supported: true,
hostdex: true,
// Use the same Java language version in the Android build configuration as used
// in main/shared/build/common.properties for the ICU4J build configuration.
java_version: "1.7",
}
java_library {
name: "icu4j",
visibility: [
"//bootable/recovery/tools/image_generator",
"//external/icu/tools/srcgen",
"//external/jimfs/jimfs",
"//external/robolectric-shadows/robolectric",
"//external/robolectric-shadows/shadows/framework",
"//system/timezone/input_tools/android/telephonylookup_generator",
"//system/timezone/input_tools/android/tzlookup_generator",
],
defaults: ["icu4j-defaults"],
srcs: ["main/classes/**/*.java"],
java_resource_dirs: ["main/classes/*/src"],
// User-supplied locale service providers (using the java.text.spi or
// java.util.spi mechanisms) are not supported in Android:
//
// http://developer.android.com/reference/java/util/Locale.html
exclude_srcs: ["main/classes/localespi/**/*.java"],
exclude_java_resource_dirs: ["main/classes/localespi/src"],
static_libs: [
"icu4j-icudata",
"icu4j-icutzdata",
],
}
// Small static library used by TwilightService in the system server. To avoid @CorePlaformApi,
// the system server doesn't use CalendarAstronomer in android.icu.
// Don't link this in boot classpath or Zygote to avoid class collision with the
// com.ibm.icu.impl.CalendarAstronomer in the app classloader.
java_library_static {
name: "icu4j_calendar_astronomer",
host_supported: false,
srcs: ["main/classes/core/src/com/ibm/icu/impl/CalendarAstronomer.java"],
visibility: ["//frameworks/base/services/core"],
}
java_test {
name: "icu4j-tests",
defaults: ["icu4j-defaults"],
srcs: [
"main/tests/**/*.java",
"tools/misc/src/com/ibm/icu/dev/tool/locale/*.java",
],
java_resource_dirs: ["main/tests/*/src"],
exclude_srcs: ["main/tests/localespi/**/*.java"],
exclude_java_resource_dirs: ["main/tests/localespi/src"],
static_libs: [
"icu4j",
"icu4j-testdata",
"junit-params",
],
}
java_import {
name: "icu4j-icudata",
host_supported: true,
jars: ["main/shared/data/icudata.jar"],
}
java_import {
name: "icu4j-icutzdata",
host_supported: true,
jars: ["main/shared/data/icutzdata.jar"],
}
java_import {
name: "icu4j-testdata",
host_supported: true,
jars: ["main/shared/data/testdata.jar"],
}
// LayoutLib (frameworks/layoutlib) and robolectric need JarJar'd versions of
// the icudata and icutzdata, so add rules for it.
java_library {
name: "icu4j-icudata-jarjar",
visibility: [
"//external/robolectric-shadows",
"//frameworks/layoutlib",
],
defaults: ["icu4j-defaults"],
static_libs: ["icu4j-icudata"],
jarjar_rules: "liblayout-jarjar-rules.txt",
}
java_library {
name: "icu4j-icutzdata-jarjar",
visibility: [
"//external/robolectric-shadows",
"//frameworks/layoutlib",
],
defaults: ["icu4j-defaults"],
static_libs: ["icu4j-icutzdata"],
jarjar_rules: "liblayout-jarjar-rules.txt",
}
// Compatibility alias until references to icu4j-host are removed
//
// When converting .mk files to .bp files do not change the visibility of this
// module, instead replace usages of this with icu4j
java_library_host {
name: "icu4j-host",
static_libs: ["icu4j"],
}
// Rules to generate android_icu4j files during build time
// The following rules are used in the downstream branches master-icu-dev only,
// but NOT used in AOSP.
generate_script_srcs = [
"main/**/*",
"samples/**/*",
]
generate_script_tools = [
"android_icu4j_srcgen_binary",
"soong_zip",
]
generate_script_tool_files = [
":generate_android_icu4j_script",
]
// ANDROID_BUILD_TOP is needed to be set for generate_android_icu4j.sh
generate_script_common_cmd = "export ANDROID_BUILD_TOP=$$(pwd) && " +
"$(location :generate_android_icu4j_script) " +
"--no-doc-patch " +
"--gen $(genDir) " +
"--srcgen-tool $(location android_icu4j_srcgen_binary)"
genrule {
name: "generated_android_icu4j_src_files",
enabled: false, // http://b/117312606
srcs: generate_script_srcs,
tools: generate_script_tools,
tool_files: generate_script_tool_files,
out: ["generated_android_icu4j.srcjar"],
cmd: generate_script_common_cmd +
"&& $(location soong_zip) -o $(out) -C $(genDir)/android_icu4j/src/main/java " +
"-D $(genDir)/android_icu4j/src/main/java",
}
java_genrule {
name: "generated_android_icu4j_resources",
enabled: false, // http://b/117312606
host_supported: true,
srcs: generate_script_srcs,
tools: generate_script_tools,
tool_files: generate_script_tool_files,
out: ["generated_android_icu4j_resources.jar"],
cmd: generate_script_common_cmd +
"&& $(location soong_zip) -o $(out) -C $(genDir)/android_icu4j/resources " +
"-D $(genDir)/android_icu4j/resources",
}
genrule {
name: "generated_android_icu4j_test_files",
enabled: false, // http://b/117312606
srcs: generate_script_srcs,
tools: generate_script_tools,
tool_files: generate_script_tool_files,
out: ["generated_android_icu4j_test.srcjar"],
cmd: generate_script_common_cmd +
"&& find $(genDir)/android_icu4j/src/main/tests -type f -not -name \"*.java\" -exec rm {} \\; " +
"&& $(location soong_zip) -o $(out) -C $(genDir)/android_icu4j/src/main/tests " +
"-D $(genDir)/android_icu4j/src/main/tests",
}
java_genrule {
name: "generated_android_icu4j_test_resources",
enabled: false, // http://b/117312606
host_supported: true,
srcs: generate_script_srcs,
tools: generate_script_tools,
tool_files: generate_script_tool_files,
out: ["generated_android_icu4j_test_resources.jar"],
cmd: generate_script_common_cmd +
"&& find $(genDir)/android_icu4j/src/main/tests -type f -name \"*.java\" -exec rm {} \\; " +
"&& $(location soong_zip) -o $(out) -C $(genDir)/android_icu4j/src/main/tests " +
"-D $(genDir)/android_icu4j/src/main/tests",
}