| // |
| // Copyright (C) 2020 The Android Open Source Project |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| // |
| |
| package { |
| // See: http://go/android-license-faq |
| // A large-scale-change added 'default_applicable_licenses' to import |
| // all of the 'license_kinds' from "art_license" |
| // to get the below license kinds: |
| // SPDX-license-identifier-Apache-2.0 |
| default_applicable_licenses: ["art_license"], |
| } |
| |
| cc_defaults { |
| name: "odrefresh-defaults", |
| srcs: [ |
| "odrefresh.cc", |
| "odr_common.cc", |
| "odr_compilation_log.cc", |
| "odr_fs_utils.cc", |
| "odr_metrics.cc", |
| "odr_metrics_record.cc", |
| ], |
| local_include_dirs: ["include"], |
| header_libs: ["dexoptanalyzer_headers"], |
| generated_sources: [ |
| "apex-info-list-tinyxml", |
| "art-apex-cache-info", |
| "art-odrefresh-operator-srcs", |
| ], |
| shared_libs: [ |
| "libbase", |
| "liblog", |
| "libselinux", |
| ], |
| static_libs: [ |
| "libmodules-utils-build", |
| ], |
| tidy: true, |
| tidy_disabled_srcs: [":art-apex-cache-info"], |
| tidy_flags: [ |
| "-format-style=file", |
| "-header-filter=(art/odrefresh/|system/apex/)", |
| ], |
| } |
| |
| cc_defaults { |
| name: "odrefresh_binary_defaults", |
| defaults: [ |
| "art_defaults", |
| "odrefresh-defaults", |
| ], |
| srcs: ["odrefresh_main.cc"], |
| shared_libs: [ |
| "libarttools", // Contains "libc++fs". |
| "libdexfile", |
| ], |
| target: { |
| android: { |
| compile_multilib: "first", |
| }, |
| }, |
| } |
| |
| cc_library_headers { |
| name: "odrefresh_headers", |
| defaults: ["art_defaults"], |
| export_include_dirs: ["include"], |
| host_supported: true, |
| stl: "none", |
| system_shared_libs: [], |
| sdk_version: "minimum", // The minimum sdk version required by users of this module. |
| apex_available: [ |
| "//apex_available:platform", // For odsign. |
| ], |
| visibility: ["//visibility:public"], |
| } |
| |
| gensrcs { |
| name: "art-odrefresh-operator-srcs", |
| cmd: "$(location generate_operator_out) art/odrefresh $(in) > $(out)", |
| tools: ["generate_operator_out"], |
| srcs: [ |
| "odr_metrics.h", |
| ], |
| output_extension: "operator_out.cc", |
| } |
| |
| art_cc_binary { |
| name: "odrefresh", |
| defaults: ["odrefresh_binary_defaults"], |
| required: [ |
| "dexoptanalyzer", |
| "dex2oat", |
| ], |
| shared_libs: [ |
| "libart", |
| "libartbase", |
| ], |
| apex_available: [ |
| "com.android.art", |
| "com.android.art.debug", |
| "test_broken_com.android.art", |
| ], |
| } |
| |
| // A no-op version of the odrefresh binary. |
| art_cc_binary { |
| name: "odrefresh_broken", |
| defaults: ["art_defaults"], |
| stem: "odrefresh", |
| local_include_dirs: ["include"], |
| header_libs: ["libbase_headers"], |
| srcs: ["odrefresh_broken.cc"], |
| installable: false, |
| apex_available: ["test_jitzygote_com.android.art"], |
| } |
| |
| art_cc_binary { |
| name: "odrefreshd", |
| defaults: [ |
| "art_debug_defaults", |
| "odrefresh_binary_defaults", |
| ], |
| required: [ |
| "dexoptanalyzerd", |
| "dex2oatd", |
| ], |
| shared_libs: [ |
| "libartd", |
| "libartbased", |
| ], |
| apex_available: [ |
| "com.android.art.debug", |
| // TODO(b/183882457): This binary doesn't go into com.android.art, but |
| // apex_available lists need to be the same for internal libs to avoid |
| // stubs, and this depends on libartd. |
| "com.android.art", |
| "test_broken_com.android.art", |
| ], |
| } |
| |
| cc_library_static { |
| name: "libodrstatslog", |
| defaults: ["art_defaults"], |
| host_supported: true, |
| export_include_dirs: ["include"], |
| local_include_dirs: ["include"], |
| header_libs: ["libart_headers"], |
| shared_libs: ["libartbase"], |
| target: { |
| android: { |
| generated_headers: ["statslog_odrefresh.h"], |
| generated_sources: ["statslog_odrefresh.cpp"], |
| srcs: [ |
| "odr_metrics_record.cc", |
| "odr_statslog_android.cc", |
| ], |
| shared_libs: [ |
| "libstatspull", |
| "libstatssocket", |
| ], |
| }, |
| host: { |
| srcs: ["odr_statslog_host.cc"], |
| }, |
| }, |
| apex_available: [ |
| "com.android.art", |
| "com.android.art.debug", |
| ], |
| } |
| |
| art_cc_defaults { |
| name: "art_odrefresh_tests_defaults", |
| defaults: ["odrefresh-defaults"], |
| header_libs: ["odrefresh_headers"], |
| srcs: [ |
| "odr_artifacts_test.cc", |
| "odr_common_test.cc", |
| "odr_compilation_log_test.cc", |
| "odr_fs_utils_test.cc", |
| "odr_metrics_test.cc", |
| "odr_metrics_record_test.cc", |
| "odrefresh_test.cc", |
| ], |
| static_libs: [ |
| "libgmock", |
| ], |
| } |
| |
| // Version of ART gtest `art_odrefresh_tests` bundled with the ART APEX on target. |
| // TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. |
| art_cc_test { |
| name: "art_odrefresh_tests", |
| defaults: [ |
| "art_gtest_defaults", |
| "art_odrefresh_tests_defaults", |
| ], |
| host_supported: false, |
| shared_libs: [ |
| "libarttools", |
| ], |
| // The test config template is needed even though it's not used by the test |
| // runner. Otherwise, Soong will generate a test config, which is adding |
| // `art-host-test` as a test tag, while this test does not support running |
| // on host. |
| // TODO(b/214016626): Remove this line once the bug is fixed. |
| test_config_template: "//art/test:art-gtests-target-standalone-template", |
| } |
| |
| // Standalone version of ART gtest `art_odrefresh_tests`, not bundled with the ART APEX on target. |
| art_cc_test { |
| name: "art_standalone_odrefresh_tests", |
| defaults: [ |
| "art_standalone_gtest_defaults", |
| "art_odrefresh_tests_defaults", |
| ], |
| static_libs: [ |
| "libarttools", |
| ], |
| } |
| |
| genrule { |
| name: "statslog_odrefresh.h", |
| tools: ["stats-log-api-gen"], |
| cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_odrefresh.h --module art --namespace art,metrics,statsd", |
| out: [ |
| "statslog_odrefresh.h", |
| ], |
| } |
| |
| genrule { |
| name: "statslog_odrefresh.cpp", |
| tools: ["stats-log-api-gen"], |
| cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_odrefresh.cpp --module art --namespace art,metrics,statsd --importHeader statslog_odrefresh.h", |
| out: [ |
| "statslog_odrefresh.cpp", |
| ], |
| } |
| |
| xsd_config { |
| name: "art-apex-cache-info", |
| srcs: ["CacheInfo.xsd"], |
| package_name: "com.android.art", |
| api_dir: "schema", |
| gen_writer: true, |
| tinyxml: true, |
| } |