blob: 64859e3edfaeac57c59ed624804e6678e7c225bc [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 ],
Sorin Basca1e7faf72021-05-27 13:05:22 +000050 static_libs: ["libtinyxml2"],
Ulyana Trafimovichb89649b2021-08-23 10:48:17 +000051 tidy: true,
52 tidy_flags: [
53 "-format-style=file",
54 "-header-filter=(art/odrefresh/|system/apex/)",
55 ],
Jiakai Zhangb91dad22021-08-16 03:20:07 +000056}
57
Jiakai Zhangccbcfb12021-08-23 15:10:35 +000058cc_defaults {
59 name: "odrefresh_binary_defaults",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +000060 defaults: [
61 "art_defaults",
62 "odrefresh-defaults",
63 ],
64 srcs: ["odrefresh_main.cc"],
65 shared_libs: [
66 "libdexfile",
67 ],
68 target: {
69 android: {
70 compile_multilib: "first",
71 },
72 },
73}
74
Orion Hodson4c3ade62021-02-10 14:07:10 +000075cc_library_headers {
76 name: "odrefresh_headers",
Martin Stjernholmf726d202021-10-28 03:52:25 +010077 defaults: ["art_defaults"],
Orion Hodson4c3ade62021-02-10 14:07:10 +000078 export_include_dirs: ["include"],
79 host_supported: true,
80 stl: "none",
81 system_shared_libs: [],
Orion Hodson4c3ade62021-02-10 14:07:10 +000082 sdk_version: "minimum", // The minimum sdk version required by users of this module.
83 apex_available: [
84 "//apex_available:platform", // For odsign.
85 ],
86 visibility: ["//visibility:public"],
87}
88
Orion Hodson957fb152021-04-08 07:52:15 +010089gensrcs {
90 name: "art-odrefresh-operator-srcs",
91 cmd: "$(location generate_operator_out) art/odrefresh $(in) > $(out)",
92 tools: ["generate_operator_out"],
93 srcs: [
94 "odr_metrics.h",
95 ],
96 output_extension: "operator_out.cc",
97}
98
Orion Hodson4c3ade62021-02-10 14:07:10 +000099art_cc_binary {
100 name: "odrefresh",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000101 defaults: ["odrefresh_binary_defaults"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000102 required: [
103 "dexoptanalyzer",
104 "dex2oat",
105 ],
106 shared_libs: [
107 "libart",
108 "libartbase",
Sorin Basca8d12ed62021-10-12 16:17:37 +0000109 "libdexopt",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000110 ],
111 apex_available: [
112 "com.android.art",
113 "com.android.art.debug",
114 ],
115}
116
117art_cc_binary {
118 name: "odrefreshd",
119 defaults: [
120 "art_debug_defaults",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000121 "odrefresh_binary_defaults",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000122 ],
123 required: [
124 "dexoptanalyzerd",
125 "dex2oatd",
126 ],
127 shared_libs: [
128 "libartd",
129 "libartbased",
Victor Hsieh73c4f792021-10-01 18:13:52 +0000130 "libdexoptd",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000131 ],
132 apex_available: [
133 "com.android.art.debug",
Martin Stjernholmd3e9ff32021-03-16 00:44:25 +0000134 // TODO(b/183882457): This binary doesn't go into com.android.art, but
135 // apex_available lists need to be the same for internal libs to avoid
136 // stubs, and this depends on libartd.
137 "com.android.art",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000138 ],
139}
140
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100141cc_library_static {
142 name: "libodrstatslog",
143 defaults: ["art_defaults"],
144 host_supported: true,
145 export_include_dirs: ["include"],
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100146 local_include_dirs: ["include"],
147 shared_libs: ["libartbase"],
148 target: {
149 android: {
150 generated_headers: ["statslog_odrefresh.h"],
151 generated_sources: ["statslog_odrefresh.cpp"],
152 srcs: [
153 "odr_metrics_record.cc",
154 "odr_statslog_android.cc",
155 ],
156 shared_libs: ["libstatssocket"],
157 },
158 host: {
159 srcs: ["odr_statslog_host.cc"],
160 },
161 },
162 apex_available: [
163 "com.android.art",
164 "com.android.art.debug",
165 ],
166}
167
Roland Levillainf0409142021-03-22 15:45:03 +0000168art_cc_defaults {
169 name: "art_odrefresh_tests_defaults",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000170 defaults: ["odrefresh-defaults"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000171 header_libs: ["odrefresh_headers"],
172 srcs: [
173 "odr_artifacts_test.cc",
Orion Hodsonf761f582021-06-09 10:50:57 +0100174 "odr_compilation_log_test.cc",
Orion Hodsonf96c9162021-04-07 10:43:01 +0100175 "odr_fs_utils_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100176 "odr_metrics_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100177 "odr_metrics_record_test.cc",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000178 "odrefresh_test.cc",
179 ],
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000180 static_libs: [
181 "libgmock",
182 ],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000183}
Orion Hodson947a8502021-03-08 15:40:09 +0000184
Roland Levillainf0409142021-03-22 15:45:03 +0000185// Version of ART gtest `art_odrefresh_tests` bundled with the ART APEX on target.
186// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
187art_cc_test {
188 name: "art_odrefresh_tests",
189 defaults: [
190 "art_gtest_defaults",
191 "art_odrefresh_tests_defaults",
192 ],
Victor Hsieh7a3ccd02021-09-08 11:59:29 -0700193 host_supported: false,
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000194 shared_libs: [
195 "libdexfiled",
Victor Hsieh73c4f792021-10-01 18:13:52 +0000196 "libdexoptd",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000197 ],
Jiakai Zhang5514c8e2021-10-19 05:40:32 +0000198 test_config_template: "//art/test:art-gtests-target-standalone-root-template",
Roland Levillainf0409142021-03-22 15:45:03 +0000199}
200
201// Standalone version of ART gtest `art_odrefresh_tests`, not bundled with the ART APEX on target.
202art_cc_test {
203 name: "art_standalone_odrefresh_tests",
204 defaults: [
205 "art_standalone_gtest_defaults",
206 "art_odrefresh_tests_defaults",
207 ],
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000208 shared_libs: [
209 "libdexfile",
Sorin Basca8d12ed62021-10-12 16:17:37 +0000210 "libdexopt",
Jiakai Zhangccbcfb12021-08-23 15:10:35 +0000211 ],
Jiakai Zhang5514c8e2021-10-19 05:40:32 +0000212 test_config_template: "//art/test:art-gtests-target-standalone-root-template",
Roland Levillainf0409142021-03-22 15:45:03 +0000213}
214
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100215genrule {
216 name: "statslog_odrefresh.h",
217 tools: ["stats-log-api-gen"],
218 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_odrefresh.h --module art --namespace art,metrics,statsd",
219 out: [
220 "statslog_odrefresh.h",
221 ],
222}
223
224genrule {
225 name: "statslog_odrefresh.cpp",
226 tools: ["stats-log-api-gen"],
227 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_odrefresh.cpp --module art --namespace art,metrics,statsd --importHeader statslog_odrefresh.h",
228 out: [
229 "statslog_odrefresh.cpp",
230 ],
231}
232
Orion Hodson947a8502021-03-08 15:40:09 +0000233xsd_config {
234 name: "art-apex-cache-info",
235 srcs: ["CacheInfo.xsd"],
236 package_name: "com.android.art",
237 api_dir: "schema",
238 gen_writer: true,
Sorin Basca1e7faf72021-05-27 13:05:22 +0000239 tinyxml: true,
Orion Hodson947a8502021-03-08 15:40:09 +0000240}