2015-07-29 00:46:36 +02:00
|
|
|
# Copyright (C) 2015 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.
|
|
|
|
|
|
|
|
LOCAL_PATH := $(call my-dir)
|
|
|
|
|
|
|
|
metrics_cpp_extension := .cc
|
|
|
|
libmetrics_sources := \
|
|
|
|
c_metrics_library.cc \
|
|
|
|
metrics_library.cc \
|
|
|
|
serialization/metric_sample.cc \
|
2015-09-15 20:40:47 +02:00
|
|
|
serialization/serialization_utils.cc \
|
|
|
|
timer.cc
|
2015-07-29 00:46:36 +02:00
|
|
|
|
|
|
|
metrics_client_sources := \
|
|
|
|
metrics_client.cc
|
|
|
|
|
2015-10-03 01:45:18 +02:00
|
|
|
metrics_daemon_common := \
|
2015-09-29 20:07:24 +02:00
|
|
|
collectors/averaged_statistics_collector.cc \
|
2015-09-18 22:38:10 +02:00
|
|
|
collectors/disk_usage_collector.cc \
|
2015-07-29 00:46:36 +02:00
|
|
|
metrics_daemon.cc \
|
|
|
|
persistent_integer.cc \
|
2015-10-03 01:45:18 +02:00
|
|
|
serialization/metric_sample.cc \
|
|
|
|
serialization/serialization_utils.cc \
|
2015-07-29 00:46:36 +02:00
|
|
|
uploader/metrics_hashes.cc \
|
|
|
|
uploader/metrics_log_base.cc \
|
|
|
|
uploader/metrics_log.cc \
|
|
|
|
uploader/sender_http.cc \
|
|
|
|
uploader/system_profile_cache.cc \
|
|
|
|
uploader/upload_service.cc \
|
|
|
|
|
2015-08-31 20:11:57 +02:00
|
|
|
metrics_tests_sources := \
|
2015-09-29 20:07:24 +02:00
|
|
|
collectors/averaged_statistics_collector_test.cc \
|
2015-08-31 20:11:57 +02:00
|
|
|
metrics_daemon_test.cc \
|
|
|
|
metrics_library_test.cc \
|
|
|
|
persistent_integer_test.cc \
|
|
|
|
serialization/serialization_utils_unittest.cc \
|
|
|
|
timer_test.cc \
|
|
|
|
uploader/metrics_hashes_unittest.cc \
|
|
|
|
uploader/metrics_log_base_unittest.cc \
|
|
|
|
uploader/mock/sender_mock.cc \
|
|
|
|
uploader/upload_service_test.cc \
|
|
|
|
|
2015-07-29 00:46:36 +02:00
|
|
|
metrics_CFLAGS := -Wall \
|
|
|
|
-Wno-char-subscripts \
|
|
|
|
-Wno-missing-field-initializers \
|
|
|
|
-Wno-unused-function \
|
|
|
|
-Wno-unused-parameter \
|
|
|
|
-Werror \
|
|
|
|
-fvisibility=default
|
|
|
|
metrics_CPPFLAGS := -Wno-non-virtual-dtor \
|
|
|
|
-Wno-sign-promo \
|
|
|
|
-Wno-strict-aliasing \
|
|
|
|
-fvisibility=default
|
|
|
|
metrics_includes := external/gtest/include \
|
|
|
|
$(LOCAL_PATH)/include
|
2015-10-27 19:46:37 +01:00
|
|
|
libmetrics_shared_libraries := libchrome libbrillo
|
2015-10-03 01:45:18 +02:00
|
|
|
metrics_daemon_shared_libraries := $(libmetrics_shared_libraries) \
|
2015-10-27 19:46:37 +01:00
|
|
|
libbrillo-http \
|
|
|
|
libbrillo-dbus \
|
2015-10-03 01:45:18 +02:00
|
|
|
libchrome-dbus \
|
|
|
|
libdbus \
|
|
|
|
libmetrics \
|
|
|
|
libprotobuf-cpp-lite \
|
|
|
|
librootdev \
|
2015-10-14 22:26:42 +02:00
|
|
|
libupdate_engine_client \
|
2015-10-10 05:07:47 +02:00
|
|
|
libweaved \
|
2015-07-29 00:46:36 +02:00
|
|
|
|
|
|
|
# Shared library for metrics.
|
|
|
|
# ========================================================
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := libmetrics
|
|
|
|
LOCAL_C_INCLUDES := $(metrics_includes)
|
|
|
|
LOCAL_CFLAGS := $(metrics_CFLAGS)
|
2015-09-08 19:13:35 +02:00
|
|
|
LOCAL_CLANG := true
|
2015-07-29 00:46:36 +02:00
|
|
|
LOCAL_CPP_EXTENSION := $(metrics_cpp_extension)
|
|
|
|
LOCAL_CPPFLAGS := $(metrics_CPPFLAGS)
|
2015-09-23 23:39:35 +02:00
|
|
|
LOCAL_RTTI_FLAG := -frtti
|
2015-07-29 00:46:36 +02:00
|
|
|
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
|
2015-10-03 01:45:18 +02:00
|
|
|
LOCAL_SHARED_LIBRARIES := $(libmetrics_shared_libraries)
|
2015-07-29 00:46:36 +02:00
|
|
|
LOCAL_SRC_FILES := $(libmetrics_sources)
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
|
|
|
|
|
|
|
# CLI client for metrics.
|
|
|
|
# ========================================================
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := metrics_client
|
|
|
|
LOCAL_C_INCLUDES := $(metrics_includes)
|
|
|
|
LOCAL_CFLAGS := $(metrics_CFLAGS)
|
2015-09-08 19:13:35 +02:00
|
|
|
LOCAL_CLANG := true
|
2015-07-29 00:46:36 +02:00
|
|
|
LOCAL_CPP_EXTENSION := $(metrics_cpp_extension)
|
|
|
|
LOCAL_CPPFLAGS := $(metrics_CPPFLAGS)
|
2015-10-03 01:45:18 +02:00
|
|
|
LOCAL_SHARED_LIBRARIES := $(libmetrics_shared_libraries) \
|
2015-07-29 00:46:36 +02:00
|
|
|
libmetrics
|
|
|
|
LOCAL_SRC_FILES := $(metrics_client_sources)
|
|
|
|
include $(BUILD_EXECUTABLE)
|
|
|
|
|
|
|
|
# Protobuf library for metrics_daemon.
|
|
|
|
# ========================================================
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := metrics_daemon_protos
|
|
|
|
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
|
|
|
|
generated_sources_dir := $(call local-generated-sources-dir)
|
|
|
|
LOCAL_EXPORT_C_INCLUDE_DIRS += \
|
|
|
|
$(generated_sources_dir)/proto/system/core/metricsd
|
|
|
|
LOCAL_SRC_FILES := $(call all-proto-files-under,uploader/proto)
|
|
|
|
include $(BUILD_STATIC_LIBRARY)
|
|
|
|
|
|
|
|
# metrics daemon.
|
|
|
|
# ========================================================
|
|
|
|
include $(CLEAR_VARS)
|
2015-09-28 20:31:58 +02:00
|
|
|
LOCAL_MODULE := metrics_daemon
|
2015-10-27 19:46:37 +01:00
|
|
|
LOCAL_C_INCLUDES := $(metrics_includes)
|
2015-07-29 00:46:36 +02:00
|
|
|
LOCAL_CFLAGS := $(metrics_CFLAGS)
|
|
|
|
LOCAL_CPP_EXTENSION := $(metrics_cpp_extension)
|
|
|
|
LOCAL_CPPFLAGS := $(metrics_CPPFLAGS)
|
2015-09-28 20:31:58 +02:00
|
|
|
LOCAL_INIT_RC := metrics_daemon.rc
|
2015-10-03 01:45:18 +02:00
|
|
|
LOCAL_REQUIRED_MODULES := \
|
|
|
|
metrics.json \
|
|
|
|
metrics.schema.json \
|
2015-09-08 19:13:35 +02:00
|
|
|
|
2015-10-03 01:45:18 +02:00
|
|
|
LOCAL_RTTI_FLAG := -frtti
|
|
|
|
LOCAL_SHARED_LIBRARIES := $(metrics_daemon_shared_libraries)
|
2015-09-08 19:13:35 +02:00
|
|
|
LOCAL_CLANG := true
|
2015-10-03 01:45:18 +02:00
|
|
|
LOCAL_SRC_FILES := $(metrics_daemon_common) \
|
|
|
|
metrics_daemon_main.cc
|
2015-07-29 00:46:36 +02:00
|
|
|
LOCAL_STATIC_LIBRARIES := metrics_daemon_protos
|
|
|
|
include $(BUILD_EXECUTABLE)
|
2015-08-11 20:45:05 +02:00
|
|
|
|
2015-08-31 20:11:57 +02:00
|
|
|
# Unit tests for metrics.
|
|
|
|
# ========================================================
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := metrics_tests
|
2015-09-29 20:07:24 +02:00
|
|
|
LOCAL_CLANG := true
|
2015-08-31 20:11:57 +02:00
|
|
|
LOCAL_CFLAGS := $(metrics_CFLAGS)
|
|
|
|
LOCAL_CPP_EXTENSION := $(metrics_cpp_extension)
|
|
|
|
LOCAL_CPPFLAGS := $(metrics_CPPFLAGS) -Wno-sign-compare
|
|
|
|
LOCAL_RTTI_FLAG := -frtti
|
2015-10-03 01:45:18 +02:00
|
|
|
LOCAL_SHARED_LIBRARIES := $(metrics_daemon_shared_libraries)
|
|
|
|
LOCAL_SRC_FILES := $(metrics_tests_sources) $(metrics_daemon_common)
|
2015-08-31 20:11:57 +02:00
|
|
|
LOCAL_STATIC_LIBRARIES := libBionicGtestMain libgmock metrics_daemon_protos
|
|
|
|
|
|
|
|
include $(BUILD_NATIVE_TEST)
|
2015-10-03 01:45:18 +02:00
|
|
|
|
|
|
|
# Weave schema files
|
|
|
|
# ========================================================
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := metrics.json
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/weaved/commands
|
|
|
|
LOCAL_SRC_FILES := etc/weaved/commands/$(LOCAL_MODULE)
|
|
|
|
include $(BUILD_PREBUILT)
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := metrics.schema.json
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/weaved/states
|
|
|
|
LOCAL_SRC_FILES := etc/weaved/states/$(LOCAL_MODULE)
|
|
|
|
include $(BUILD_PREBUILT)
|