• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "frameworks_native_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    default_applicable_licenses: ["frameworks_native_license"],
8}
9
10cc_defaults {
11    name: "installd_defaults",
12
13    cflags: [
14        "-Wall",
15        "-Werror",
16        "-Wextra",
17
18        "-Wunreachable-code",
19        "-Wunreachable-code-break",
20        "-Wunreachable-code-return",
21    ],
22    srcs: [
23        "CacheItem.cpp",
24        "CacheTracker.cpp",
25        "CrateManager.cpp",
26        "InstalldNativeService.cpp",
27        "QuotaUtils.cpp",
28        "SysTrace.cpp",
29        "dexopt.cpp",
30        "execv_helper.cpp",
31        "globals.cpp",
32        "restorable_file.cpp",
33        "run_dex2oat.cpp",
34        "unique_file.cpp",
35        "utils.cpp",
36        "utils_default.cpp",
37        ":installd_aidl",
38    ],
39    shared_libs: [
40        "libbase",
41        "libbinder",
42        "libcrypto",
43        "libcutils",
44        "liblog",
45        "liblogwrap",
46        "libprocessgroup",
47        "libselinux",
48        "libutils",
49        "libziparchive",
50        "server_configurable_flags",
51    ],
52    static_libs: [
53        "libasync_safe",
54        "libext2_uuid",
55    ],
56    export_shared_lib_headers: [
57        "libbinder",
58    ],
59
60    product_variables: {
61        arc: {
62            exclude_srcs: [
63                "QuotaUtils.cpp",
64            ],
65            static_libs: [
66                "libarcdiskquota",
67                "arc_services_aidl",
68            ],
69            cflags: [
70                "-DUSE_ARC",
71            ],
72        },
73    },
74
75    tidy: true,
76    tidy_checks: [
77        "-*",
78        "clang-analyzer-security*",
79        "cert-*",
80        "-cert-err58-cpp",
81    ],
82    tidy_checks_as_errors: [
83        "clang-analyzer-security*",
84        "cert-*",
85    ],
86}
87
88//
89// Static library used in testing and executable
90//
91
92cc_library_static {
93    name: "libinstalld",
94    defaults: ["installd_defaults"],
95
96    export_include_dirs: ["."],
97    aidl: {
98        export_aidl_headers: true,
99    },
100
101    product_variables: {
102        arc: {
103            exclude_srcs: [
104                "QuotaUtils.cpp",
105            ],
106            static_libs: [
107                "libarcdiskquota",
108                "arc_services_aidl",
109            ],
110            cflags: [
111                "-DUSE_ARC",
112            ],
113        },
114    },
115}
116
117cc_library_headers {
118    name: "libinstalld_headers",
119    export_include_dirs: ["."],
120}
121
122//
123// Unit tests
124//
125
126cc_test_host {
127    name: "run_dex2oat_test",
128    test_suites: ["general-tests"],
129    srcs: [
130        "run_dex2oat_test.cpp",
131        "run_dex2oat.cpp",
132        "unique_file.cpp",
133        "execv_helper.cpp",
134    ],
135    cflags: [
136        "-Wall",
137        "-Werror",
138    ],
139    shared_libs: [
140        "libbase",
141        "server_configurable_flags",
142    ],
143    test_config: "run_dex2oat_test.xml",
144}
145
146//
147// Executable
148//
149
150cc_binary {
151    name: "installd",
152    defaults: ["installd_defaults"],
153    srcs: ["installd.cpp"],
154
155    static_libs: ["libdiskusage"],
156
157    init_rc: ["installd.rc"],
158
159    product_variables: {
160        arc: {
161            exclude_srcs: [
162                "QuotaUtils.cpp",
163            ],
164            static_libs: [
165                "libarcdiskquota",
166                "arc_services_aidl",
167            ],
168            cflags: [
169                "-DUSE_ARC",
170            ],
171        },
172    },
173
174    // Needs to be wherever installd is as it's execed by
175    // installd.
176    required: ["migrate_legacy_obb_data"],
177}
178
179// OTA chroot tool
180
181cc_binary {
182    name: "otapreopt_chroot",
183    defaults: ["libapexd-deps"],
184    cflags: [
185        "-Wall",
186        "-Werror",
187    ],
188
189    srcs: [
190        "otapreopt_chroot.cpp",
191        "otapreopt_utils.cpp",
192    ],
193    shared_libs: [
194        "libbase",
195        "liblog",
196        "libutils",
197    ],
198    required: [
199        "apexd",
200    ],
201}
202
203filegroup {
204    name: "installd_aidl",
205    srcs: [
206        "binder/**/*.aidl",
207    ],
208    path: "binder",
209}
210
211//
212// Static library for otapreopt used in testing
213//
214cc_library_static {
215    name: "libotapreoptparameters",
216    cflags: [
217        "-Wall",
218        "-Werror",
219    ],
220
221    srcs: ["otapreopt_parameters.cpp"],
222
223    export_include_dirs: ["."],
224
225    shared_libs: [
226        "libbase",
227        "libcutils",
228        "liblog",
229        "libprocessgroup",
230        "libutils",
231    ],
232}
233
234//
235//  OTA Executable
236//
237
238cc_binary {
239    name: "otapreopt",
240    cflags: [
241        "-Wall",
242        "-Werror",
243    ],
244
245    srcs: [
246        "dexopt.cpp",
247        "execv_helper.cpp",
248        "globals.cpp",
249        "otapreopt.cpp",
250        "otapreopt_utils.cpp",
251        "restorable_file.cpp",
252        "run_dex2oat.cpp",
253        "unique_file.cpp",
254        "utils.cpp",
255        "utils_default.cpp",
256    ],
257
258    static_libs: [
259        "libasync_safe",
260        "libdiskusage",
261        "libotapreoptparameters",
262        "libext2_uuid",
263    ],
264
265    shared_libs: [
266        "libbase",
267        "libcrypto",
268        "libcutils",
269        "liblog",
270        "liblogwrap",
271        "libprocessgroup",
272        "libselinux",
273        "libutils",
274        "libziparchive",
275        "server_configurable_flags",
276    ],
277}
278
279// OTA slot script
280sh_binary {
281    name: "otapreopt_slot",
282    src: "otapreopt_slot.sh",
283    init_rc: ["otapreopt.rc"],
284}
285
286// OTA postinstall script
287sh_binary {
288    name: "otapreopt_script",
289    src: "otapreopt_script.sh",
290    // Let this depend on otapreopt, the chroot tool and the slot script,
291    // so we just have to mention one in a configuration.
292    required: [
293        "otapreopt",
294        "otapreopt_chroot",
295        "otapreopt_slot",
296    ],
297}
298
299// Script to migrate legacy obb data.
300sh_binary {
301    name: "migrate_legacy_obb_data",
302    src: "migrate_legacy_obb_data.sh",
303}
304