blob: eaba77047835558bea8e47b46f51a0932a6cdf13 [file] [log] [blame]
Bob Badour601ebb42021-02-03 23:07:40 -08001package {
2 // http://go/android-license-faq
3 // A large-scale-change added 'default_applicable_licenses' to import
4 // the below license kinds from "system_sepolicy_license":
5 // SPDX-license-identifier-Apache-2.0
6 default_applicable_licenses: ["system_sepolicy_license"],
7}
8
Jeff Vander Stoepbdfc0302017-05-25 09:53:47 -07009cc_library_host_shared {
10 name: "libsepolwrap",
11 srcs: ["sepol_wrap.cpp"],
Inseob Kimff2018f2024-04-17 09:48:43 +090012 cflags: [
13 "-Wall",
14 "-Werror",
15 ],
Jeff Vander Stoepbdfc0302017-05-25 09:53:47 -070016 export_include_dirs: ["include"],
Inseob Kim6fa8efd2021-12-29 13:56:14 +090017 stl: "c++_static",
Dan Willemsen948354a2017-09-01 14:08:46 -070018
19 // libsepolwrap gets loaded from the system python, which does not have the
20 // ASAN runtime. So turn off sanitization for ourself, and use static
21 // libraries, since the shared libraries will use ASAN.
Jeff Vander Stoep3ca843a2017-10-04 09:42:29 -070022 static_libs: [
23 "libbase",
24 "libsepol",
25 ],
Dan Willemsen948354a2017-09-01 14:08:46 -070026 sanitize: {
27 never: true,
28 },
Jeff Vander Stoepbdfc0302017-05-25 09:53:47 -070029}
Jeff Vander Stoep1fc06822017-05-31 15:36:07 -070030
Inseob Kimcbc95ea2022-01-21 19:32:53 +090031python_library_host {
32 name: "mini_cil_parser",
33 srcs: ["mini_parser.py"],
34}
35
36python_library_host {
37 name: "pysepolwrap",
38 srcs: [
39 "fc_sort.py",
40 "policy.py",
41 ],
42}
43
Jeff Vander Stoepa7d2c5b2017-09-23 14:42:50 -070044python_binary_host {
45 name: "treble_sepolicy_tests",
46 srcs: [
Jeff Vander Stoep370a52f2018-02-08 09:54:59 -080047 "treble_sepolicy_tests.py",
Dan Cashman91d398d2017-09-26 12:58:29 -070048 ],
Inseob Kim4912a242022-07-25 11:30:02 +090049 version: {
50 py3: {
51 embedded_launcher: true,
52 },
53 },
Inseob Kimcbc95ea2022-01-21 19:32:53 +090054 libs: [
55 "mini_cil_parser",
Inseob Kimcbc95ea2022-01-21 19:32:53 +090056 ],
Dan Cashman91d398d2017-09-26 12:58:29 -070057}
58
59python_binary_host {
60 name: "sepolicy_tests",
61 srcs: [
Jeff Vander Stoep370a52f2018-02-08 09:54:59 -080062 "sepolicy_tests.py",
Dan Cashman91d398d2017-09-26 12:58:29 -070063 ],
Inseob Kim4912a242022-07-25 11:30:02 +090064 version: {
65 py3: {
66 embedded_launcher: true,
67 },
68 },
Inseob Kimcbc95ea2022-01-21 19:32:53 +090069 libs: ["pysepolwrap"],
Inseob Kim6fa8efd2021-12-29 13:56:14 +090070 data: [":libsepolwrap"],
Dan Cashman91d398d2017-09-26 12:58:29 -070071}
72
73python_binary_host {
Jooyung Han23d1e622023-04-04 18:03:07 +090074 name: "apex_sepolicy_tests",
75 srcs: [
76 "apex_sepolicy_tests.py",
77 ],
78 version: {
79 py3: {
80 embedded_launcher: true,
81 },
82 },
83 libs: ["pysepolwrap"],
84 data: [
85 ":libsepolwrap",
86 ":precompiled_sepolicy",
87 ],
88}
89
90python_test_host {
91 name: "apex_sepolicy_tests_test",
92 srcs: [
93 "apex_sepolicy_tests.py",
94 "apex_sepolicy_tests_test.py",
95 ],
96 libs: ["pysepolwrap"],
97 data: [
98 ":libsepolwrap",
99 ":precompiled_sepolicy",
100 ],
101 test_options: {
102 unit_test: true,
103 },
Jooyung Han7ba515a2023-04-11 08:30:19 +0900104 version: {
105 py3: {
106 embedded_launcher: true,
107 },
108 },
Jooyung Han23d1e622023-04-04 18:03:07 +0900109}
110
111python_binary_host {
Dan Cashman91d398d2017-09-26 12:58:29 -0700112 name: "searchpolicy",
113 srcs: [
Jeff Vander Stoep3a3756f2018-04-24 11:03:22 -0700114 "searchpolicy.py",
Jeff Vander Stoepa7d2c5b2017-09-23 14:42:50 -0700115 ],
Inseob Kimcbc95ea2022-01-21 19:32:53 +0900116 libs: ["pysepolwrap"],
Jeff Vander Stoepa7d2c5b2017-09-23 14:42:50 -0700117 required: ["libsepolwrap"],
Jeff Vander Stoep1fc06822017-05-31 15:36:07 -0700118}
Tri Vo438684b2018-09-29 17:47:10 -0700119
120python_binary_host {
121 name: "combine_maps",
122 srcs: [
123 "combine_maps.py",
Tri Vo438684b2018-09-29 17:47:10 -0700124 ],
Inseob Kimcbc95ea2022-01-21 19:32:53 +0900125 libs: ["mini_cil_parser"],
Tri Vo438684b2018-09-29 17:47:10 -0700126}
Jeff Vander Stoep1ca7a4c2019-04-10 16:53:17 -0700127
128python_binary_host {
129 name: "fc_sort",
130 srcs: [
131 "fc_sort.py",
132 ],
Jeff Vander Stoep1ca7a4c2019-04-10 16:53:17 -0700133}
Inseob Kim2bcc0452020-12-21 13:16:44 +0900134
Thiébaud Weksteenb75b4d22021-11-24 14:44:28 +1100135python_test_host {
136 name: "fc_sort_test",
137 srcs: [
138 "fc_sort.py",
139 "fc_sort_test.py",
140 ],
Thiébaud Weksteenb75b4d22021-11-24 14:44:28 +1100141 test_options: {
142 unit_test: true,
Inseob Kimff2018f2024-04-17 09:48:43 +0900143 },
Thiébaud Weksteenb75b4d22021-11-24 14:44:28 +1100144}
145
Inseob Kim2bcc0452020-12-21 13:16:44 +0900146python_binary_host {
147 name: "check_prop_prefix",
148 srcs: ["check_prop_prefix.py"],
149}
Inseob Kim36d9d392023-09-04 17:40:03 +0900150
151python_binary_host {
152 name: "sepolicy_freeze_test",
153 srcs: [
154 "sepolicy_freeze_test.py",
155 ],
156 version: {
157 py3: {
158 embedded_launcher: true,
159 },
160 },
161 libs: [
162 "mini_cil_parser",
163 ],
164}
Inseob Kim55d140f2023-09-26 11:19:13 +0900165
166python_test_host {
167 name: "policy_test",
168 srcs: [
169 "fc_sort.py",
170 "policy.py",
171 "policy_test.py",
172 ],
173 test_options: {
174 unit_test: true,
175 },
176 version: {
177 py3: {
178 embedded_launcher: true,
179 },
180 },
181}