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}
55
56cc_library_headers {
57    name: "libarttools_binder_utils",
58    defaults: ["art_defaults"],
59    host_supported: true,
60    export_include_dirs: ["include_binder_utils"],
61    shared_libs: [
62        "libbinder_ndk",
63    ],
64    apex_available: [
65        "com.android.art",
66        "com.android.art.debug",
67    ],
68}
69
70art_cc_defaults {
71    name: "art_libarttools_tests_defaults",
72    srcs: [
73        "art_exec_test.cc",
74        "cmdline_builder_test.cc",
75        "system_properties_test.cc",
76        "tools_test.cc",
77    ],
78    shared_libs: [
79        "liblog", // libbase dependency
80    ],
81    static_libs: [
82        "libgmock",
83    ],
84    target: {
85        android: {
86            static_libs: ["libmodules-utils-build"],
87        },
88    },
89}
90
91// Version of ART gtest `art_libarttools_tests` bundled with the ART APEX on target.
92// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
93art_cc_test {
94    name: "art_libarttools_tests",
95    defaults: [
96        "art_gtest_defaults",
97        "art_libarttools_tests_defaults",
98    ],
99    shared_libs: [
100        "libarttools",
101        "libbase",
102    ],
103}
104
105// Standalone version of ART gtest `art_libarttools_tests`, not bundled with the ART APEX on
106// target.
107art_cc_test {
108    name: "art_standalone_libarttools_tests",
109    defaults: [
110        "art_standalone_gtest_defaults",
111        "art_libarttools_tests_defaults",
112    ],
113    srcs: [
114        "binder_utils_test.cc",
115    ],
116    header_libs: [
117        "libarttools_binder_utils",
118    ],
119    shared_libs: [
120        "libbinder_ndk",
121    ],
122    static_libs: [
123        "libarttools",
124        "libbase",
125        "libfstab",
126    ],
127}
128
129cc_binary {
130    name: "art_exec",
131    defaults: [
132        "art_defaults",
133    ],
134    srcs: [
135        "art_exec.cc",
136    ],
137    shared_libs: [
138        "libartbase",
139        "libartpalette",
140        "libarttools", // Contains "libc++fs".
141        "libbase",
142    ],
143    static_libs: [
144        "libcap",
145    ],
146    apex_available: [
147        "com.android.art",
148        "com.android.art.debug",
149    ],
150}
151