Bob Badour | 601ebb4 | 2021-02-03 23:07:40 -0800 | [diff] [blame] | 1 | package { |
| 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 Stoep | bdfc030 | 2017-05-25 09:53:47 -0700 | [diff] [blame] | 9 | cc_library_host_shared { |
| 10 | name: "libsepolwrap", |
| 11 | srcs: ["sepol_wrap.cpp"], |
Inseob Kim | ff2018f | 2024-04-17 09:48:43 +0900 | [diff] [blame] | 12 | cflags: [ |
| 13 | "-Wall", |
| 14 | "-Werror", |
| 15 | ], |
Jeff Vander Stoep | bdfc030 | 2017-05-25 09:53:47 -0700 | [diff] [blame] | 16 | export_include_dirs: ["include"], |
Inseob Kim | 6fa8efd | 2021-12-29 13:56:14 +0900 | [diff] [blame] | 17 | stl: "c++_static", |
Dan Willemsen | 948354a | 2017-09-01 14:08:46 -0700 | [diff] [blame] | 18 | |
| 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 Stoep | 3ca843a | 2017-10-04 09:42:29 -0700 | [diff] [blame] | 22 | static_libs: [ |
| 23 | "libbase", |
| 24 | "libsepol", |
| 25 | ], |
Dan Willemsen | 948354a | 2017-09-01 14:08:46 -0700 | [diff] [blame] | 26 | sanitize: { |
| 27 | never: true, |
| 28 | }, |
Jeff Vander Stoep | bdfc030 | 2017-05-25 09:53:47 -0700 | [diff] [blame] | 29 | } |
Jeff Vander Stoep | 1fc0682 | 2017-05-31 15:36:07 -0700 | [diff] [blame] | 30 | |
Inseob Kim | cbc95ea | 2022-01-21 19:32:53 +0900 | [diff] [blame] | 31 | python_library_host { |
| 32 | name: "mini_cil_parser", |
| 33 | srcs: ["mini_parser.py"], |
| 34 | } |
| 35 | |
| 36 | python_library_host { |
| 37 | name: "pysepolwrap", |
| 38 | srcs: [ |
| 39 | "fc_sort.py", |
| 40 | "policy.py", |
| 41 | ], |
| 42 | } |
| 43 | |
Jeff Vander Stoep | a7d2c5b | 2017-09-23 14:42:50 -0700 | [diff] [blame] | 44 | python_binary_host { |
| 45 | name: "treble_sepolicy_tests", |
| 46 | srcs: [ |
Jeff Vander Stoep | 370a52f | 2018-02-08 09:54:59 -0800 | [diff] [blame] | 47 | "treble_sepolicy_tests.py", |
Dan Cashman | 91d398d | 2017-09-26 12:58:29 -0700 | [diff] [blame] | 48 | ], |
Inseob Kim | cbc95ea | 2022-01-21 19:32:53 +0900 | [diff] [blame] | 49 | libs: [ |
| 50 | "mini_cil_parser", |
Inseob Kim | cbc95ea | 2022-01-21 19:32:53 +0900 | [diff] [blame] | 51 | ], |
Dan Cashman | 91d398d | 2017-09-26 12:58:29 -0700 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | python_binary_host { |
| 55 | name: "sepolicy_tests", |
| 56 | srcs: [ |
Jeff Vander Stoep | 370a52f | 2018-02-08 09:54:59 -0800 | [diff] [blame] | 57 | "sepolicy_tests.py", |
Dan Cashman | 91d398d | 2017-09-26 12:58:29 -0700 | [diff] [blame] | 58 | ], |
Inseob Kim | cbc95ea | 2022-01-21 19:32:53 +0900 | [diff] [blame] | 59 | libs: ["pysepolwrap"], |
Inseob Kim | 6fa8efd | 2021-12-29 13:56:14 +0900 | [diff] [blame] | 60 | data: [":libsepolwrap"], |
Dan Cashman | 91d398d | 2017-09-26 12:58:29 -0700 | [diff] [blame] | 61 | } |
| 62 | |
| 63 | python_binary_host { |
Jooyung Han | 23d1e62 | 2023-04-04 18:03:07 +0900 | [diff] [blame] | 64 | name: "apex_sepolicy_tests", |
| 65 | srcs: [ |
| 66 | "apex_sepolicy_tests.py", |
| 67 | ], |
Jooyung Han | 23d1e62 | 2023-04-04 18:03:07 +0900 | [diff] [blame] | 68 | libs: ["pysepolwrap"], |
| 69 | data: [ |
| 70 | ":libsepolwrap", |
Cole Faust | 30349e3 | 2024-10-22 16:31:06 -0700 | [diff] [blame] | 71 | ], |
| 72 | device_common_data: [ |
Jooyung Han | 23d1e62 | 2023-04-04 18:03:07 +0900 | [diff] [blame] | 73 | ":precompiled_sepolicy", |
| 74 | ], |
| 75 | } |
| 76 | |
| 77 | python_test_host { |
| 78 | name: "apex_sepolicy_tests_test", |
| 79 | srcs: [ |
| 80 | "apex_sepolicy_tests.py", |
| 81 | "apex_sepolicy_tests_test.py", |
| 82 | ], |
| 83 | libs: ["pysepolwrap"], |
| 84 | data: [ |
| 85 | ":libsepolwrap", |
Cole Faust | 30349e3 | 2024-10-22 16:31:06 -0700 | [diff] [blame] | 86 | ], |
| 87 | device_common_data: [ |
Jooyung Han | 23d1e62 | 2023-04-04 18:03:07 +0900 | [diff] [blame] | 88 | ":precompiled_sepolicy", |
| 89 | ], |
| 90 | test_options: { |
| 91 | unit_test: true, |
| 92 | }, |
| 93 | } |
| 94 | |
| 95 | python_binary_host { |
Dan Cashman | 91d398d | 2017-09-26 12:58:29 -0700 | [diff] [blame] | 96 | name: "searchpolicy", |
| 97 | srcs: [ |
Jeff Vander Stoep | 3a3756f | 2018-04-24 11:03:22 -0700 | [diff] [blame] | 98 | "searchpolicy.py", |
Jeff Vander Stoep | a7d2c5b | 2017-09-23 14:42:50 -0700 | [diff] [blame] | 99 | ], |
Inseob Kim | cbc95ea | 2022-01-21 19:32:53 +0900 | [diff] [blame] | 100 | libs: ["pysepolwrap"], |
Jeff Vander Stoep | a7d2c5b | 2017-09-23 14:42:50 -0700 | [diff] [blame] | 101 | required: ["libsepolwrap"], |
Jeff Vander Stoep | 1fc0682 | 2017-05-31 15:36:07 -0700 | [diff] [blame] | 102 | } |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 103 | |
| 104 | python_binary_host { |
| 105 | name: "combine_maps", |
| 106 | srcs: [ |
| 107 | "combine_maps.py", |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 108 | ], |
Inseob Kim | cbc95ea | 2022-01-21 19:32:53 +0900 | [diff] [blame] | 109 | libs: ["mini_cil_parser"], |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 110 | } |
Jeff Vander Stoep | 1ca7a4c | 2019-04-10 16:53:17 -0700 | [diff] [blame] | 111 | |
| 112 | python_binary_host { |
| 113 | name: "fc_sort", |
| 114 | srcs: [ |
| 115 | "fc_sort.py", |
| 116 | ], |
Jeff Vander Stoep | 1ca7a4c | 2019-04-10 16:53:17 -0700 | [diff] [blame] | 117 | } |
Inseob Kim | 2bcc045 | 2020-12-21 13:16:44 +0900 | [diff] [blame] | 118 | |
Thiébaud Weksteen | b75b4d2 | 2021-11-24 14:44:28 +1100 | [diff] [blame] | 119 | python_test_host { |
| 120 | name: "fc_sort_test", |
| 121 | srcs: [ |
| 122 | "fc_sort.py", |
| 123 | "fc_sort_test.py", |
| 124 | ], |
Thiébaud Weksteen | b75b4d2 | 2021-11-24 14:44:28 +1100 | [diff] [blame] | 125 | test_options: { |
| 126 | unit_test: true, |
Inseob Kim | ff2018f | 2024-04-17 09:48:43 +0900 | [diff] [blame] | 127 | }, |
Thiébaud Weksteen | b75b4d2 | 2021-11-24 14:44:28 +1100 | [diff] [blame] | 128 | } |
| 129 | |
Inseob Kim | 2bcc045 | 2020-12-21 13:16:44 +0900 | [diff] [blame] | 130 | python_binary_host { |
| 131 | name: "check_prop_prefix", |
| 132 | srcs: ["check_prop_prefix.py"], |
| 133 | } |
Inseob Kim | 36d9d39 | 2023-09-04 17:40:03 +0900 | [diff] [blame] | 134 | |
| 135 | python_binary_host { |
| 136 | name: "sepolicy_freeze_test", |
| 137 | srcs: [ |
| 138 | "sepolicy_freeze_test.py", |
| 139 | ], |
Inseob Kim | 36d9d39 | 2023-09-04 17:40:03 +0900 | [diff] [blame] | 140 | libs: [ |
| 141 | "mini_cil_parser", |
| 142 | ], |
| 143 | } |
Inseob Kim | 55d140f | 2023-09-26 11:19:13 +0900 | [diff] [blame] | 144 | |
| 145 | python_test_host { |
| 146 | name: "policy_test", |
| 147 | srcs: [ |
| 148 | "fc_sort.py", |
| 149 | "policy.py", |
| 150 | "policy_test.py", |
| 151 | ], |
| 152 | test_options: { |
| 153 | unit_test: true, |
| 154 | }, |
Inseob Kim | 55d140f | 2023-09-26 11:19:13 +0900 | [diff] [blame] | 155 | } |
Inseob Kim | 6faaf13 | 2024-05-02 17:40:00 +0900 | [diff] [blame] | 156 | |
| 157 | // prebuilt files to be included to CTS |
| 158 | filegroup { |
| 159 | name: "prebuilt_sepolicy_cts_data", |
Inseob Kim | d4e4945 | 2025-01-17 10:43:25 +0900 | [diff] [blame] | 160 | srcs: [ |
| 161 | ":202404_sepolicy_cts_data", |
| 162 | ":202504_sepolicy_cts_data", |
| 163 | ], |
Inseob Kim | 6faaf13 | 2024-05-02 17:40:00 +0900 | [diff] [blame] | 164 | visibility: ["//cts/hostsidetests/security"], |
| 165 | } |