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 | ], |
Sorin Basca | 1e7faf7 | 2021-05-27 13:05:22 +0000 | [diff] [blame] | 48 | static_libs: ["libtinyxml2"], |
Ulyana Trafimovich | b89649b | 2021-08-23 10:48:17 +0000 | [diff] [blame] | 49 | tidy: true, |
| 50 | tidy_flags: [ |
| 51 | "-format-style=file", |
| 52 | "-header-filter=(art/odrefresh/|system/apex/)", |
| 53 | ], |
Jiakai Zhang | b91dad2 | 2021-08-16 03:20:07 +0000 | [diff] [blame] | 54 | } |
| 55 | |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 56 | cc_defaults { |
| 57 | name: "odrefresh_binary_defaults", |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 58 | defaults: [ |
| 59 | "art_defaults", |
| 60 | "odrefresh-defaults", |
| 61 | ], |
| 62 | srcs: ["odrefresh_main.cc"], |
| 63 | shared_libs: [ |
| 64 | "libdexfile", |
| 65 | ], |
| 66 | target: { |
| 67 | android: { |
| 68 | compile_multilib: "first", |
| 69 | }, |
| 70 | }, |
| 71 | } |
| 72 | |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 73 | cc_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 Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 87 | gensrcs { |
| 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 Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 97 | art_cc_binary { |
| 98 | name: "odrefresh", |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 99 | defaults: ["odrefresh_binary_defaults"], |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 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 | |
| 114 | art_cc_binary { |
| 115 | name: "odrefreshd", |
| 116 | defaults: [ |
| 117 | "art_debug_defaults", |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 118 | "odrefresh_binary_defaults", |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 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 Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 130 | // 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 Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 134 | ], |
| 135 | } |
| 136 | |
Orion Hodson | baf563d | 2021-04-08 07:53:54 +0100 | [diff] [blame] | 137 | cc_library_static { |
| 138 | name: "libodrstatslog", |
| 139 | defaults: ["art_defaults"], |
| 140 | host_supported: true, |
| 141 | export_include_dirs: ["include"], |
Orion Hodson | baf563d | 2021-04-08 07:53:54 +0100 | [diff] [blame] | 142 | local_include_dirs: ["include"], |
| 143 | shared_libs: ["libartbase"], |
| 144 | target: { |
| 145 | android: { |
| 146 | generated_headers: ["statslog_odrefresh.h"], |
| 147 | generated_sources: ["statslog_odrefresh.cpp"], |
| 148 | srcs: [ |
| 149 | "odr_metrics_record.cc", |
| 150 | "odr_statslog_android.cc", |
| 151 | ], |
| 152 | shared_libs: ["libstatssocket"], |
| 153 | }, |
| 154 | host: { |
| 155 | srcs: ["odr_statslog_host.cc"], |
| 156 | }, |
| 157 | }, |
| 158 | apex_available: [ |
| 159 | "com.android.art", |
| 160 | "com.android.art.debug", |
| 161 | ], |
| 162 | } |
| 163 | |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 164 | art_cc_defaults { |
| 165 | name: "art_odrefresh_tests_defaults", |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 166 | defaults: ["odrefresh-defaults"], |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 167 | header_libs: ["odrefresh_headers"], |
| 168 | srcs: [ |
| 169 | "odr_artifacts_test.cc", |
Orion Hodson | f761f58 | 2021-06-09 10:50:57 +0100 | [diff] [blame] | 170 | "odr_compilation_log_test.cc", |
Orion Hodson | f96c916 | 2021-04-07 10:43:01 +0100 | [diff] [blame] | 171 | "odr_fs_utils_test.cc", |
Orion Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 172 | "odr_metrics_test.cc", |
Orion Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 173 | "odr_metrics_record_test.cc", |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 174 | "odrefresh_test.cc", |
| 175 | ], |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 176 | static_libs: [ |
| 177 | "libgmock", |
| 178 | ], |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 179 | } |
Orion Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 180 | |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 181 | // Version of ART gtest `art_odrefresh_tests` bundled with the ART APEX on target. |
| 182 | // TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. |
| 183 | art_cc_test { |
| 184 | name: "art_odrefresh_tests", |
| 185 | defaults: [ |
| 186 | "art_gtest_defaults", |
| 187 | "art_odrefresh_tests_defaults", |
| 188 | ], |
Victor Hsieh | 7a3ccd0 | 2021-09-08 11:59:29 -0700 | [diff] [blame^] | 189 | host_supported: false, |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 190 | shared_libs: [ |
| 191 | "libdexfiled", |
| 192 | ], |
| 193 | test_config_template: "art_odrefresh_tests.xml", |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | // Standalone version of ART gtest `art_odrefresh_tests`, not bundled with the ART APEX on target. |
| 197 | art_cc_test { |
| 198 | name: "art_standalone_odrefresh_tests", |
| 199 | defaults: [ |
| 200 | "art_standalone_gtest_defaults", |
| 201 | "art_odrefresh_tests_defaults", |
| 202 | ], |
Jiakai Zhang | ccbcfb1 | 2021-08-23 15:10:35 +0000 | [diff] [blame] | 203 | shared_libs: [ |
| 204 | "libdexfile", |
| 205 | ], |
| 206 | test_config_template: "art_odrefresh_tests.xml", |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 207 | } |
| 208 | |
Orion Hodson | baf563d | 2021-04-08 07:53:54 +0100 | [diff] [blame] | 209 | genrule { |
| 210 | name: "statslog_odrefresh.h", |
| 211 | tools: ["stats-log-api-gen"], |
| 212 | cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_odrefresh.h --module art --namespace art,metrics,statsd", |
| 213 | out: [ |
| 214 | "statslog_odrefresh.h", |
| 215 | ], |
| 216 | } |
| 217 | |
| 218 | genrule { |
| 219 | name: "statslog_odrefresh.cpp", |
| 220 | tools: ["stats-log-api-gen"], |
| 221 | cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_odrefresh.cpp --module art --namespace art,metrics,statsd --importHeader statslog_odrefresh.h", |
| 222 | out: [ |
| 223 | "statslog_odrefresh.cpp", |
| 224 | ], |
| 225 | } |
| 226 | |
Orion Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 227 | xsd_config { |
| 228 | name: "art-apex-cache-info", |
| 229 | srcs: ["CacheInfo.xsd"], |
| 230 | package_name: "com.android.art", |
| 231 | api_dir: "schema", |
| 232 | gen_writer: true, |
Sorin Basca | 1e7faf7 | 2021-05-27 13:05:22 +0000 | [diff] [blame] | 233 | tinyxml: true, |
Orion Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 234 | } |