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.pony.key", 20 public_key: "com.android.apex.test.pony.avbpubkey", 21 private_key: "com.android.apex.test.pony.pem", 22} 23 24android_app_certificate { 25 name: "com.android.apex.test.pony.certificate", 26 certificate: "com.android.apex.test.pony", 27} 28 29apex { 30 name: "com.android.apex.test.pony", 31 manifest: "manifest.json", 32 file_contexts: ":apex.test-file_contexts", 33 key: "com.android.apex.test.pony.key", 34 installable: false, 35 binaries: ["pony_test"], 36 dist: { 37 targets: ["sharedlibs_test"], 38 }, 39 updatable: false, 40 // This test apex is used by shared_libs_repack, which works with only ext4. 41 payload_fs_type: "ext4", 42} 43 44cc_binary { 45 name: "pony_test", 46 srcs: ["pony_test.cc"], 47 shared_libs: [ 48 "libsharedlibtest", 49 ], 50 apex_available: ["com.android.apex.test.pony"], 51} 52 53java_genrule { 54 name: "com.android.apex.test.pony_stripped", 55 out: ["com.android.apex.test.pony_stripped.apex"], 56 defaults: ["apexer_test_host_tools_list"], 57 dist: { 58 targets: ["sharedlibs_test"], 59 }, 60 srcs: [ 61 ":com.android.apex.test.pony", 62 "com.android.apex.test.pony.avbpubkey", 63 "com.android.apex.test.pony.pem", 64 "com.android.apex.test.pony.pk8", 65 "com.android.apex.test.pony.x509.pem", 66 ], 67 tools: [ 68 "shared_libs_repack", 69 ], 70 cmd: "$(location shared_libs_repack) " + 71 " --mode strip" + 72 " --key $(location com.android.apex.test.pony.pem)" + 73 " --input $(location :com.android.apex.test.pony)" + 74 " --output $(genDir)/com.android.apex.test.pony_stripped.apex" + 75 " --pk8key $(location com.android.apex.test.pony.pk8)" + 76 " --pubkey $(location com.android.apex.test.pony.avbpubkey)" + 77 " --x509key $(location com.android.apex.test.pony.x509.pem)" + 78 " --tmpdir $(genDir)", 79} 80