1// 2// Copyright (C) 2021 The Android Open Source Project 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17package { 18 // See: http://go/android-license-faq 19 // A large-scale-change added 'default_applicable_licenses' to import 20 // all of the 'license_kinds' from "art_license" 21 // to get the below license kinds: 22 // SPDX-license-identifier-Apache-2.0 23 default_applicable_licenses: ["art_license"], 24 default_team: "trendy_team_art_mainline", 25} 26 27// This library contains low-level interfaces used to call dex2oat and related tools. This will 28// allow other libraries or programs besides the ART Service to make use of this functionality. 29cc_library { 30 name: "libarttools", 31 defaults: ["art_defaults"], 32 host_supported: true, 33 srcs: [ 34 "tools.cc", 35 ], 36 export_include_dirs: ["include"], 37 header_libs: ["art_libartbase_headers"], 38 shared_libs: [ 39 "libbase", 40 ], 41 export_shared_lib_headers: [ 42 "libbase", 43 ], 44 static_libs: [ 45 "libfstab", 46 ], 47 export_static_lib_headers: [ 48 "libfstab", 49 ], 50 apex_available: [ 51 "com.android.art", 52 "com.android.art.debug", 53 ], 54 target: { 55 android: { 56 compile_multilib: "first", 57 }, 58 }, 59} 60 61cc_library_headers { 62 name: "libarttools_binder_utils", 63 defaults: ["art_defaults"], 64 host_supported: true, 65 export_include_dirs: ["include_binder_utils"], 66 shared_libs: [ 67 "libbinder_ndk", 68 ], 69 apex_available: [ 70 "com.android.art", 71 "com.android.art.debug", 72 ], 73} 74 75cc_library_headers { 76 name: "libarttools_testing", 77 defaults: ["art_defaults"], 78 host_supported: true, 79 export_include_dirs: ["include_testing"], 80 apex_available: [ 81 "com.android.art", 82 "com.android.art.debug", 83 ], 84} 85 86art_cc_defaults { 87 name: "art_libarttools_tests_defaults", 88 srcs: [ 89 "art_exec_test.cc", 90 "cmdline_builder_test.cc", 91 "system_properties_test.cc", 92 "tools_test.cc", 93 ], 94 header_libs: [ 95 "libarttools_testing", 96 ], 97 shared_libs: [ 98 "liblog", // libbase dependency 99 ], 100 static_libs: [ 101 "libgmock", 102 ], 103 target: { 104 android: { 105 static_libs: ["libmodules-utils-build"], 106 compile_multilib: "first", 107 }, 108 }, 109} 110 111// Version of ART gtest `art_libarttools_tests` bundled for host. 112// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. 113art_cc_test { 114 name: "art_libarttools_tests", 115 device_supported: false, 116 defaults: [ 117 "art_gtest_defaults", 118 "art_libarttools_tests_defaults", 119 ], 120 shared_libs: [ 121 "libarttools", 122 "libbase", 123 ], 124} 125 126// Standalone version of ART gtest `art_libarttools_tests`, not bundled with the ART APEX on 127// target. 128art_cc_test { 129 name: "art_standalone_libarttools_tests", 130 defaults: [ 131 "art_standalone_gtest_defaults", 132 "art_libarttools_tests_defaults", 133 ], 134 srcs: [ 135 "binder_utils_test.cc", 136 ], 137 header_libs: [ 138 "libarttools_binder_utils", 139 ], 140 shared_libs: [ 141 "libbinder_ndk", 142 ], 143 static_libs: [ 144 "libarttools", 145 "libbase", 146 "libfstab", 147 ], 148 test_config_template: ":art-gtests-target-standalone-non-multilib-template", 149} 150 151cc_binary { 152 name: "art_exec", 153 defaults: [ 154 "art_defaults", 155 ], 156 srcs: [ 157 "art_exec.cc", 158 ], 159 shared_libs: [ 160 "libartbase", 161 "libartpalette", 162 "libarttools", 163 "libbase", 164 ], 165 static_libs: [ 166 "libcap", 167 ], 168 apex_available: [ 169 "com.android.art", 170 "com.android.art.debug", 171 ], 172} 173