1// Copyright (C) 2020 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. 14package { 15 default_applicable_licenses: ["Android-Apache-2.0"], 16} 17 18apex_key { 19 name: "com.android.apex.test.bar.key", 20 public_key: "com.android.apex.test.bar.avbpubkey", 21 private_key: "com.android.apex.test.bar.pem", 22} 23 24android_app_certificate { 25 name: "com.android.apex.test.bar.certificate", 26 certificate: "com.android.apex.test.bar", 27} 28 29apex { 30 name: "com.android.apex.test.bar", 31 manifest: "manifest.json", 32 file_contexts: ":apex.test-file_contexts", 33 key: "com.android.apex.test.bar.key", 34 installable: false, 35 binaries: ["bar_test"], 36 dist: { 37 targets: ["sharedlibs_test"], 38 }, 39 updatable: false, 40 compile_multilib: "both", 41 multilib: { 42 both: { 43 binaries: [ 44 "bar_test", 45 ], 46 }, 47 }, 48 // This test apex is used by shared_libs_repack, which works with only ext4. 49 payload_fs_type: "ext4", 50} 51 52cc_binary { 53 name: "bar_test", 54 srcs: ["bar_test.cc"], 55 shared_libs: [ 56 "libsharedlibtest", 57 ], 58 multilib: { 59 lib32: { 60 suffix: "32", 61 }, 62 lib64: { 63 suffix: "64", 64 }, 65 }, 66 67 compile_multilib: "both", 68 69 apex_available: ["com.android.apex.test.bar"], 70} 71 72java_genrule { 73 name: "com.android.apex.test.bar_stripped", 74 out: ["com.android.apex.test.bar_stripped.apex"], 75 defaults: ["apexer_test_host_tools_list"], 76 dist: { 77 targets: ["sharedlibs_test"], 78 }, 79 srcs: [ 80 ":com.android.apex.test.bar", 81 "com.android.apex.test.bar.avbpubkey", 82 "com.android.apex.test.bar.pem", 83 "com.android.apex.test.bar.pk8", 84 "com.android.apex.test.bar.x509.pem", 85 ], 86 tools: [ 87 "shared_libs_repack", 88 ], 89 cmd: "$(location shared_libs_repack) " + 90 " --mode strip" + 91 " --key $(location com.android.apex.test.bar.pem)" + 92 " --input $(location :com.android.apex.test.bar)" + 93 " --output $(genDir)/com.android.apex.test.bar_stripped.apex" + 94 " --pk8key $(location com.android.apex.test.bar.pk8)" + 95 " --pubkey $(location com.android.apex.test.bar.avbpubkey)" + 96 " --x509key $(location com.android.apex.test.bar.x509.pem)" + 97 " --tmpdir $(genDir)", 98} 99