blob: 10845c56666d2619d79ce3b474f0d9a99a99e4c9 [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: [
39 "apex-info-list",
40 "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 ],
49 static_libs: ["libxml2"],
50 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 host: {
56 shared_libs: [
57 // Both these libraries for libxml2 on host for code derived from apex-info-list.
58 "libicui18n",
59 "libicuuc",
60 ],
61 },
62 },
63 tidy: true,
64 tidy_flags: [
Chih-Hung Hsiehe4b7d432021-02-25 20:51:43 -080065 "-format-style=file",
66 "-header-filter=(art/odrefresh/|system/apex/)",
Orion Hodson4c3ade62021-02-10 14:07:10 +000067 ],
68}
69
70cc_library_headers {
71 name: "odrefresh_headers",
72 export_include_dirs: ["include"],
73 host_supported: true,
74 stl: "none",
75 system_shared_libs: [],
76 min_sdk_version: "29", // As part of mainline modules(APEX), it should support at least 29(Q).
77 sdk_version: "minimum", // The minimum sdk version required by users of this module.
78 apex_available: [
79 "//apex_available:platform", // For odsign.
80 ],
81 visibility: ["//visibility:public"],
82}
83
Orion Hodson957fb152021-04-08 07:52:15 +010084gensrcs {
85 name: "art-odrefresh-operator-srcs",
86 cmd: "$(location generate_operator_out) art/odrefresh $(in) > $(out)",
87 tools: ["generate_operator_out"],
88 srcs: [
89 "odr_metrics.h",
90 ],
91 output_extension: "operator_out.cc",
92}
93
Orion Hodson4c3ade62021-02-10 14:07:10 +000094art_cc_binary {
95 name: "odrefresh",
96 defaults: ["odrefresh-defaults"],
97 required: [
98 "dexoptanalyzer",
99 "dex2oat",
100 ],
101 shared_libs: [
102 "libart",
103 "libartbase",
104 ],
105 apex_available: [
106 "com.android.art",
107 "com.android.art.debug",
108 ],
109}
110
111art_cc_binary {
112 name: "odrefreshd",
113 defaults: [
114 "art_debug_defaults",
115 "odrefresh-defaults",
116 ],
117 required: [
118 "dexoptanalyzerd",
119 "dex2oatd",
120 ],
121 shared_libs: [
122 "libartd",
123 "libartbased",
124 ],
125 apex_available: [
126 "com.android.art.debug",
Martin Stjernholmd3e9ff32021-03-16 00:44:25 +0000127 // TODO(b/183882457): This binary doesn't go into com.android.art, but
128 // apex_available lists need to be the same for internal libs to avoid
129 // stubs, and this depends on libartd.
130 "com.android.art",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000131 ],
132}
133
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100134cc_library_static {
135 name: "libodrstatslog",
136 defaults: ["art_defaults"],
137 host_supported: true,
138 export_include_dirs: ["include"],
139
140 local_include_dirs: ["include"],
141 shared_libs: ["libartbase"],
142 target: {
143 android: {
144 generated_headers: ["statslog_odrefresh.h"],
145 generated_sources: ["statslog_odrefresh.cpp"],
146 srcs: [
147 "odr_metrics_record.cc",
148 "odr_statslog_android.cc",
149 ],
150 shared_libs: ["libstatssocket"],
151 },
152 host: {
153 srcs: ["odr_statslog_host.cc"],
154 },
155 },
156 apex_available: [
157 "com.android.art",
158 "com.android.art.debug",
159 ],
160}
161
Orion Hodson4c3ade62021-02-10 14:07:10 +0000162art_cc_test {
163 name: "art_odrefresh_tests",
164 defaults: [
165 "art_gtest_defaults",
166 ],
Orion Hodson957fb152021-04-08 07:52:15 +0100167 generated_sources: ["art-odrefresh-operator-srcs"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000168 header_libs: ["odrefresh_headers"],
169 srcs: [
170 "odr_artifacts_test.cc",
Orion Hodsonf96c9162021-04-07 10:43:01 +0100171 "odr_fs_utils.cc",
172 "odr_fs_utils_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100173 "odr_metrics.cc",
174 "odr_metrics_test.cc",
175 "odr_metrics_record.cc",
176 "odr_metrics_record_test.cc",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000177 "odrefresh_test.cc",
178 ],
Orion Hodson957fb152021-04-08 07:52:15 +0100179 shared_libs: ["libbase"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000180}
Orion Hodson947a8502021-03-08 15:40:09 +0000181
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100182genrule {
183 name: "statslog_odrefresh.h",
184 tools: ["stats-log-api-gen"],
185 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_odrefresh.h --module art --namespace art,metrics,statsd",
186 out: [
187 "statslog_odrefresh.h",
188 ],
189}
190
191genrule {
192 name: "statslog_odrefresh.cpp",
193 tools: ["stats-log-api-gen"],
194 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_odrefresh.cpp --module art --namespace art,metrics,statsd --importHeader statslog_odrefresh.h",
195 out: [
196 "statslog_odrefresh.cpp",
197 ],
198}
199
Orion Hodson947a8502021-03-08 15:40:09 +0000200xsd_config {
201 name: "art-apex-cache-info",
202 srcs: ["CacheInfo.xsd"],
203 package_name: "com.android.art",
204 api_dir: "schema",
205 gen_writer: true,
206}