// Copyright (C) 2017 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_team: "trendy_team_updatable_sdk_apis", // See: http://go/android-license-faq default_applicable_licenses: ["Android-Apache-2.0"], } android_test { name: "CtsSystemApiSignatureTestCases", defaults: ["signature-api-check-defaults"], java_resources: [ ":CtsSystemApiSignatureTestCases_system-all.api", ":cts-current-api-gz", ":cts-system-current-api-gz", ":cts-system-removed-api-gz", ], test_suites: [ "cts", "general-tests", ], sdk_version: "current", dex_preopt: { enabled: false, }, optimize: { enabled: false, }, use_embedded_native_libs: false, } genrule { name: "CtsSystemApiSignatureTestCases_system-all.api", srcs: [ ":prebuilt_sdk_system_api_android_txt", ], tools: [ "soong_zip", "metalava", ], out: [ "system-all.api.zip", ], cmd: "for f in $(in); do " + " platformSdkVersion=$$(echo $${f} | awk -F/ '{print $$(3)}') && " + " if [ $${platformSdkVersion} -lt 28 ]; then continue; fi && " + " apiLevel=$$(echo $${f} | awk -F/ '{print $$(4)}') && " + " $(location metalava) -J--add-opens=java.base/java.util=ALL-UNNAMED " + " signature-to-jdiff $${f} $(genDir)/list/$${platformSdkVersion}-$${apiLevel}.api; " + "done &&" + "$(location soong_zip) -o $(out) -C $(genDir)/list -D $(genDir)/list", }