blob: 743c8569c941196f2ad33ae80154c0e322da3ffe [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"],
Jeff Vander Stoepbdfc0302017-05-25 09:53:47 -070012 cflags: ["-Wall", "-Werror",],
13 export_include_dirs: ["include"],
Inseob Kim6fa8efd2021-12-29 13:56:14 +090014 stl: "c++_static",
Dan Willemsen948354a2017-09-01 14:08:46 -070015
16 // libsepolwrap gets loaded from the system python, which does not have the
17 // ASAN runtime. So turn off sanitization for ourself, and use static
18 // libraries, since the shared libraries will use ASAN.
Jeff Vander Stoep3ca843a2017-10-04 09:42:29 -070019 static_libs: [
20 "libbase",
21 "libsepol",
22 ],
Dan Willemsen948354a2017-09-01 14:08:46 -070023 sanitize: {
24 never: true,
25 },
Jeff Vander Stoepbdfc0302017-05-25 09:53:47 -070026}
Jeff Vander Stoep1fc06822017-05-31 15:36:07 -070027
Inseob Kimcbc95ea2022-01-21 19:32:53 +090028python_library_host {
29 name: "mini_cil_parser",
30 srcs: ["mini_parser.py"],
31}
32
33python_library_host {
34 name: "pysepolwrap",
35 srcs: [
36 "fc_sort.py",
37 "policy.py",
38 ],
39}
40
Jeff Vander Stoepa7d2c5b2017-09-23 14:42:50 -070041python_binary_host {
42 name: "treble_sepolicy_tests",
43 srcs: [
Jeff Vander Stoep370a52f2018-02-08 09:54:59 -080044 "treble_sepolicy_tests.py",
Dan Cashman91d398d2017-09-26 12:58:29 -070045 ],
Inseob Kim4912a242022-07-25 11:30:02 +090046 version: {
47 py3: {
48 embedded_launcher: true,
49 },
50 },
Inseob Kimcbc95ea2022-01-21 19:32:53 +090051 libs: [
52 "mini_cil_parser",
Inseob Kimcbc95ea2022-01-21 19:32:53 +090053 ],
Dan Cashman91d398d2017-09-26 12:58:29 -070054}
55
56python_binary_host {
57 name: "sepolicy_tests",
58 srcs: [
Jeff Vander Stoep370a52f2018-02-08 09:54:59 -080059 "sepolicy_tests.py",
Dan Cashman91d398d2017-09-26 12:58:29 -070060 ],
Inseob Kim4912a242022-07-25 11:30:02 +090061 version: {
62 py3: {
63 embedded_launcher: true,
64 },
65 },
Inseob Kimcbc95ea2022-01-21 19:32:53 +090066 libs: ["pysepolwrap"],
Inseob Kim6fa8efd2021-12-29 13:56:14 +090067 data: [":libsepolwrap"],
Dan Cashman91d398d2017-09-26 12:58:29 -070068}
69
70python_binary_host {
Jooyung Han23d1e622023-04-04 18:03:07 +090071 name: "apex_sepolicy_tests",
72 srcs: [
73 "apex_sepolicy_tests.py",
74 ],
75 version: {
76 py3: {
77 embedded_launcher: true,
78 },
79 },
80 libs: ["pysepolwrap"],
81 data: [
82 ":libsepolwrap",
83 ":precompiled_sepolicy",
84 ],
85}
86
87python_test_host {
88 name: "apex_sepolicy_tests_test",
89 srcs: [
90 "apex_sepolicy_tests.py",
91 "apex_sepolicy_tests_test.py",
92 ],
93 libs: ["pysepolwrap"],
94 data: [
95 ":libsepolwrap",
96 ":precompiled_sepolicy",
97 ],
98 test_options: {
99 unit_test: true,
100 },
Jooyung Han7ba515a2023-04-11 08:30:19 +0900101 version: {
102 py3: {
103 embedded_launcher: true,
104 },
105 },
Jooyung Han23d1e622023-04-04 18:03:07 +0900106}
107
108python_binary_host {
Dan Cashman91d398d2017-09-26 12:58:29 -0700109 name: "searchpolicy",
110 srcs: [
Jeff Vander Stoep3a3756f2018-04-24 11:03:22 -0700111 "searchpolicy.py",
Jeff Vander Stoepa7d2c5b2017-09-23 14:42:50 -0700112 ],
Inseob Kimcbc95ea2022-01-21 19:32:53 +0900113 libs: ["pysepolwrap"],
Jeff Vander Stoepa7d2c5b2017-09-23 14:42:50 -0700114 required: ["libsepolwrap"],
Jeff Vander Stoep1fc06822017-05-31 15:36:07 -0700115}
Tri Vo438684b2018-09-29 17:47:10 -0700116
117python_binary_host {
118 name: "combine_maps",
119 srcs: [
120 "combine_maps.py",
Tri Vo438684b2018-09-29 17:47:10 -0700121 ],
Inseob Kimcbc95ea2022-01-21 19:32:53 +0900122 libs: ["mini_cil_parser"],
Tri Vo438684b2018-09-29 17:47:10 -0700123}
Jeff Vander Stoep1ca7a4c2019-04-10 16:53:17 -0700124
125python_binary_host {
126 name: "fc_sort",
127 srcs: [
128 "fc_sort.py",
129 ],
Jeff Vander Stoep1ca7a4c2019-04-10 16:53:17 -0700130}
Inseob Kim2bcc0452020-12-21 13:16:44 +0900131
ThiƩbaud Weksteenb75b4d22021-11-24 14:44:28 +1100132python_test_host {
133 name: "fc_sort_test",
134 srcs: [
135 "fc_sort.py",
136 "fc_sort_test.py",
137 ],
ThiƩbaud Weksteenb75b4d22021-11-24 14:44:28 +1100138 test_options: {
139 unit_test: true,
140 }
141}
142
Inseob Kim2bcc0452020-12-21 13:16:44 +0900143python_binary_host {
144 name: "check_prop_prefix",
145 srcs: ["check_prop_prefix.py"],
146}
Inseob Kim36d9d392023-09-04 17:40:03 +0900147
148python_binary_host {
149 name: "sepolicy_freeze_test",
150 srcs: [
151 "sepolicy_freeze_test.py",
152 ],
153 version: {
154 py3: {
155 embedded_launcher: true,
156 },
157 },
158 libs: [
159 "mini_cil_parser",
160 ],
161}
Inseob Kim55d140f2023-09-26 11:19:13 +0900162
163python_test_host {
164 name: "policy_test",
165 srcs: [
166 "fc_sort.py",
167 "policy.py",
168 "policy_test.py",
169 ],
170 test_options: {
171 unit_test: true,
172 },
173 version: {
174 py3: {
175 embedded_launcher: true,
176 },
177 },
178}