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