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