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