blob: acfd97aac1fa61634da81d27f08df8b816bf238b [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"],
Orion Hodson4c3ade62021-02-10 14:07:10 +000049 tidy: true,
50 tidy_flags: [
Chih-Hung Hsiehe4b7d432021-02-25 20:51:43 -080051 "-format-style=file",
52 "-header-filter=(art/odrefresh/|system/apex/)",
Orion Hodson4c3ade62021-02-10 14:07:10 +000053 ],
54}
55
Jiakai Zhangb91dad22021-08-16 03:20:07 +000056cc_defaults {
57 name: "odrefresh_binary_defaults",
58 host_supported: true,
59 defaults: [
60 "art_defaults",
61 "odrefresh-defaults",
62 ],
63 srcs: ["odrefresh_main.cc"],
64 shared_libs: [
65 "libdexfile",
66 ],
67 target: {
68 android: {
69 compile_multilib: "first",
70 },
71 },
72}
73
Orion Hodson4c3ade62021-02-10 14:07:10 +000074cc_library_headers {
75 name: "odrefresh_headers",
76 export_include_dirs: ["include"],
77 host_supported: true,
78 stl: "none",
79 system_shared_libs: [],
80 min_sdk_version: "29", // As part of mainline modules(APEX), it should support at least 29(Q).
81 sdk_version: "minimum", // The minimum sdk version required by users of this module.
82 apex_available: [
83 "//apex_available:platform", // For odsign.
84 ],
85 visibility: ["//visibility:public"],
86}
87
Orion Hodson957fb152021-04-08 07:52:15 +010088gensrcs {
89 name: "art-odrefresh-operator-srcs",
90 cmd: "$(location generate_operator_out) art/odrefresh $(in) > $(out)",
91 tools: ["generate_operator_out"],
92 srcs: [
93 "odr_metrics.h",
94 ],
95 output_extension: "operator_out.cc",
96}
97
Orion Hodson4c3ade62021-02-10 14:07:10 +000098art_cc_binary {
99 name: "odrefresh",
Jiakai Zhangb91dad22021-08-16 03:20:07 +0000100 defaults: ["odrefresh_binary_defaults"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000101 required: [
102 "dexoptanalyzer",
103 "dex2oat",
104 ],
105 shared_libs: [
106 "libart",
107 "libartbase",
108 ],
109 apex_available: [
110 "com.android.art",
111 "com.android.art.debug",
112 ],
113}
114
115art_cc_binary {
116 name: "odrefreshd",
117 defaults: [
118 "art_debug_defaults",
Jiakai Zhangb91dad22021-08-16 03:20:07 +0000119 "odrefresh_binary_defaults",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000120 ],
121 required: [
122 "dexoptanalyzerd",
123 "dex2oatd",
124 ],
125 shared_libs: [
126 "libartd",
127 "libartbased",
128 ],
129 apex_available: [
130 "com.android.art.debug",
Martin Stjernholmd3e9ff32021-03-16 00:44:25 +0000131 // TODO(b/183882457): This binary doesn't go into com.android.art, but
132 // apex_available lists need to be the same for internal libs to avoid
133 // stubs, and this depends on libartd.
134 "com.android.art",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000135 ],
136}
137
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100138cc_library_static {
139 name: "libodrstatslog",
140 defaults: ["art_defaults"],
141 host_supported: true,
142 export_include_dirs: ["include"],
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100143 local_include_dirs: ["include"],
144 shared_libs: ["libartbase"],
145 target: {
146 android: {
147 generated_headers: ["statslog_odrefresh.h"],
148 generated_sources: ["statslog_odrefresh.cpp"],
149 srcs: [
150 "odr_metrics_record.cc",
151 "odr_statslog_android.cc",
152 ],
153 shared_libs: ["libstatssocket"],
154 },
155 host: {
156 srcs: ["odr_statslog_host.cc"],
157 },
158 },
159 apex_available: [
160 "com.android.art",
161 "com.android.art.debug",
162 ],
163}
164
Roland Levillainf0409142021-03-22 15:45:03 +0000165art_cc_defaults {
166 name: "art_odrefresh_tests_defaults",
Jiakai Zhangb91dad22021-08-16 03:20:07 +0000167 defaults: ["odrefresh-defaults"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000168 header_libs: ["odrefresh_headers"],
169 srcs: [
170 "odr_artifacts_test.cc",
Orion Hodsonf761f582021-06-09 10:50:57 +0100171 "odr_compilation_log_test.cc",
Orion Hodsonf96c9162021-04-07 10:43:01 +0100172 "odr_fs_utils_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100173 "odr_metrics_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100174 "odr_metrics_record_test.cc",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000175 "odrefresh_test.cc",
176 ],
Jiakai Zhangb91dad22021-08-16 03:20:07 +0000177 static_libs: [
178 "libgmock",
179 ],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000180}
Orion Hodson947a8502021-03-08 15:40:09 +0000181
Roland Levillainf0409142021-03-22 15:45:03 +0000182// Version of ART gtest `art_odrefresh_tests` bundled with the ART APEX on target.
183// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
184art_cc_test {
185 name: "art_odrefresh_tests",
186 defaults: [
187 "art_gtest_defaults",
188 "art_odrefresh_tests_defaults",
189 ],
Jiakai Zhangb91dad22021-08-16 03:20:07 +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 Zhangb91dad22021-08-16 03:20:07 +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}