Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 1 | // |
| 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 Badour | 9150de6 | 2021-02-26 03:22:24 -0800 | [diff] [blame] | 17 | package { |
| 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 Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 26 | cc_defaults { |
| 27 | name: "odrefresh-defaults", |
| 28 | host_supported: true, |
| 29 | defaults: ["art_defaults"], |
| 30 | srcs: [ |
| 31 | "odrefresh.cc", |
Orion Hodson | f96c916 | 2021-04-07 10:43:01 +0100 | [diff] [blame] | 32 | "odr_fs_utils.cc", |
Orion Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 33 | "odr_metrics.cc", |
| 34 | "odr_metrics_record.cc", |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 35 | ], |
| 36 | local_include_dirs: ["include"], |
| 37 | header_libs: ["dexoptanalyzer_headers"], |
Orion Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 38 | generated_sources: [ |
| 39 | "apex-info-list", |
| 40 | "art-apex-cache-info", |
Orion Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 41 | "art-odrefresh-operator-srcs", |
Orion Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 42 | ], |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 43 | shared_libs: [ |
| 44 | "libartpalette", |
| 45 | "libbase", |
Orion Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 46 | "libdexfile", |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 47 | "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 Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 55 | 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 Hsieh | e4b7d43 | 2021-02-25 20:51:43 -0800 | [diff] [blame] | 65 | "-format-style=file", |
| 66 | "-header-filter=(art/odrefresh/|system/apex/)", |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 67 | ], |
| 68 | } |
| 69 | |
| 70 | cc_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 Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 84 | gensrcs { |
| 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 Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 94 | art_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 | |
| 111 | art_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 Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 127 | // 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 Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 131 | ], |
| 132 | } |
| 133 | |
Orion Hodson | baf563d | 2021-04-08 07:53:54 +0100 | [diff] [blame] | 134 | cc_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 Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 162 | art_cc_test { |
| 163 | name: "art_odrefresh_tests", |
| 164 | defaults: [ |
| 165 | "art_gtest_defaults", |
| 166 | ], |
Orion Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 167 | generated_sources: ["art-odrefresh-operator-srcs"], |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 168 | header_libs: ["odrefresh_headers"], |
| 169 | srcs: [ |
| 170 | "odr_artifacts_test.cc", |
Orion Hodson | f96c916 | 2021-04-07 10:43:01 +0100 | [diff] [blame] | 171 | "odr_fs_utils.cc", |
| 172 | "odr_fs_utils_test.cc", |
Orion Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 173 | "odr_metrics.cc", |
| 174 | "odr_metrics_test.cc", |
| 175 | "odr_metrics_record.cc", |
| 176 | "odr_metrics_record_test.cc", |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 177 | "odrefresh_test.cc", |
| 178 | ], |
Orion Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 179 | shared_libs: ["libbase"], |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 180 | } |
Orion Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 181 | |
Orion Hodson | baf563d | 2021-04-08 07:53:54 +0100 | [diff] [blame] | 182 | genrule { |
| 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 | |
| 191 | genrule { |
| 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 Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 200 | xsd_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 | } |