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", |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 28 | srcs: [ |
| 29 | "odrefresh.cc", |
Jiakai Zhang | 3ba3edf | 2021-08-11 08:25:40 +0000 | [diff] [blame] | 30 | "odr_common.cc", |
Orion Hodson | f761f58 | 2021-06-09 10:50:57 +0100 | [diff] [blame] | 31 | "odr_compilation_log.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: [ |
Sorin Basca | 1e7faf7 | 2021-05-27 13:05:22 +0000 | [diff] [blame] | 39 | "apex-info-list-tinyxml", |
Orion Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 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", |
| 46 | "liblog", |
| 47 | ], |
Jiakai Zhang | 432d6eb | 2021-11-11 15:52:00 +0000 | [diff] [blame] | 48 | static_libs: [ |
| 49 | "libc++fs", |
| 50 | "libtinyxml2", |
| 51 | ], |
Ulyana Trafimovich | b89649b | 2021-08-23 10:48:17 +0000 | [diff] [blame] | 52 | tidy: true, |
Jiakai Zhang | 9b7ddf6 | 2021-11-01 11:36:52 +0000 | [diff] [blame] | 53 | tidy_disabled_srcs: [":art-apex-cache-info"], |
Ulyana Trafimovich | b89649b | 2021-08-23 10:48:17 +0000 | [diff] [blame] | 54 | tidy_flags: [ |
| 55 | "-format-style=file", |
| 56 | "-header-filter=(art/odrefresh/|system/apex/)", |
| 57 | ], |
Jiakai Zhang | b91dad2 | 2021-08-16 03:20:07 +0000 | [diff] [blame] | 58 | } |
| 59 | |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 60 | cc_defaults { |
| 61 | name: "odrefresh_binary_defaults", |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 62 | defaults: [ |
| 63 | "art_defaults", |
| 64 | "odrefresh-defaults", |
| 65 | ], |
| 66 | srcs: ["odrefresh_main.cc"], |
| 67 | shared_libs: [ |
| 68 | "libdexfile", |
| 69 | ], |
| 70 | target: { |
| 71 | android: { |
| 72 | compile_multilib: "first", |
| 73 | }, |
| 74 | }, |
| 75 | } |
| 76 | |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 77 | cc_library_headers { |
| 78 | name: "odrefresh_headers", |
Martin Stjernholm | f726d20 | 2021-10-28 03:52:25 +0100 | [diff] [blame] | 79 | defaults: ["art_defaults"], |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 80 | export_include_dirs: ["include"], |
| 81 | host_supported: true, |
| 82 | stl: "none", |
| 83 | system_shared_libs: [], |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 84 | sdk_version: "minimum", // The minimum sdk version required by users of this module. |
| 85 | apex_available: [ |
| 86 | "//apex_available:platform", // For odsign. |
| 87 | ], |
| 88 | visibility: ["//visibility:public"], |
| 89 | } |
| 90 | |
Orion Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 91 | gensrcs { |
| 92 | name: "art-odrefresh-operator-srcs", |
| 93 | cmd: "$(location generate_operator_out) art/odrefresh $(in) > $(out)", |
| 94 | tools: ["generate_operator_out"], |
| 95 | srcs: [ |
| 96 | "odr_metrics.h", |
| 97 | ], |
| 98 | output_extension: "operator_out.cc", |
| 99 | } |
| 100 | |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 101 | art_cc_binary { |
| 102 | name: "odrefresh", |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 103 | defaults: ["odrefresh_binary_defaults"], |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 104 | required: [ |
| 105 | "dexoptanalyzer", |
| 106 | "dex2oat", |
| 107 | ], |
| 108 | shared_libs: [ |
| 109 | "libart", |
| 110 | "libartbase", |
| 111 | ], |
| 112 | apex_available: [ |
| 113 | "com.android.art", |
| 114 | "com.android.art.debug", |
| 115 | ], |
| 116 | } |
| 117 | |
Nicolas Geoffray | 4b76213 | 2021-11-30 15:18:25 +0000 | [diff] [blame] | 118 | // A no-op version of the odrefresh binary. |
| 119 | art_cc_binary { |
| 120 | name: "odrefresh_broken", |
| 121 | defaults: ["art_defaults"], |
| 122 | stem: "odrefresh", |
| 123 | local_include_dirs: ["include"], |
| 124 | header_libs: ["libbase_headers"], |
| 125 | srcs: ["odrefresh_broken.cc"], |
| 126 | apex_available: ["test_jitzygote_com.android.art"], |
| 127 | } |
| 128 | |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 129 | art_cc_binary { |
| 130 | name: "odrefreshd", |
| 131 | defaults: [ |
| 132 | "art_debug_defaults", |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 133 | "odrefresh_binary_defaults", |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 134 | ], |
| 135 | required: [ |
| 136 | "dexoptanalyzerd", |
| 137 | "dex2oatd", |
| 138 | ], |
| 139 | shared_libs: [ |
| 140 | "libartd", |
| 141 | "libartbased", |
| 142 | ], |
| 143 | apex_available: [ |
| 144 | "com.android.art.debug", |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 145 | // TODO(b/183882457): This binary doesn't go into com.android.art, but |
| 146 | // apex_available lists need to be the same for internal libs to avoid |
| 147 | // stubs, and this depends on libartd. |
| 148 | "com.android.art", |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 149 | ], |
| 150 | } |
| 151 | |
Orion Hodson | baf563d | 2021-04-08 07:53:54 +0100 | [diff] [blame] | 152 | cc_library_static { |
| 153 | name: "libodrstatslog", |
| 154 | defaults: ["art_defaults"], |
| 155 | host_supported: true, |
| 156 | export_include_dirs: ["include"], |
Orion Hodson | baf563d | 2021-04-08 07:53:54 +0100 | [diff] [blame] | 157 | local_include_dirs: ["include"], |
| 158 | shared_libs: ["libartbase"], |
| 159 | target: { |
| 160 | android: { |
| 161 | generated_headers: ["statslog_odrefresh.h"], |
| 162 | generated_sources: ["statslog_odrefresh.cpp"], |
| 163 | srcs: [ |
| 164 | "odr_metrics_record.cc", |
| 165 | "odr_statslog_android.cc", |
| 166 | ], |
| 167 | shared_libs: ["libstatssocket"], |
| 168 | }, |
| 169 | host: { |
| 170 | srcs: ["odr_statslog_host.cc"], |
| 171 | }, |
| 172 | }, |
| 173 | apex_available: [ |
| 174 | "com.android.art", |
| 175 | "com.android.art.debug", |
| 176 | ], |
| 177 | } |
| 178 | |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 179 | art_cc_defaults { |
| 180 | name: "art_odrefresh_tests_defaults", |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 181 | defaults: ["odrefresh-defaults"], |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 182 | header_libs: ["odrefresh_headers"], |
| 183 | srcs: [ |
| 184 | "odr_artifacts_test.cc", |
Jiakai Zhang | 39f6d00 | 2022-02-10 18:20:50 +0000 | [diff] [blame] | 185 | "odr_common_test.cc", |
Orion Hodson | f761f58 | 2021-06-09 10:50:57 +0100 | [diff] [blame] | 186 | "odr_compilation_log_test.cc", |
Orion Hodson | f96c916 | 2021-04-07 10:43:01 +0100 | [diff] [blame] | 187 | "odr_fs_utils_test.cc", |
Orion Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 188 | "odr_metrics_test.cc", |
Orion Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 189 | "odr_metrics_record_test.cc", |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 190 | "odrefresh_test.cc", |
| 191 | ], |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 192 | static_libs: [ |
| 193 | "libgmock", |
| 194 | ], |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 195 | } |
Orion Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 196 | |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 197 | // Version of ART gtest `art_odrefresh_tests` bundled with the ART APEX on target. |
| 198 | // TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. |
| 199 | art_cc_test { |
| 200 | name: "art_odrefresh_tests", |
| 201 | defaults: [ |
| 202 | "art_gtest_defaults", |
| 203 | "art_odrefresh_tests_defaults", |
| 204 | ], |
Victor Hsieh | 7a3ccd0 | 2021-09-08 11:59:29 -0700 | [diff] [blame] | 205 | host_supported: false, |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 206 | shared_libs: [ |
| 207 | "libdexfiled", |
| 208 | ], |
Jiakai Zhang | ebbbfce | 2022-01-11 14:47:17 +0000 | [diff] [blame] | 209 | // The test config template is needed even though it's not used by the test |
| 210 | // runner. Otherwise, Soong will generate a test config, which is adding |
| 211 | // `art-host-test` as a test tag, while this test does not support running |
| 212 | // on host. |
| 213 | // TODO(b/214016626): Remove this line once the bug is fixed. |
Alan Stokes | 14d071c | 2022-01-11 12:00:00 +0000 | [diff] [blame] | 214 | test_config_template: "//art/test:art-gtests-target-standalone-template", |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | // Standalone version of ART gtest `art_odrefresh_tests`, not bundled with the ART APEX on target. |
| 218 | art_cc_test { |
| 219 | name: "art_standalone_odrefresh_tests", |
| 220 | defaults: [ |
| 221 | "art_standalone_gtest_defaults", |
| 222 | "art_odrefresh_tests_defaults", |
| 223 | ], |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 224 | shared_libs: [ |
| 225 | "libdexfile", |
| 226 | ], |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 227 | } |
| 228 | |
Orion Hodson | baf563d | 2021-04-08 07:53:54 +0100 | [diff] [blame] | 229 | genrule { |
| 230 | name: "statslog_odrefresh.h", |
| 231 | tools: ["stats-log-api-gen"], |
| 232 | cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_odrefresh.h --module art --namespace art,metrics,statsd", |
| 233 | out: [ |
| 234 | "statslog_odrefresh.h", |
| 235 | ], |
| 236 | } |
| 237 | |
| 238 | genrule { |
| 239 | name: "statslog_odrefresh.cpp", |
| 240 | tools: ["stats-log-api-gen"], |
| 241 | cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_odrefresh.cpp --module art --namespace art,metrics,statsd --importHeader statslog_odrefresh.h", |
| 242 | out: [ |
| 243 | "statslog_odrefresh.cpp", |
| 244 | ], |
| 245 | } |
| 246 | |
Orion Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 247 | xsd_config { |
| 248 | name: "art-apex-cache-info", |
| 249 | srcs: ["CacheInfo.xsd"], |
| 250 | package_name: "com.android.art", |
| 251 | api_dir: "schema", |
| 252 | gen_writer: true, |
Sorin Basca | 1e7faf7 | 2021-05-27 13:05:22 +0000 | [diff] [blame] | 253 | tinyxml: true, |
Orion Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 254 | } |