1package { 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 9cc_library_host_shared { 10 name: "libsepolwrap", 11 srcs: ["sepol_wrap.cpp"], 12 cflags: ["-Wall", "-Werror",], 13 export_include_dirs: ["include"], 14 stl: "c++_static", 15 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. 19 static_libs: [ 20 "libbase", 21 "libsepol", 22 ], 23 sanitize: { 24 never: true, 25 }, 26} 27 28python_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 41python_binary_host { 42 name: "treble_sepolicy_tests", 43 srcs: [ 44 "treble_sepolicy_tests.py", 45 ], 46 version: { 47 py3: { 48 embedded_launcher: true, 49 }, 50 }, 51 libs: [ 52 "mini_cil_parser", 53 "pysepolwrap", 54 ], 55 data: [":libsepolwrap"], 56} 57 58python_binary_host { 59 name: "sepolicy_tests", 60 srcs: [ 61 "sepolicy_tests.py", 62 ], 63 version: { 64 py3: { 65 embedded_launcher: true, 66 }, 67 }, 68 libs: ["pysepolwrap"], 69 data: [":libsepolwrap"], 70} 71 72python_binary_host { 73 name: "apex_sepolicy_tests", 74 srcs: [ 75 "apex_sepolicy_tests.py", 76 ], 77 version: { 78 py3: { 79 embedded_launcher: true, 80 }, 81 }, 82 libs: ["pysepolwrap"], 83 data: [ 84 ":libsepolwrap", 85 ":precompiled_sepolicy", 86 ], 87} 88 89python_test_host { 90 name: "apex_sepolicy_tests_test", 91 srcs: [ 92 "apex_sepolicy_tests.py", 93 "apex_sepolicy_tests_test.py", 94 ], 95 libs: ["pysepolwrap"], 96 data: [ 97 ":libsepolwrap", 98 ":precompiled_sepolicy", 99 ], 100 test_options: { 101 unit_test: true, 102 }, 103 version: { 104 py3: { 105 embedded_launcher: true, 106 }, 107 }, 108} 109 110python_binary_host { 111 name: "searchpolicy", 112 srcs: [ 113 "searchpolicy.py", 114 ], 115 libs: ["pysepolwrap"], 116 required: ["libsepolwrap"], 117} 118 119python_binary_host { 120 name: "combine_maps", 121 srcs: [ 122 "combine_maps.py", 123 ], 124 libs: ["mini_cil_parser"], 125} 126 127python_binary_host { 128 name: "fc_sort", 129 srcs: [ 130 "fc_sort.py", 131 ], 132} 133 134python_test_host { 135 name: "fc_sort_test", 136 srcs: [ 137 "fc_sort.py", 138 "fc_sort_test.py", 139 ], 140 test_options: { 141 unit_test: true, 142 } 143} 144 145python_binary_host { 146 name: "check_prop_prefix", 147 srcs: ["check_prop_prefix.py"], 148} 149