1// Copyright (C) 2019 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: ["Android-Apache-2.0"], 17} 18 19apex_test { 20 name: "test_com.android.sdkext", 21 defaults: ["com.android.sdkext-defaults"], 22 bootclasspath_fragments: ["test_com.android.sdkext-bootclasspath-fragment"], 23 manifest: "test_manifest.json", 24 prebuilts: [ 25 "sdkinfo_45", 26 "test_extensions_db", 27 ], 28 file_contexts: ":com.android.sdkext-file_contexts", 29 installable: false, // Should never be installed on the systemimage 30 multilib: { 31 prefer32: { 32 binaries: [ 33 "derive_classpath_prefer32", 34 "derive_sdk_prefer32", 35 ], 36 }, 37 }, 38 // The automated test infra ends up building this apex for 64+32-bit and 39 // then installs it on a 32-bit-only device. Work around this weirdness 40 // by preferring 32-bit. 41 compile_multilib: "prefer32", 42} 43 44// Encapsulate the contributions made by the test_com.android.sdkext to the 45// bootclasspath. 46bootclasspath_fragment { 47 name: "test_com.android.sdkext-bootclasspath-fragment", 48 contents: [ 49 "framework-sdkextensions", 50 "test_framework-sdkextensions", 51 ], 52 apex_available: ["test_com.android.sdkext"], 53 54 // The bootclasspath_fragments that provide APIs on which this depends. 55 fragments: [ 56 { 57 apex: "com.android.art", 58 module: "art-bootclasspath-fragment", 59 }, 60 ], 61} 62 63genrule { 64 name: "sdkinfo_45_src", 65 out: ["sdkinfo.pb"], 66 tools: ["gen_sdkinfo"], 67 cmd: "$(location) -v 45 -o $(out)", 68} 69 70prebuilt_etc { 71 name: "sdkinfo_45", 72 src: ":sdkinfo_45_src", 73 filename: "sdkinfo.pb", 74 installable: false, 75 visibility: [ 76 ":__pkg__", 77 "//frameworks/av/apex/testing", 78 ], 79} 80 81genrule { 82 name: "test_extensions_db.pb", 83 srcs: ["test_extensions_db.textpb"], 84 out: ["test_extensions_db.pb"], 85 tools: ["gen_sdk"], 86 cmd: "$(location gen_sdk) --action print_binary --database $(location test_extensions_db.textpb) > $(out)", 87 visibility: ["//visibility:private"], 88} 89 90prebuilt_etc { 91 name: "test_extensions_db", 92 src: ":test_extensions_db.pb", 93 filename: "extensions_db.pb", 94 installable: false, 95 visibility: ["//visibility:private"], 96} 97