1// Copyright (C) 2017 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 // See: http://go/android-license-faq 17 default_applicable_licenses: ["Android-Apache-2.0"], 18} 19 20android_test { 21 name: "CtsSystemApiSignatureTestCases", 22 defaults: ["signature-api-check-defaults"], 23 java_resources: [ 24 ":CtsSystemApiSignatureTestCases_system-all.api", 25 ":cts-current-api-gz", 26 ":cts-system-current-api-gz", 27 ":cts-system-removed-api-gz", 28 ], 29 test_suites: [ 30 "cts", 31 "general-tests", 32 ], 33 sdk_version: "current", 34 dex_preopt: { 35 enabled: false, 36 }, 37 optimize: { 38 enabled: false, 39 }, 40 use_embedded_native_libs: false, 41} 42 43genrule { 44 name: "CtsSystemApiSignatureTestCases_system-all.api", 45 srcs: [ 46 ":prebuilt_sdk_system_api_android_txt", 47 ], 48 tools: [ 49 "soong_zip", 50 "metalava", 51 ], 52 out: [ 53 "system-all.api.zip", 54 ], 55 cmd: "for f in $(in); do " + 56 " platformSdkVersion=$$(echo $${f} | awk -F/ '{print $$(3)}') && " + 57 " if [ $${platformSdkVersion} -lt 28 ]; then continue; fi && " + 58 " apiLevel=$$(echo $${f} | awk -F/ '{print $$(4)}') && " + 59 " $(location metalava) -J--add-opens=java.base/java.util=ALL-UNNAMED --no-banner " + 60 " -convert2xmlnostrip $${f} $(genDir)/list/$${platformSdkVersion}-$${apiLevel}.api; " + 61 "done &&" + 62 "$(location soong_zip) -o $(out) -C $(genDir)/list -D $(genDir)/list", 63} 64