• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17package {
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 "system_core_fs_mgr_license"
21    // to get the below license kinds:
22    //   SPDX-license-identifier-Apache-2.0
23    //   SPDX-license-identifier-MIT
24    default_applicable_licenses: ["system_core_fs_mgr_license"],
25}
26
27cc_library_static {
28    name: "libfs_avb",
29    defaults: ["fs_mgr_defaults"],
30    recovery_available: true,
31    host_supported: true,
32    export_include_dirs: ["include"],
33    srcs: [
34        "avb_ops.cpp",
35        "avb_util.cpp",
36        "fs_avb.cpp",
37        "fs_avb_util.cpp",
38        "types.cpp",
39        "util.cpp",
40    ],
41    static_libs: [
42        "libavb",
43        "libdm",
44        "libgsi",
45        "libfstab",
46    ],
47    export_static_lib_headers: [
48        "libfstab",
49    ],
50    shared_libs: [
51        "libbase",
52        "libcrypto",
53    ],
54    target: {
55        darwin: {
56            enabled: false,
57        },
58    },
59}
60
61cc_defaults {
62    name: "libfs_avb_host_test_defaults",
63    required: [
64        "avbtool",
65    ],
66    data: [
67        "tests/data/*",
68    ],
69    static_libs: [
70        "libavb",
71        "libavb_host_sysdeps",
72        "libdm",
73        "libext2_uuid",
74        "libfs_avb",
75        "libfstab",
76        "libgtest_host",
77    ],
78    shared_libs: [
79        "libbase",
80        "libchrome",
81        "libcrypto",
82    ],
83    target: {
84        darwin: {
85            enabled: false,
86        },
87    },
88    cflags: [
89        "-DHOST_TEST",
90    ],
91}
92
93cc_library_host_static {
94    name: "libfs_avb_test_util",
95    defaults: ["libfs_avb_host_test_defaults"],
96    srcs: [
97        "tests/fs_avb_test_util.cpp",
98    ],
99}
100
101cc_test_host {
102    name: "libfs_avb_test",
103    defaults: ["libfs_avb_host_test_defaults"],
104    test_suites: ["general-tests"],
105    test_options: {
106        unit_test: true,
107    },
108    static_libs: [
109        "libfs_avb_test_util",
110    ],
111    compile_multilib: "first",
112    data: [
113        ":avbtool",
114        ":fec",
115    ],
116    srcs: [
117        "tests/basic_test.cpp",
118        "tests/fs_avb_test.cpp",
119        "tests/fs_avb_util_test.cpp",
120    ],
121}
122
123cc_test_host {
124    name: "libfs_avb_internal_test",
125    defaults: ["libfs_avb_host_test_defaults"],
126    test_suites: ["general-tests"],
127    test_options: {
128        unit_test: true,
129    },
130    static_libs: [
131        "libfs_avb_test_util",
132    ],
133    compile_multilib: "first",
134    data: [
135        ":avbtool",
136        ":fec",
137    ],
138    srcs: [
139        "avb_util.cpp",
140        "util.cpp",
141        "tests/avb_util_test.cpp",
142        "tests/util_test.cpp",
143    ],
144}
145
146cc_test {
147    name: "libfs_avb_device_test",
148    test_suites: ["device-tests"],
149    require_root: true,
150    static_libs: [
151        "libavb",
152        "libdm",
153        "libfs_avb",
154        "libfstab",
155    ],
156    shared_libs: [
157        "libbase",
158        "libcrypto",
159    ],
160    srcs: [
161        "tests/fs_avb_device_test.cpp",
162    ],
163    cflags: [
164        "-Wall",
165        "-Wextra",
166        "-Werror",
167    ],
168}
169