blob: e50406427485c99eaad06f066a20e60d06551e38 [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 },
55 linux: {
56 enabled: true,
57 },
58 host: {
59 shared_libs: [
60 // Both these libraries for libxml2 on host for code derived from apex-info-list.
61 "libicui18n",
62 "libicuuc",
63 ],
64 },
65 },
66 tidy: true,
67 tidy_flags: [
Chih-Hung Hsiehe4b7d432021-02-25 20:51:43 -080068 "-format-style=file",
69 "-header-filter=(art/odrefresh/|system/apex/)",
Orion Hodson4c3ade62021-02-10 14:07:10 +000070 ],
71}
72
73cc_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",
99 defaults: ["odrefresh-defaults"],
100 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",
118 "odrefresh-defaults",
119 ],
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"],
142
143 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
Orion Hodson4c3ade62021-02-10 14:07:10 +0000165art_cc_test {
166 name: "art_odrefresh_tests",
167 defaults: [
168 "art_gtest_defaults",
169 ],
Orion Hodson957fb152021-04-08 07:52:15 +0100170 generated_sources: ["art-odrefresh-operator-srcs"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000171 header_libs: ["odrefresh_headers"],
172 srcs: [
173 "odr_artifacts_test.cc",
Orion Hodsonf96c9162021-04-07 10:43:01 +0100174 "odr_fs_utils.cc",
175 "odr_fs_utils_test.cc",
Orion Hodson957fb152021-04-08 07:52:15 +0100176 "odr_metrics.cc",
177 "odr_metrics_test.cc",
178 "odr_metrics_record.cc",
179 "odr_metrics_record_test.cc",
Orion Hodson4c3ade62021-02-10 14:07:10 +0000180 "odrefresh_test.cc",
181 ],
Orion Hodson957fb152021-04-08 07:52:15 +0100182 shared_libs: ["libbase"],
Orion Hodson4c3ade62021-02-10 14:07:10 +0000183}
Orion Hodson947a8502021-03-08 15:40:09 +0000184
Orion Hodsonbaf563d2021-04-08 07:53:54 +0100185genrule {
186 name: "statslog_odrefresh.h",
187 tools: ["stats-log-api-gen"],
188 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_odrefresh.h --module art --namespace art,metrics,statsd",
189 out: [
190 "statslog_odrefresh.h",
191 ],
192}
193
194genrule {
195 name: "statslog_odrefresh.cpp",
196 tools: ["stats-log-api-gen"],
197 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_odrefresh.cpp --module art --namespace art,metrics,statsd --importHeader statslog_odrefresh.h",
198 out: [
199 "statslog_odrefresh.cpp",
200 ],
201}
202
Orion Hodson947a8502021-03-08 15:40:09 +0000203xsd_config {
204 name: "art-apex-cache-info",
205 srcs: ["CacheInfo.xsd"],
206 package_name: "com.android.art",
207 api_dir: "schema",
208 gen_writer: true,
209}