blob: c7fe647a682f54718d823631b5287312d37dadc2 [file] [log] [blame]
Orion Hodson4c3ade62021-02-10 14:07:10 +00001//
2// Copyright (C) 2020 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
Bob Badour9150de62021-02-26 03:22:24 -080017package {
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}
25
Orion Hodson4c3ade62021-02-10 14:07:10 +000026cc_defaults {
27 name: "odrefresh-defaults",
28 host_supported: true,
29 defaults: ["art_defaults"],
30 srcs: [
31 "odrefresh.cc",
Orion Hodsonf761f582021-06-09 10:50:57 +010032 "odr_compilation_log.cc",
Orion Hodsonf96c9162021-04-07 10:43:01 +010033 "odr_fs_utils.cc",
Orion Hodson957fb152021-04-08 07:52:15 +010034 "odr_metrics.cc",
35 "odr_metrics_record.cc",
Orion Hodson4c3ade62021-02-10 14:07:10 +000036 ],
37 local_include_dirs: ["include"],
38 header_libs: ["dexoptanalyzer_headers"],
Orion Hodson947a8502021-03-08 15:40:09 +000039 generated_sources: [
Sorin Basca1e7faf72021-05-27 13:05:22 +000040 "apex-info-list-tinyxml",
Orion Hodson947a8502021-03-08 15:40:09 +000041 "art-apex-cache-info",
Orion Hodson957fb152021-04-08 07:52:15 +010042 "art-odrefresh-operator-srcs",
Orion Hodson947a8502021-03-08 15:40:09 +000043 ],
Orion Hodson4c3ade62021-02-10 14:07:10 +000044 shared_libs: [
45 "libartpalette",
46 "libbase",
Orion Hodson947a8502021-03-08 15:40:09 +000047 "libdexfile",
Orion Hodson4c3ade62021-02-10 14:07:10 +000048 "liblog",
49 ],
Sorin Basca1e7faf72021-05-27 13:05:22 +000050 static_libs: ["libtinyxml2"],
Orion Hodson4c3ade62021-02-10 14:07:10 +000051 target: {
52 android: {
53 // Use the 32-bit version of odrefresh on devices.
54 compile_multilib: "prefer32",
55 },
Orion Hodson4c3ade62021-02-10 14:07:10 +000056 },
57 tidy: true,
58 tidy_flags: [
Chih-Hung Hsiehe4b7d432021-02-25 20:51:43 -080059 "-format-style=file",
60 "-header-filter=(art/odrefresh/|system/apex/)",
Orion Hodson4c3ade62021-02-10 14:07:10 +000061 ],
62}
63
64cc_library_headers {
65 name: "odrefresh_headers",
66 export_include_dirs: ["include"],
67 host_supported: true,
68 stl: "none",
69 system_shared_libs: [],
70 min_sdk_version: "29", // As part of mainline modules(APEX), it should support at least 29(Q).
71 sdk_version: "minimum", // The minimum sdk version required by users of this module.
72 apex_available: [
73 "//apex_available:platform", // For odsign.
74 ],
75 visibility: ["//visibility:public"],
76}
77
Orion Hodson957fb152021-04-08 07:52:15 +010078gensrcs {
79 name: "art-odrefresh-operator-srcs",
80 cmd: "$(location generate_operator_out) art/odrefresh $(in) > $(out)",
81 tools: ["generate_operator_out"],
82 srcs: [
83 "odr_metrics.h",
84 ],
85 output_extension: "operator_out.cc",
86}
87
Orion Hodson4c3ade62021-02-10 14:07:10 +000088art_cc_binary {
89 name: "odrefresh",
90 defaults: ["odrefresh-defaults"],
91 required: [
92 "dexoptanalyzer",
93 "dex2oat",
94 ],
95 shared_libs: [
96 "libart",
97 "libartbase",
98 ],
99 apex_available: [
100 "com.android.art",
101 "com.android.art.debug",
102 ],
103}
104
105art_cc_binary {
106 name: "odrefreshd",
107 defaults: [
108 "art_debug_defaults",
109 "odrefresh-defaults",
110 ],
111 required: [
112 "dexoptanalyzerd",
113 "dex2oatd",
114 ],
115 shared_libs: [
116 "libartd",
117 "libartbased",
118 ],
119 apex_available: [
120 "com.android.art.debug",
Martin Stjernholmd3e9ff32021-03-16 00:44:25 +0000121 // TODO(b/183882457): This binary doesn't go into com.android.art, but
122 // apex_available lists need to be the same for internal libs to avoid
123 // stubs, and this depends on libartd.
124 "com.android.art",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000125 ],
126}
127
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100128cc_library_static {
129 name: "libodrstatslog",
130 defaults: ["art_defaults"],
131 host_supported: true,
132 export_include_dirs: ["include"],
133
134 local_include_dirs: ["include"],
135 shared_libs: ["libartbase"],
136 target: {
137 android: {
138 generated_headers: ["statslog_odrefresh.h"],
139 generated_sources: ["statslog_odrefresh.cpp"],
140 srcs: [
141 "odr_metrics_record.cc",
142 "odr_statslog_android.cc",
143 ],
144 shared_libs: ["libstatssocket"],
145 },
146 host: {
147 srcs: ["odr_statslog_host.cc"],
148 },
149 },
150 apex_available: [
151 "com.android.art",
152 "com.android.art.debug",
153 ],
154}
155
Roland Levillainf0409142021-03-22 15:45:03 +0000156art_cc_defaults {
157 name: "art_odrefresh_tests_defaults",
Orion Hodson957fb152021-04-08 07:52:15 +0100158 generated_sources: ["art-odrefresh-operator-srcs"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000159 header_libs: ["odrefresh_headers"],
160 srcs: [
161 "odr_artifacts_test.cc",
Orion Hodsonf761f582021-06-09 10:50:57 +0100162 "odr_compilation_log.cc",
163 "odr_compilation_log_test.cc",
Orion Hodsonf96c9162021-04-07 10:43:01 +0100164 "odr_fs_utils.cc",
165 "odr_fs_utils_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100166 "odr_metrics.cc",
167 "odr_metrics_test.cc",
168 "odr_metrics_record.cc",
169 "odr_metrics_record_test.cc",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000170 "odrefresh_test.cc",
171 ],
Orion Hodson957fb152021-04-08 07:52:15 +0100172 shared_libs: ["libbase"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000173}
Orion Hodson947a8502021-03-08 15:40:09 +0000174
Roland Levillainf0409142021-03-22 15:45:03 +0000175// Version of ART gtest `art_odrefresh_tests` bundled with the ART APEX on target.
176// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
177art_cc_test {
178 name: "art_odrefresh_tests",
179 defaults: [
180 "art_gtest_defaults",
181 "art_odrefresh_tests_defaults",
182 ],
183}
184
185// Standalone version of ART gtest `art_odrefresh_tests`, not bundled with the ART APEX on target.
186art_cc_test {
187 name: "art_standalone_odrefresh_tests",
188 defaults: [
189 "art_standalone_gtest_defaults",
190 "art_odrefresh_tests_defaults",
191 ],
192}
193
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100194genrule {
195 name: "statslog_odrefresh.h",
196 tools: ["stats-log-api-gen"],
197 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_odrefresh.h --module art --namespace art,metrics,statsd",
198 out: [
199 "statslog_odrefresh.h",
200 ],
201}
202
203genrule {
204 name: "statslog_odrefresh.cpp",
205 tools: ["stats-log-api-gen"],
206 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_odrefresh.cpp --module art --namespace art,metrics,statsd --importHeader statslog_odrefresh.h",
207 out: [
208 "statslog_odrefresh.cpp",
209 ],
210}
211
Orion Hodson947a8502021-03-08 15:40:09 +0000212xsd_config {
213 name: "art-apex-cache-info",
214 srcs: ["CacheInfo.xsd"],
215 package_name: "com.android.art",
216 api_dir: "schema",
217 gen_writer: true,
Sorin Basca1e7faf72021-05-27 13:05:22 +0000218 tinyxml: true,
Orion Hodson947a8502021-03-08 15:40:09 +0000219}