• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// Copyright (C) 2019 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// i18n APEX is intended as a home for ICU as of July 2019.
17// Various parts and dependencies of ICU would be gradually moved into this APEX,
18// and the below build rules should reflect the latest status.
19// TODO(b/138434658): Move the apex declaration back to external/icu
20// The apex is declared in libcore/ to workaround new dependency from external/icu
21// to system/sepolicy in a downstream branch.
22package {
23    default_applicable_licenses: ["Android-Apache-2.0"],
24}
25
26apex {
27    name: "com.android.i18n",
28    defaults: ["com.android.i18n-defaults"],
29    certificate: ":com.android.i18n.certificate",
30}
31
32apex_defaults {
33    name: "com.android.i18n-defaults",
34    compile_multilib: "both",
35    manifest: "manifest.json",
36    prebuilts: ["apex_icu.dat"],
37    key: "com.android.i18n.key",
38    native_shared_libs: [
39        "libandroidicu",
40        "libicu",
41        "libicui18n",
42        "libicuuc",
43        // libicu_jni is not in jni_libs, but native_shared_libs because it's required to bootstrap
44        // the Java method System.loadLibrary.
45        "libicu_jni",
46    ],
47    bootclasspath_fragments: [
48        "i18n-bootclasspath-fragment",
49    ],
50    updatable: false,
51    // Need hash tree so that CompOS can use dm-verity to verify the image in the Protected VM.
52    generate_hashtree: true,
53}
54
55apex_key {
56    name: "com.android.i18n.key",
57    public_key: "com.android.i18n.avbpubkey",
58    private_key: "com.android.i18n.pem",
59}
60
61android_app_certificate {
62    name: "com.android.i18n.certificate",
63    certificate: "com.android.i18n",
64}
65
66// The com.android.i18n's contribution to the bootclasspath.
67bootclasspath_fragment {
68    name: "i18n-bootclasspath-fragment",
69    // b/191127295: keep i18n in platform's classpath config and boot image.
70    generate_classpaths_proto: false,
71    contents: [
72        "core-icu4j",
73    ],
74    apex_available: [
75        "com.android.i18n",
76    ],
77    // The bootclasspath_fragments that provide APIs on which this depends.
78    fragments: [
79        {
80            apex: "com.android.art",
81            module: "art-bootclasspath-fragment",
82        },
83    ],
84    api: {
85        stub_libs: [
86            "i18n.module.public.api",
87        ],
88    },
89    core_platform_api: {
90        stub_libs: [
91            "legacy.i18n.module.platform.api",
92        ],
93    },
94    hidden_api: {
95        max_target_o_low_priority: [
96            "hiddenapi/hiddenapi-max-target-o-low-priority.txt",
97        ],
98
99        // This module does not contain any split packages.
100        split_packages: [],
101
102        // The following packages and all their subpackages currently only
103        // contain classes from this bootclasspath_fragment. Listing a package
104        // here won't prevent other bootclasspath modules from adding classes in
105        // any of those packages but it will prevent them from adding those
106        // classes into an API surface, e.g. public, system, etc.. Doing so will
107        // result in a build failure due to inconsistent flags.
108        package_prefixes: [
109            "android.icu",
110            "com.android.i18n.system",
111            "com.android.i18n.timezone",
112            "com.android.i18n.util",
113            "com.android.icu",
114        ],
115    },
116}
117
118// SDK exposed by the ICU module.
119sdk {
120    name: "i18n-module-sdk",
121    host_supported: true,
122    target: {
123        android: {
124            apexes: [
125                // Adds exportable dependencies of the APEX to the sdk,
126                // e.g. *classpath_fragments.
127                "com.android.i18n",
128            ],
129            java_sdk_libs: [
130                "i18n.module.intra.core.api",
131                "stable.i18n.module.platform.api",
132            ],
133        },
134    },
135    native_shared_libs: [
136        "libandroidicu",
137	"libicu",
138    ],
139}
140
141module_exports {
142    name: "i18n-module-host-exports",
143    host_supported: true,
144    device_supported: false,
145    java_libs: [
146        "timezone-host",
147    ],
148}
149
150// Additional prebuilts for running ART tests on host and device.
151module_exports {
152    name: "i18n-module-test-exports",
153    host_supported: true,
154    target: {
155        android: {
156            java_libs: [
157                // For use by robolectric and ART tests.
158                "core-icu4j-for-host",
159            ],
160        },
161    },
162    native_shared_libs: [
163        "libicui18n",
164        "libicuuc",
165        "libicu_jni",
166    ],
167}
168