blob: 4ed395d8936d4f481f22f42240c6bd6dc12341a8 [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",
Victor Hsieh73c4f792021-10-01 18:13:52 +000032 "odr_dexopt.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: [
Victor Hsieh73c4f792021-10-01 18:13:52 +000045 "artd-private-aidl-ndk",
Orion Hodson4c3ade62021-02-10 14:07:10 +000046 "libartpalette",
47 "libbase",
48 "liblog",
49 ],
Jiakai Zhang432d6eb2021-11-11 15:52:00 +000050 static_libs: [
51 "libc++fs",
52 "libtinyxml2",
53 ],
Ulyana Trafimovichb89649b2021-08-23 10:48:17 +000054 tidy: true,
Jiakai Zhang9b7ddf62021-11-01 11:36:52 +000055 tidy_disabled_srcs: [":art-apex-cache-info"],
Ulyana Trafimovichb89649b2021-08-23 10:48:17 +000056 tidy_flags: [
57 "-format-style=file",
58 "-header-filter=(art/odrefresh/|system/apex/)",
59 ],
Jiakai Zhangb91dad22021-08-16 03:20:07 +000060}
61
Jiakai Zhangccbcfb12021-08-23 15:10:35 +000062cc_defaults {
63 name: "odrefresh_binary_defaults",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +000064 defaults: [
65 "art_defaults",
66 "odrefresh-defaults",
67 ],
68 srcs: ["odrefresh_main.cc"],
69 shared_libs: [
70 "libdexfile",
71 ],
72 target: {
73 android: {
74 compile_multilib: "first",
75 },
76 },
77}
78
Orion Hodson4c3ade62021-02-10 14:07:10 +000079cc_library_headers {
80 name: "odrefresh_headers",
Martin Stjernholmf726d202021-10-28 03:52:25 +010081 defaults: ["art_defaults"],
Orion Hodson4c3ade62021-02-10 14:07:10 +000082 export_include_dirs: ["include"],
83 host_supported: true,
84 stl: "none",
85 system_shared_libs: [],
Orion Hodson4c3ade62021-02-10 14:07:10 +000086 sdk_version: "minimum", // The minimum sdk version required by users of this module.
87 apex_available: [
88 "//apex_available:platform", // For odsign.
89 ],
90 visibility: ["//visibility:public"],
91}
92
Orion Hodson957fb152021-04-08 07:52:15 +010093gensrcs {
94 name: "art-odrefresh-operator-srcs",
95 cmd: "$(location generate_operator_out) art/odrefresh $(in) > $(out)",
96 tools: ["generate_operator_out"],
97 srcs: [
98 "odr_metrics.h",
99 ],
100 output_extension: "operator_out.cc",
101}
102
Orion Hodson4c3ade62021-02-10 14:07:10 +0000103art_cc_binary {
104 name: "odrefresh",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000105 defaults: ["odrefresh_binary_defaults"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000106 required: [
107 "dexoptanalyzer",
108 "dex2oat",
109 ],
110 shared_libs: [
111 "libart",
112 "libartbase",
Sorin Basca8d12ed62021-10-12 16:17:37 +0000113 "libdexopt",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000114 ],
115 apex_available: [
116 "com.android.art",
117 "com.android.art.debug",
118 ],
119}
120
Nicolas Geoffray4b762132021-11-30 15:18:25 +0000121// A no-op version of the odrefresh binary.
122art_cc_binary {
123 name: "odrefresh_broken",
124 defaults: ["art_defaults"],
125 stem: "odrefresh",
126 local_include_dirs: ["include"],
127 header_libs: ["libbase_headers"],
128 srcs: ["odrefresh_broken.cc"],
129 apex_available: ["test_jitzygote_com.android.art"],
130}
131
Orion Hodson4c3ade62021-02-10 14:07:10 +0000132art_cc_binary {
133 name: "odrefreshd",
134 defaults: [
135 "art_debug_defaults",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000136 "odrefresh_binary_defaults",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000137 ],
138 required: [
139 "dexoptanalyzerd",
140 "dex2oatd",
141 ],
142 shared_libs: [
143 "libartd",
144 "libartbased",
Victor Hsieh73c4f792021-10-01 18:13:52 +0000145 "libdexoptd",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000146 ],
147 apex_available: [
148 "com.android.art.debug",
Martin Stjernholmd3e9ff32021-03-16 00:44:25 +0000149 // TODO(b/183882457): This binary doesn't go into com.android.art, but
150 // apex_available lists need to be the same for internal libs to avoid
151 // stubs, and this depends on libartd.
152 "com.android.art",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000153 ],
154}
155
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100156cc_library_static {
157 name: "libodrstatslog",
158 defaults: ["art_defaults"],
159 host_supported: true,
160 export_include_dirs: ["include"],
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100161 local_include_dirs: ["include"],
162 shared_libs: ["libartbase"],
163 target: {
164 android: {
165 generated_headers: ["statslog_odrefresh.h"],
166 generated_sources: ["statslog_odrefresh.cpp"],
167 srcs: [
168 "odr_metrics_record.cc",
169 "odr_statslog_android.cc",
170 ],
171 shared_libs: ["libstatssocket"],
172 },
173 host: {
174 srcs: ["odr_statslog_host.cc"],
175 },
176 },
177 apex_available: [
178 "com.android.art",
179 "com.android.art.debug",
180 ],
181}
182
Roland Levillainf0409142021-03-22 15:45:03 +0000183art_cc_defaults {
184 name: "art_odrefresh_tests_defaults",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000185 defaults: ["odrefresh-defaults"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000186 header_libs: ["odrefresh_headers"],
187 srcs: [
188 "odr_artifacts_test.cc",
Orion Hodsonf761f582021-06-09 10:50:57 +0100189 "odr_compilation_log_test.cc",
Orion Hodsonf96c9162021-04-07 10:43:01 +0100190 "odr_fs_utils_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100191 "odr_metrics_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100192 "odr_metrics_record_test.cc",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000193 "odrefresh_test.cc",
194 ],
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000195 static_libs: [
196 "libgmock",
197 ],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000198}
Orion Hodson947a8502021-03-08 15:40:09 +0000199
Roland Levillainf0409142021-03-22 15:45:03 +0000200// Version of ART gtest `art_odrefresh_tests` bundled with the ART APEX on target.
201// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
202art_cc_test {
203 name: "art_odrefresh_tests",
204 defaults: [
205 "art_gtest_defaults",
206 "art_odrefresh_tests_defaults",
207 ],
Victor Hsieh7a3ccd02021-09-08 11:59:29 -0700208 host_supported: false,
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000209 shared_libs: [
210 "libdexfiled",
Victor Hsieh73c4f792021-10-01 18:13:52 +0000211 "libdexoptd",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000212 ],
Jiakai Zhangebbbfce2022-01-11 14:47:17 +0000213 // The test config template is needed even though it's not used by the test
214 // runner. Otherwise, Soong will generate a test config, which is adding
215 // `art-host-test` as a test tag, while this test does not support running
216 // on host.
217 // TODO(b/214016626): Remove this line once the bug is fixed.
Alan Stokes14d071c2022-01-11 12:00:00 +0000218 test_config_template: "//art/test:art-gtests-target-standalone-template",
Roland Levillainf0409142021-03-22 15:45:03 +0000219}
220
221// Standalone version of ART gtest `art_odrefresh_tests`, not bundled with the ART APEX on target.
222art_cc_test {
223 name: "art_standalone_odrefresh_tests",
224 defaults: [
225 "art_standalone_gtest_defaults",
226 "art_odrefresh_tests_defaults",
227 ],
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000228 shared_libs: [
229 "libdexfile",
Sorin Basca8d12ed62021-10-12 16:17:37 +0000230 "libdexopt",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000231 ],
Roland Levillainf0409142021-03-22 15:45:03 +0000232}
233
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100234genrule {
235 name: "statslog_odrefresh.h",
236 tools: ["stats-log-api-gen"],
237 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_odrefresh.h --module art --namespace art,metrics,statsd",
238 out: [
239 "statslog_odrefresh.h",
240 ],
241}
242
243genrule {
244 name: "statslog_odrefresh.cpp",
245 tools: ["stats-log-api-gen"],
246 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_odrefresh.cpp --module art --namespace art,metrics,statsd --importHeader statslog_odrefresh.h",
247 out: [
248 "statslog_odrefresh.cpp",
249 ],
250}
251
Orion Hodson947a8502021-03-08 15:40:09 +0000252xsd_config {
253 name: "art-apex-cache-info",
254 srcs: ["CacheInfo.xsd"],
255 package_name: "com.android.art",
256 api_dir: "schema",
257 gen_writer: true,
Sorin Basca1e7faf72021-05-27 13:05:22 +0000258 tinyxml: true,
Orion Hodson947a8502021-03-08 15:40:09 +0000259}