• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2022 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_applicable_licenses: ["libcore_ojluni_src_main_license"],
17}
18
19// Stub library containing the contributions of ART module to Toolchain
20// API Surface.
21// This is a droidstubs and not a java_sdk_library since "toolchain" does not
22// map to the existing ApiScopes supported by java_sdk_library (e.g. public,
23// system, ...).
24// These APIs exist to satisfy javac and are not present in a stable Android
25// API surface yet (public, system, ...). e.g. LambdaMetaFactory (LMF) is not
26// part of JVMS/JLS, and its contract with javac can change in a future Java
27// LTS version.
28// Since this is not a stable API surface, as a corollary these APIs
29// 1. Do not appear in android.jar (public, system, ...)
30// 2. Do not appear in developer.android.com
31// 3. The API definition or any usage should not appear in any .dex / .apk
32// files, except core-oj.jar in libcore, because the API usage should be
33// desugared by d8
34droidstubs {
35    name: "art.module.toolchain.api",
36    visibility: [
37        "//art/build/sdk",
38        "//build/soong/java/core-libraries",
39    ],
40    srcs: [
41        // These classes are necessary to compile source code containing Lambdas
42        ":openjdk_lambda_stub_files",
43    ],
44    check_api: {
45        current: {
46            api_file: "api/current.txt",
47            removed_api_file: "api/removed.txt",
48        },
49    },
50    // LambdaMetaFactory depends on CallSite etc. which are provided by
51    // the system module art-module-intra-core-api-stubs-bootstrap-system-modules
52    // via art.module.intra.core.api.stubs
53    sdk_version: "none",
54    system_modules: "art-module-intra-core-api-stubs-bootstrap-system-modules",
55
56    // Use -target 8 so that it works with old JDKs.
57    java_version: "1.8",
58
59    // The module does not specifically contribute to the public api surface,
60    // but the api_surface property must be one of the allApiScopes defined in
61    // sdk_library.go, and the property is used only to sort the api files.
62    api_surface: "public",
63}
64