blob: bd788f5a94e8102bdf14a9753038c678d3b98edd [file] [log] [blame]
//
// Copyright (C) 2018 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.
//
cc_defaults {
name: "libsnapshot_defaults",
defaults: ["fs_mgr_defaults"],
cflags: [
"-D_FILE_OFFSET_BITS=64",
"-Wall",
"-Werror",
],
shared_libs: [
"libbase",
"libcutils",
"liblog",
"liblp",
],
static_libs: [
"libdm",
"libfstab",
"update_metadata-protos",
],
whole_static_libs: [
"libext2_uuid",
"libext4_utils",
"libfstab",
],
header_libs: [
"libfiemap_headers",
],
export_static_lib_headers: [
"update_metadata-protos",
],
export_header_lib_headers: [
"libfiemap_headers",
],
export_include_dirs: ["include"],
proto: {
type: "lite",
export_proto_headers: true,
canonical_path_from_root: false,
},
}
cc_defaults {
name: "libsnapshot_hal_deps",
cflags: [
"-DLIBSNAPSHOT_USE_HAL",
],
shared_libs: [
"android.hardware.boot@1.0",
"android.hardware.boot@1.1",
],
}
filegroup {
name: "libsnapshot_sources",
srcs: [
"android/snapshot/snapshot.proto",
"device_info.cpp",
"snapshot.cpp",
"snapshot_stats.cpp",
"snapshot_metadata_updater.cpp",
"partition_cow_creator.cpp",
"return.cpp",
"utility.cpp",
],
}
cc_library_headers {
name: "libsnapshot_headers",
recovery_available: true,
defaults: ["libsnapshot_defaults"],
}
cc_library_static {
name: "libsnapshot",
defaults: [
"libsnapshot_defaults",
"libsnapshot_hal_deps",
],
srcs: [":libsnapshot_sources"],
static_libs: [
"libfs_mgr_binder"
],
}
cc_library_static {
name: "libsnapshot_init",
defaults: ["libsnapshot_defaults"],
srcs: [":libsnapshot_sources"],
recovery_available: true,
static_libs: [
"libfs_mgr",
],
}
cc_library_static {
name: "libsnapshot_nobinder",
defaults: [
"libsnapshot_defaults",
"libsnapshot_hal_deps",
],
srcs: [":libsnapshot_sources"],
recovery_available: true,
static_libs: [
"libfs_mgr",
],
}
cc_library_static {
name: "libsnapshot_test_helpers",
defaults: ["libsnapshot_defaults"],
export_include_dirs: [
"include_test",
],
srcs: [
"android/snapshot/snapshot.proto",
"test_helpers.cpp",
],
shared_libs: [
"android.hardware.boot@1.1",
"libcrypto",
],
export_shared_lib_headers: [
"android.hardware.boot@1.1",
],
header_libs: [
"libstorage_literals_headers",
],
export_header_lib_headers: [
"libstorage_literals_headers",
],
static_libs: [
"libfs_mgr",
"libgmock",
"libgtest",
],
}
cc_defaults {
name: "libsnapshot_test_defaults",
defaults: ["libsnapshot_defaults"],
srcs: [
"partition_cow_creator_test.cpp",
"snapshot_metadata_updater_test.cpp",
"snapshot_test.cpp",
],
shared_libs: [
"android.hardware.boot@1.0",
"android.hardware.boot@1.1",
"libbinder",
"libcrypto",
"libhidlbase",
"libprotobuf-cpp-lite",
"libsparse",
"libutils",
"libz",
],
static_libs: [
"libfs_mgr",
"libgsi",
"libgmock",
"liblp",
"libsnapshot",
"libsnapshot_test_helpers",
],
header_libs: [
"libstorage_literals_headers",
],
test_suites: [
"vts",
"device-tests"
],
test_min_api_level: 29,
auto_gen_config: true,
require_root: true,
}
cc_test {
name: "vts_libsnapshot_test",
defaults: ["libsnapshot_test_defaults"],
}
// For VTS 10
vts_config {
name: "VtsLibsnapshotTest",
test_config: "VtsLibsnapshotTest.xml"
}
cc_binary {
name: "snapshotctl",
srcs: [
"snapshotctl.cpp",
],
static_libs: [
"libfstab",
"libsnapshot",
"update_metadata-protos",
],
shared_libs: [
"android.hardware.boot@1.0",
"android.hardware.boot@1.1",
"libbase",
"libbinder",
"libext2_uuid",
"libext4_utils",
"libfs_mgr_binder",
"libhidlbase",
"liblog",
"liblp",
"libprotobuf-cpp-lite",
"libstatslog",
"libutils",
],
}
cc_test {
name: "snapshot_power_test",
srcs: [
"power_test.cpp",
],
static_libs: [
"libsnapshot",
"update_metadata-protos",
],
shared_libs: [
"libbase",
"libfs_mgr_binder",
"liblog",
],
gtest: false,
}