blob: b5a5eb39976c6c0f0586a12c3ed26d28d36f9703 [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",
28 host_supported: true,
29 defaults: ["art_defaults"],
30 srcs: [
31 "odrefresh.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",
Orion Hodson947a8502021-03-08 15:40:09 +000046 "libdexfile",
Orion Hodson4c3ade62021-02-10 14:07:10 +000047 "liblog",
48 ],
Sorin Basca1e7faf72021-05-27 13:05:22 +000049 static_libs: ["libtinyxml2"],
Orion Hodson4c3ade62021-02-10 14:07:10 +000050 target: {
51 android: {
52 // Use the 32-bit version of odrefresh on devices.
53 compile_multilib: "prefer32",
54 },
Orion Hodson4c3ade62021-02-10 14:07:10 +000055 },
56 tidy: true,
57 tidy_flags: [
Chih-Hung Hsiehe4b7d432021-02-25 20:51:43 -080058 "-format-style=file",
59 "-header-filter=(art/odrefresh/|system/apex/)",
Orion Hodson4c3ade62021-02-10 14:07:10 +000060 ],
61}
62
63cc_library_headers {
64 name: "odrefresh_headers",
65 export_include_dirs: ["include"],
66 host_supported: true,
67 stl: "none",
68 system_shared_libs: [],
69 min_sdk_version: "29", // As part of mainline modules(APEX), it should support at least 29(Q).
70 sdk_version: "minimum", // The minimum sdk version required by users of this module.
71 apex_available: [
72 "//apex_available:platform", // For odsign.
73 ],
74 visibility: ["//visibility:public"],
75}
76
Orion Hodson957fb152021-04-08 07:52:15 +010077gensrcs {
78 name: "art-odrefresh-operator-srcs",
79 cmd: "$(location generate_operator_out) art/odrefresh $(in) > $(out)",
80 tools: ["generate_operator_out"],
81 srcs: [
82 "odr_metrics.h",
83 ],
84 output_extension: "operator_out.cc",
85}
86
Orion Hodson4c3ade62021-02-10 14:07:10 +000087art_cc_binary {
88 name: "odrefresh",
89 defaults: ["odrefresh-defaults"],
90 required: [
91 "dexoptanalyzer",
92 "dex2oat",
93 ],
94 shared_libs: [
95 "libart",
96 "libartbase",
97 ],
98 apex_available: [
99 "com.android.art",
100 "com.android.art.debug",
101 ],
102}
103
104art_cc_binary {
105 name: "odrefreshd",
106 defaults: [
107 "art_debug_defaults",
108 "odrefresh-defaults",
109 ],
110 required: [
111 "dexoptanalyzerd",
112 "dex2oatd",
113 ],
114 shared_libs: [
115 "libartd",
116 "libartbased",
117 ],
118 apex_available: [
119 "com.android.art.debug",
Martin Stjernholmd3e9ff32021-03-16 00:44:25 +0000120 // TODO(b/183882457): This binary doesn't go into com.android.art, but
121 // apex_available lists need to be the same for internal libs to avoid
122 // stubs, and this depends on libartd.
123 "com.android.art",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000124 ],
125}
126
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100127cc_library_static {
128 name: "libodrstatslog",
129 defaults: ["art_defaults"],
130 host_supported: true,
131 export_include_dirs: ["include"],
132
133 local_include_dirs: ["include"],
134 shared_libs: ["libartbase"],
135 target: {
136 android: {
137 generated_headers: ["statslog_odrefresh.h"],
138 generated_sources: ["statslog_odrefresh.cpp"],
139 srcs: [
140 "odr_metrics_record.cc",
141 "odr_statslog_android.cc",
142 ],
143 shared_libs: ["libstatssocket"],
144 },
145 host: {
146 srcs: ["odr_statslog_host.cc"],
147 },
148 },
149 apex_available: [
150 "com.android.art",
151 "com.android.art.debug",
152 ],
153}
154
Orion Hodson4c3ade62021-02-10 14:07:10 +0000155art_cc_test {
156 name: "art_odrefresh_tests",
157 defaults: [
158 "art_gtest_defaults",
159 ],
Orion Hodson957fb152021-04-08 07:52:15 +0100160 generated_sources: ["art-odrefresh-operator-srcs"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000161 header_libs: ["odrefresh_headers"],
162 srcs: [
163 "odr_artifacts_test.cc",
Orion Hodsonf96c9162021-04-07 10:43:01 +0100164 "odr_fs_utils.cc",
165 "odr_fs_utils_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100166 "odr_metrics.cc",
167 "odr_metrics_test.cc",
168 "odr_metrics_record.cc",
169 "odr_metrics_record_test.cc",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000170 "odrefresh_test.cc",
171 ],
Orion Hodson957fb152021-04-08 07:52:15 +0100172 shared_libs: ["libbase"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000173}
Orion Hodson947a8502021-03-08 15:40:09 +0000174
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100175genrule {
176 name: "statslog_odrefresh.h",
177 tools: ["stats-log-api-gen"],
178 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_odrefresh.h --module art --namespace art,metrics,statsd",
179 out: [
180 "statslog_odrefresh.h",
181 ],
182}
183
184genrule {
185 name: "statslog_odrefresh.cpp",
186 tools: ["stats-log-api-gen"],
187 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_odrefresh.cpp --module art --namespace art,metrics,statsd --importHeader statslog_odrefresh.h",
188 out: [
189 "statslog_odrefresh.cpp",
190 ],
191}
192
Orion Hodson947a8502021-03-08 15:40:09 +0000193xsd_config {
194 name: "art-apex-cache-info",
195 srcs: ["CacheInfo.xsd"],
196 package_name: "com.android.art",
197 api_dir: "schema",
198 gen_writer: true,
Sorin Basca1e7faf72021-05-27 13:05:22 +0000199 tinyxml: true,
Orion Hodson947a8502021-03-08 15:40:09 +0000200}