blob: 8fee83a38aef65ae556b2b89daaa050d93533e6e [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",
Orion Hodson4c3ade62021-02-10 14:07:10 +000028 srcs: [
29 "odrefresh.cc",
Jiakai Zhang3ba3edf2021-08-11 08:25:40 +000030 "odr_common.cc",
Orion Hodsonf761f582021-06-09 10:50:57 +010031 "odr_compilation_log.cc",
Orion Hodsonf96c9162021-04-07 10:43:01 +010032 "odr_fs_utils.cc",
Orion Hodson957fb152021-04-08 07:52:15 +010033 "odr_metrics.cc",
34 "odr_metrics_record.cc",
Orion Hodson4c3ade62021-02-10 14:07:10 +000035 ],
36 local_include_dirs: ["include"],
37 header_libs: ["dexoptanalyzer_headers"],
Orion Hodson947a8502021-03-08 15:40:09 +000038 generated_sources: [
Sorin Basca1e7faf72021-05-27 13:05:22 +000039 "apex-info-list-tinyxml",
Orion Hodson947a8502021-03-08 15:40:09 +000040 "art-apex-cache-info",
Orion Hodson957fb152021-04-08 07:52:15 +010041 "art-odrefresh-operator-srcs",
Orion Hodson947a8502021-03-08 15:40:09 +000042 ],
Orion Hodson4c3ade62021-02-10 14:07:10 +000043 shared_libs: [
44 "libartpalette",
45 "libbase",
46 "liblog",
47 ],
Jiakai Zhang432d6eb2021-11-11 15:52:00 +000048 static_libs: [
49 "libc++fs",
50 "libtinyxml2",
51 ],
Ulyana Trafimovichb89649b2021-08-23 10:48:17 +000052 tidy: true,
Jiakai Zhang9b7ddf62021-11-01 11:36:52 +000053 tidy_disabled_srcs: [":art-apex-cache-info"],
Ulyana Trafimovichb89649b2021-08-23 10:48:17 +000054 tidy_flags: [
55 "-format-style=file",
56 "-header-filter=(art/odrefresh/|system/apex/)",
57 ],
Jiakai Zhangb91dad22021-08-16 03:20:07 +000058}
59
Jiakai Zhangccbcfb12021-08-23 15:10:35 +000060cc_defaults {
61 name: "odrefresh_binary_defaults",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +000062 defaults: [
63 "art_defaults",
64 "odrefresh-defaults",
65 ],
66 srcs: ["odrefresh_main.cc"],
67 shared_libs: [
68 "libdexfile",
69 ],
70 target: {
71 android: {
72 compile_multilib: "first",
73 },
74 },
75}
76
Orion Hodson4c3ade62021-02-10 14:07:10 +000077cc_library_headers {
78 name: "odrefresh_headers",
Martin Stjernholmf726d202021-10-28 03:52:25 +010079 defaults: ["art_defaults"],
Orion Hodson4c3ade62021-02-10 14:07:10 +000080 export_include_dirs: ["include"],
81 host_supported: true,
82 stl: "none",
83 system_shared_libs: [],
Orion Hodson4c3ade62021-02-10 14:07:10 +000084 sdk_version: "minimum", // The minimum sdk version required by users of this module.
85 apex_available: [
86 "//apex_available:platform", // For odsign.
87 ],
88 visibility: ["//visibility:public"],
89}
90
Orion Hodson957fb152021-04-08 07:52:15 +010091gensrcs {
92 name: "art-odrefresh-operator-srcs",
93 cmd: "$(location generate_operator_out) art/odrefresh $(in) > $(out)",
94 tools: ["generate_operator_out"],
95 srcs: [
96 "odr_metrics.h",
97 ],
98 output_extension: "operator_out.cc",
99}
100
Orion Hodson4c3ade62021-02-10 14:07:10 +0000101art_cc_binary {
102 name: "odrefresh",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000103 defaults: ["odrefresh_binary_defaults"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000104 required: [
105 "dexoptanalyzer",
106 "dex2oat",
107 ],
108 shared_libs: [
109 "libart",
110 "libartbase",
111 ],
112 apex_available: [
113 "com.android.art",
114 "com.android.art.debug",
115 ],
116}
117
Nicolas Geoffray4b762132021-11-30 15:18:25 +0000118// A no-op version of the odrefresh binary.
119art_cc_binary {
120 name: "odrefresh_broken",
121 defaults: ["art_defaults"],
122 stem: "odrefresh",
123 local_include_dirs: ["include"],
124 header_libs: ["libbase_headers"],
125 srcs: ["odrefresh_broken.cc"],
126 apex_available: ["test_jitzygote_com.android.art"],
127}
128
Orion Hodson4c3ade62021-02-10 14:07:10 +0000129art_cc_binary {
130 name: "odrefreshd",
131 defaults: [
132 "art_debug_defaults",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000133 "odrefresh_binary_defaults",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000134 ],
135 required: [
136 "dexoptanalyzerd",
137 "dex2oatd",
138 ],
139 shared_libs: [
140 "libartd",
141 "libartbased",
142 ],
143 apex_available: [
144 "com.android.art.debug",
Martin Stjernholmd3e9ff32021-03-16 00:44:25 +0000145 // TODO(b/183882457): This binary doesn't go into com.android.art, but
146 // apex_available lists need to be the same for internal libs to avoid
147 // stubs, and this depends on libartd.
148 "com.android.art",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000149 ],
150}
151
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100152cc_library_static {
153 name: "libodrstatslog",
154 defaults: ["art_defaults"],
155 host_supported: true,
156 export_include_dirs: ["include"],
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100157 local_include_dirs: ["include"],
158 shared_libs: ["libartbase"],
159 target: {
160 android: {
161 generated_headers: ["statslog_odrefresh.h"],
162 generated_sources: ["statslog_odrefresh.cpp"],
163 srcs: [
164 "odr_metrics_record.cc",
165 "odr_statslog_android.cc",
166 ],
167 shared_libs: ["libstatssocket"],
168 },
169 host: {
170 srcs: ["odr_statslog_host.cc"],
171 },
172 },
173 apex_available: [
174 "com.android.art",
175 "com.android.art.debug",
176 ],
177}
178
Roland Levillainf0409142021-03-22 15:45:03 +0000179art_cc_defaults {
180 name: "art_odrefresh_tests_defaults",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000181 defaults: ["odrefresh-defaults"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000182 header_libs: ["odrefresh_headers"],
183 srcs: [
184 "odr_artifacts_test.cc",
Jiakai Zhang39f6d002022-02-10 18:20:50 +0000185 "odr_common_test.cc",
Orion Hodsonf761f582021-06-09 10:50:57 +0100186 "odr_compilation_log_test.cc",
Orion Hodsonf96c9162021-04-07 10:43:01 +0100187 "odr_fs_utils_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100188 "odr_metrics_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100189 "odr_metrics_record_test.cc",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000190 "odrefresh_test.cc",
191 ],
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000192 static_libs: [
193 "libgmock",
194 ],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000195}
Orion Hodson947a8502021-03-08 15:40:09 +0000196
Roland Levillainf0409142021-03-22 15:45:03 +0000197// Version of ART gtest `art_odrefresh_tests` bundled with the ART APEX on target.
198// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
199art_cc_test {
200 name: "art_odrefresh_tests",
201 defaults: [
202 "art_gtest_defaults",
203 "art_odrefresh_tests_defaults",
204 ],
Victor Hsieh7a3ccd02021-09-08 11:59:29 -0700205 host_supported: false,
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000206 shared_libs: [
207 "libdexfiled",
208 ],
Jiakai Zhangebbbfce2022-01-11 14:47:17 +0000209 // The test config template is needed even though it's not used by the test
210 // runner. Otherwise, Soong will generate a test config, which is adding
211 // `art-host-test` as a test tag, while this test does not support running
212 // on host.
213 // TODO(b/214016626): Remove this line once the bug is fixed.
Alan Stokes14d071c2022-01-11 12:00:00 +0000214 test_config_template: "//art/test:art-gtests-target-standalone-template",
Roland Levillainf0409142021-03-22 15:45:03 +0000215}
216
217// Standalone version of ART gtest `art_odrefresh_tests`, not bundled with the ART APEX on target.
218art_cc_test {
219 name: "art_standalone_odrefresh_tests",
220 defaults: [
221 "art_standalone_gtest_defaults",
222 "art_odrefresh_tests_defaults",
223 ],
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000224 shared_libs: [
225 "libdexfile",
226 ],
Roland Levillainf0409142021-03-22 15:45:03 +0000227}
228
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100229genrule {
230 name: "statslog_odrefresh.h",
231 tools: ["stats-log-api-gen"],
232 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_odrefresh.h --module art --namespace art,metrics,statsd",
233 out: [
234 "statslog_odrefresh.h",
235 ],
236}
237
238genrule {
239 name: "statslog_odrefresh.cpp",
240 tools: ["stats-log-api-gen"],
241 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_odrefresh.cpp --module art --namespace art,metrics,statsd --importHeader statslog_odrefresh.h",
242 out: [
243 "statslog_odrefresh.cpp",
244 ],
245}
246
Orion Hodson947a8502021-03-08 15:40:09 +0000247xsd_config {
248 name: "art-apex-cache-info",
249 srcs: ["CacheInfo.xsd"],
250 package_name: "com.android.art",
251 api_dir: "schema",
252 gen_writer: true,
Sorin Basca1e7faf72021-05-27 13:05:22 +0000253 tinyxml: true,
Orion Hodson947a8502021-03-08 15:40:09 +0000254}