summaryrefslogtreecommitdiff
path: root/mmodules/core_platform_api/Android.bp
blob: f2a042b4cf282c4899a8aafb83c22c4defdf9c8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// Copyright (C) 2018 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.

// Generates stub source files for the core platform API of the ART 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: "art-module-platform-api-stubs-source",
    srcs: [
        ":art_module_api_files",
    ],
    sdk_version: "none",
    system_modules: "none",
    libs: [
        // Needed to break the cycle in the platform api caused by
        // b/141747409.
        "i18n.module.intra.core.api.stubs",
    ],

    installable: false,
    args: "--hide HiddenSuperclass " +
        "--hide-annotation libcore.api.Hide " +
        "--show-single-annotation libcore.api.CorePlatformApi " +
        "--skip-annotation-instance-methods=false ",
    merge_inclusion_annotations_dirs: ["ojluni-annotated-mmodule-stubs"],

    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 special set of system modules that is needed to break the cycle in the
// platform api caused by b/141747409.
java_system_modules {
    name: "break-cycle-in-core-platform-system-modules",
    libs: [
        "art.module.intra.core.api.stubs",
        "i18n.module.intra.core.api.stubs",
    ],
}

// A library containing the core platform API stubs of the ART module.
//
// Core platform APIs are only intended for use of other parts of the platform, not the
// core library modules.
java_library {
    name: "art.module.platform.api.stubs",
    srcs: [
        ":art-module-platform-api-stubs-source",
    ],
    hostdex: true,

    sdk_version: "none",
    system_modules: "break-cycle-in-core-platform-system-modules",
    patch_module: "java.base",
}

// Used when compiling higher-level code against core.platform.api.stubs.
java_system_modules {
    name: "art-module-platform-api-stubs-system-modules",
    visibility: [
        "//art/build/sdk",
        "//external/conscrypt",
        "//external/icu/android_icu4j",
        "//external/wycheproof",
    ],
    libs: [
        "art.module.platform.api.stubs",
    ],
}

// Ideally this should be a restricted whitelist but there are hundreds of modules that depend on
// this.
// TODO(http://b/134561230) - limit the number of dependents on this.
core_platform_visibility = ["//visibility:public"]

// A library containing the core platform API stubs for the core libraries.
//
// Although this stubs library is primarily used by the Java compiler / build to indicate
// the core platform API surface area, compile_dex: true is used so that the Core Platform
// API annotations are available to the dex tools that enable enforcement of runtime
// accessibility. b/119068555
java_library {
    name: "core.platform.api.stubs",
    visibility: core_platform_visibility,
    hostdex: true,
    compile_dex: true,

    sdk_version: "none",
    system_modules: "none",
    static_libs: [
        "art.module.platform.api.stubs",
        "conscrypt.module.platform.api.stubs",
        "i18n.module.platform.api.stubs",
    ],
    patch_module: "java.base",
}

// Used when compiling higher-level code against core.platform.api.stubs.
java_system_modules {
    name: "core-platform-api-stubs-system-modules",
    visibility: core_platform_visibility,
    libs: [
        "core.platform.api.stubs",
        // This one is not on device but it's needed when javac compiles code
        // containing lambdas.
        "core-lambda-stubs-for-system-modules",
        // This one is not on device but it's needed when javac compiles code
        // containing @Generated annotations produced by some code generation
        // tools.
        // See http://b/123891440.
        "core-generated-annotation-stubs",
    ],
}