blob: 90167190d34cb31d2804892510d11dc1c567503a [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 ],
Sorin Basca1e7faf72021-05-27 13:05:22 +000048 static_libs: ["libtinyxml2"],
Ulyana Trafimovichb89649b2021-08-23 10:48:17 +000049 tidy: true,
50 tidy_flags: [
51 "-format-style=file",
52 "-header-filter=(art/odrefresh/|system/apex/)",
53 ],
Jiakai Zhangb91dad22021-08-16 03:20:07 +000054}
55
Jiakai Zhangccbcfb12021-08-23 15:10:35 +000056cc_defaults {
57 name: "odrefresh_binary_defaults",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +000058 defaults: [
59 "art_defaults",
60 "odrefresh-defaults",
61 ],
62 srcs: ["odrefresh_main.cc"],
63 shared_libs: [
64 "libdexfile",
65 ],
66 target: {
67 android: {
68 compile_multilib: "first",
69 },
70 },
71}
72
Orion Hodson4c3ade62021-02-10 14:07:10 +000073cc_library_headers {
74 name: "odrefresh_headers",
75 export_include_dirs: ["include"],
76 host_supported: true,
77 stl: "none",
78 system_shared_libs: [],
79 min_sdk_version: "29", // As part of mainline modules(APEX), it should support at least 29(Q).
80 sdk_version: "minimum", // The minimum sdk version required by users of this module.
81 apex_available: [
82 "//apex_available:platform", // For odsign.
83 ],
84 visibility: ["//visibility:public"],
85}
86
Orion Hodson957fb152021-04-08 07:52:15 +010087gensrcs {
88 name: "art-odrefresh-operator-srcs",
89 cmd: "$(location generate_operator_out) art/odrefresh $(in) > $(out)",
90 tools: ["generate_operator_out"],
91 srcs: [
92 "odr_metrics.h",
93 ],
94 output_extension: "operator_out.cc",
95}
96
Orion Hodson4c3ade62021-02-10 14:07:10 +000097art_cc_binary {
98 name: "odrefresh",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +000099 defaults: ["odrefresh_binary_defaults"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000100 required: [
101 "dexoptanalyzer",
102 "dex2oat",
103 ],
104 shared_libs: [
105 "libart",
106 "libartbase",
107 ],
108 apex_available: [
109 "com.android.art",
110 "com.android.art.debug",
111 ],
112}
113
114art_cc_binary {
115 name: "odrefreshd",
116 defaults: [
117 "art_debug_defaults",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000118 "odrefresh_binary_defaults",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000119 ],
120 required: [
121 "dexoptanalyzerd",
122 "dex2oatd",
123 ],
124 shared_libs: [
125 "libartd",
126 "libartbased",
127 ],
128 apex_available: [
129 "com.android.art.debug",
Martin Stjernholmd3e9ff32021-03-16 00:44:25 +0000130 // TODO(b/183882457): This binary doesn't go into com.android.art, but
131 // apex_available lists need to be the same for internal libs to avoid
132 // stubs, and this depends on libartd.
133 "com.android.art",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000134 ],
135}
136
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100137cc_library_static {
138 name: "libodrstatslog",
139 defaults: ["art_defaults"],
140 host_supported: true,
141 export_include_dirs: ["include"],
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100142 local_include_dirs: ["include"],
143 shared_libs: ["libartbase"],
144 target: {
145 android: {
146 generated_headers: ["statslog_odrefresh.h"],
147 generated_sources: ["statslog_odrefresh.cpp"],
148 srcs: [
149 "odr_metrics_record.cc",
150 "odr_statslog_android.cc",
151 ],
152 shared_libs: ["libstatssocket"],
153 },
154 host: {
155 srcs: ["odr_statslog_host.cc"],
156 },
157 },
158 apex_available: [
159 "com.android.art",
160 "com.android.art.debug",
161 ],
162}
163
Roland Levillainf0409142021-03-22 15:45:03 +0000164art_cc_defaults {
165 name: "art_odrefresh_tests_defaults",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000166 defaults: ["odrefresh-defaults"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000167 header_libs: ["odrefresh_headers"],
168 srcs: [
169 "odr_artifacts_test.cc",
Orion Hodsonf761f582021-06-09 10:50:57 +0100170 "odr_compilation_log_test.cc",
Orion Hodsonf96c9162021-04-07 10:43:01 +0100171 "odr_fs_utils_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100172 "odr_metrics_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100173 "odr_metrics_record_test.cc",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000174 "odrefresh_test.cc",
175 ],
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000176 static_libs: [
177 "libgmock",
178 ],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000179}
Orion Hodson947a8502021-03-08 15:40:09 +0000180
Roland Levillainf0409142021-03-22 15:45:03 +0000181// Version of ART gtest `art_odrefresh_tests` bundled with the ART APEX on target.
182// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
183art_cc_test {
184 name: "art_odrefresh_tests",
185 defaults: [
186 "art_gtest_defaults",
187 "art_odrefresh_tests_defaults",
188 ],
Victor Hsieh7a3ccd02021-09-08 11:59:29 -0700189 host_supported: false,
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000190 shared_libs: [
191 "libdexfiled",
192 ],
193 test_config_template: "art_odrefresh_tests.xml",
Roland Levillainf0409142021-03-22 15:45:03 +0000194}
195
196// Standalone version of ART gtest `art_odrefresh_tests`, not bundled with the ART APEX on target.
197art_cc_test {
198 name: "art_standalone_odrefresh_tests",
199 defaults: [
200 "art_standalone_gtest_defaults",
201 "art_odrefresh_tests_defaults",
202 ],
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000203 shared_libs: [
204 "libdexfile",
205 ],
206 test_config_template: "art_odrefresh_tests.xml",
Roland Levillainf0409142021-03-22 15:45:03 +0000207}
208
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100209genrule {
210 name: "statslog_odrefresh.h",
211 tools: ["stats-log-api-gen"],
212 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_odrefresh.h --module art --namespace art,metrics,statsd",
213 out: [
214 "statslog_odrefresh.h",
215 ],
216}
217
218genrule {
219 name: "statslog_odrefresh.cpp",
220 tools: ["stats-log-api-gen"],
221 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_odrefresh.cpp --module art --namespace art,metrics,statsd --importHeader statslog_odrefresh.h",
222 out: [
223 "statslog_odrefresh.cpp",
224 ],
225}
226
Orion Hodson947a8502021-03-08 15:40:09 +0000227xsd_config {
228 name: "art-apex-cache-info",
229 srcs: ["CacheInfo.xsd"],
230 package_name: "com.android.art",
231 api_dir: "schema",
232 gen_writer: true,
Sorin Basca1e7faf72021-05-27 13:05:22 +0000233 tinyxml: true,
Orion Hodson947a8502021-03-08 15:40:09 +0000234}