1//
2// Copyright (C) 2018 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_headers {
18    name: "libfiemap_headers",
19    recovery_available: true,
20    export_include_dirs: ["include"],
21}
22
23filegroup {
24    name: "libfiemap_srcs",
25    srcs: [
26        "fiemap_writer.cpp",
27        "fiemap_status.cpp",
28        "image_manager.cpp",
29        "metadata.cpp",
30        "split_fiemap_writer.cpp",
31        "utility.cpp",
32    ],
33}
34
35filegroup {
36    name: "libfiemap_binder_srcs",
37    srcs: [
38        "binder.cpp",
39    ],
40}
41
42cc_defaults {
43    name: "libfiemap_binder_defaults",
44    srcs: [":libfiemap_binder_srcs"],
45    whole_static_libs: [
46        "gsi_aidl_interface-cpp",
47        "libgsi",
48        "libgsid",
49    ],
50    shared_libs: [
51        "libbinder",
52        "libutils",
53    ],
54}
55
56// Open up a passthrough IImageManager interface. Use libfiemap_binder whenever
57// possible. This should only be used when binder is not available.
58filegroup {
59    name: "libfiemap_passthrough_srcs",
60    srcs: [
61        "passthrough.cpp",
62    ],
63}
64
65cc_test {
66    name: "fiemap_writer_test",
67    static_libs: [
68        "libbase",
69        "libdm",
70        "libfs_mgr",
71        "liblog",
72        "libgsi",
73    ],
74
75    data: [
76        "testdata/unaligned_file",
77        "testdata/file_4k",
78        "testdata/file_32k",
79    ],
80
81    srcs: [
82        "fiemap_writer_test.cpp",
83    ],
84
85    test_suites: ["vts", "device-tests"],
86    auto_gen_config: true,
87    test_min_api_level: 29,
88    require_root: true,
89}
90
91cc_test {
92    name: "fiemap_image_test",
93    static_libs: [
94        "libcrypto_utils",
95        "libdm",
96        "libext4_utils",
97        "libfs_mgr",
98        "liblp",
99    ],
100    shared_libs: [
101        "libbase",
102        "libcrypto",
103        "libcutils",
104        "liblog",
105    ],
106    srcs: [
107        "image_test.cpp",
108    ],
109    test_suites: ["device-tests"],
110    auto_gen_config: true,
111    require_root: true,
112}
113
114/* BUG(148874852) temporary test */
115cc_test {
116    name: "fiemap_image_test_presubmit",
117    cppflags: [
118        "-DSKIP_TEST_IN_PRESUBMIT",
119    ],
120    static_libs: [
121        "libcrypto_utils",
122        "libdm",
123        "libext4_utils",
124        "libfs_mgr",
125        "liblp",
126    ],
127    shared_libs: [
128        "libbase",
129        "libcrypto",
130        "libcutils",
131        "liblog",
132    ],
133    srcs: [
134        "image_test.cpp",
135    ],
136    test_suites: ["device-tests"],
137    auto_gen_config: true,
138    require_root: true,
139}
140