| 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 | }, |
| 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 Hsieh | e4b7d43 | 2021-02-25 20:51:43 -0800 | [diff] [blame] | 68 | "-format-style=file", |
| 69 | "-header-filter=(art/odrefresh/|system/apex/)", |
| Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 70 | ], |
| 71 | } |
| 72 | |
| 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", |
| 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 | |
| 114 | art_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 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"], |
| 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 Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 165 | art_cc_test { |
| 166 | name: "art_odrefresh_tests", |
| 167 | defaults: [ |
| 168 | "art_gtest_defaults", |
| 169 | ], |
| Orion Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 170 | generated_sources: ["art-odrefresh-operator-srcs"], |
| Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 171 | header_libs: ["odrefresh_headers"], |
| 172 | srcs: [ |
| 173 | "odr_artifacts_test.cc", |
| Orion Hodson | f96c916 | 2021-04-07 10:43:01 +0100 | [diff] [blame] | 174 | "odr_fs_utils.cc", |
| 175 | "odr_fs_utils_test.cc", |
| Orion Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 176 | "odr_metrics.cc", |
| 177 | "odr_metrics_test.cc", |
| 178 | "odr_metrics_record.cc", |
| 179 | "odr_metrics_record_test.cc", |
| Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 180 | "odrefresh_test.cc", |
| 181 | ], |
| Orion Hodson | 957fb15 | 2021-04-08 07:52:15 +0100 | [diff] [blame] | 182 | shared_libs: ["libbase"], |
| Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 183 | } |
| Orion Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 184 | |
| Orion Hodson | baf563d | 2021-04-08 07:53:54 +0100 | [diff] [blame^] | 185 | genrule { |
| 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 | |
| 194 | genrule { |
| 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 Hodson | 947a850 | 2021-03-08 15:40:09 +0000 | [diff] [blame] | 203 | xsd_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 | } |