1//
2// Copyright (C) 2019 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
17cc_library_static {
18    name: "libfs_avb",
19    defaults: ["fs_mgr_defaults"],
20    recovery_available: true,
21    host_supported: true,
22    export_include_dirs: ["include"],
23    srcs: [
24        "avb_ops.cpp",
25        "avb_util.cpp",
26        "fs_avb.cpp",
27        "fs_avb_util.cpp",
28        "types.cpp",
29        "util.cpp",
30    ],
31    static_libs: [
32        "libavb",
33        "libdm",
34        "libgsi",
35        "libfstab",
36    ],
37    export_static_lib_headers: [
38        "libfstab",
39    ],
40    shared_libs: [
41        "libbase",
42        "libcrypto",
43    ],
44    target: {
45        darwin: {
46            enabled: false,
47        },
48    },
49}
50
51cc_defaults {
52    name: "libfs_avb_host_test_defaults",
53    required: [
54        "avbtool",
55    ],
56    data: [
57        "tests/data/*",
58    ],
59    static_libs: [
60        "libavb",
61        "libavb_host_sysdeps",
62        "libdm",
63        "libext2_uuid",
64        "libfs_avb",
65        "libfstab",
66        "libgtest_host",
67    ],
68    shared_libs: [
69        "libbase",
70        "libchrome",
71    ],
72    target: {
73        darwin: {
74            enabled: false,
75        },
76    },
77    cflags: [
78        "-DHOST_TEST",
79    ],
80}
81
82cc_library_host_static {
83    name: "libfs_avb_test_util",
84    defaults: ["libfs_avb_host_test_defaults"],
85    srcs: [
86        "tests/fs_avb_test_util.cpp",
87    ],
88}
89
90cc_test_host {
91    name: "libfs_avb_test",
92    defaults: ["libfs_avb_host_test_defaults"],
93    test_suites: ["general-tests"],
94    static_libs: [
95        "libfs_avb_test_util",
96    ],
97    shared_libs: [
98        "libcrypto",
99    ],
100    srcs: [
101        "tests/basic_test.cpp",
102        "tests/fs_avb_test.cpp",
103        "tests/fs_avb_util_test.cpp",
104    ],
105}
106
107cc_test_host {
108    name: "libfs_avb_internal_test",
109    defaults: ["libfs_avb_host_test_defaults"],
110    test_suites: ["general-tests"],
111    static_libs: [
112        "libfs_avb_test_util",
113    ],
114    srcs: [
115        "avb_util.cpp",
116        "util.cpp",
117        "tests/avb_util_test.cpp",
118        "tests/util_test.cpp",
119    ],
120}
121
122cc_test {
123    name: "libfs_avb_device_test",
124    test_suites: ["device-tests"],
125    require_root: true,
126    static_libs: [
127        "libavb",
128        "libdm",
129        "libfs_avb",
130        "libfstab",
131    ],
132    shared_libs: [
133        "libbase",
134        "libcrypto",
135    ],
136    srcs: [
137        "tests/fs_avb_device_test.cpp",
138    ],
139    cflags: [
140        "-Wall",
141        "-Wextra",
142        "-Werror",
143    ],
144}
145