已合并
[Bug]: 增量构建-fix重复构建 #8266
[Bug]: 增量构建-fix重复构建 #8266
已合并
HsuYao创建于 9月18日
共 1 个文件变更+172-125
MBUILD.gn+172-125
@@ -530,29 +530,45 @@ action("build_policy") {
530 target_out_dir + "/user_policy",530 target_out_dir + "/user_policy",
531 target_out_dir + "/vendor.cil",531 target_out_dir + "/vendor.cil",
532 target_out_dir + "/system.cil",532 target_out_dir + "/system.cil",
533- target_out_dir + "/system.cil.sha256",
534- target_out_dir + "/compatible/$selinux_adapter_vendor_policy_version.cil",
535- target_out_dir + "/compatible",
536- target_out_dir + "/version",
537- target_out_dir + "/public.cil",
538 ]533 ]
539 534 
535+ if (selinux_adapter_components == "system") {
536+ outputs += [ target_out_dir + "/system.cil.sha256" ]
537+ }
538+ 
539+ if (selinux_adapter_components != "default") {
540+ outputs += [
541+ target_out_dir + "/compatible/$selinux_adapter_vendor_policy_version.cil",
542+ target_out_dir + "/compatible",
543+ target_out_dir + "/version",
544+ target_out_dir + "/public.cil",
hehehe-li
hehehe-lihehehe-li9月22日

【一般】public.cil需要

likedislike
HsuYao
HsuYao
9月22日 评论:
545+ ]
546+ }
547+ 
540 if (selinux_adapter_components == "vendor") {548 if (selinux_adapter_components == "vendor") {
541 outputs += [ target_out_dir + "/prebuild_sepolicy.system.cil.sha256" ]549 outputs += [ target_out_dir + "/prebuild_sepolicy.system.cil.sha256" ]
542 }550 }
543 551 
544 outputs += [552 outputs += [
545- target_out_dir + "/developer/system.cil.sha256",
546- target_out_dir +
547- "/developer/compatible/$selinux_adapter_vendor_policy_version.cil",
548- target_out_dir + "/developer/compatible",
549 target_out_dir + "/developer/developer_policy",553 target_out_dir + "/developer/developer_policy",
550 target_out_dir + "/developer/policy.31",554 target_out_dir + "/developer/policy.31",
551 target_out_dir + "/developer/vendor.cil",555 target_out_dir + "/developer/vendor.cil",
552 target_out_dir + "/developer/system.cil",556 target_out_dir + "/developer/system.cil",
553- target_out_dir + "/developer/public.cil",
554 ]557 ]
555 558 
559+ if (selinux_adapter_components == "system") {
560+ outputs += [ target_out_dir + "/developer/system.cil.sha256" ]
561+ }
562+ 
563+ if (selinux_adapter_components != "default") {
564+ outputs += [
565+ target_out_dir +
566+ "/developer/compatible/$selinux_adapter_vendor_policy_version.cil",
567+ target_out_dir + "/developer/compatible",
568+ target_out_dir + "/developer/public.cil",
hehehe-li
hehehe-lihehehe-li9月22日

【一般】同上

likedislike
HsuYao
HsuYao
9月22日 评论:
569+ ]
570+ }
571+ 
556 if (selinux_adapter_components == "vendor") {572 if (selinux_adapter_components == "vendor") {
557 outputs += [ target_out_dir + "/developer/prebuild_sepolicy.system.cil.sha256" ]573 outputs += [ target_out_dir + "/developer/prebuild_sepolicy.system.cil.sha256" ]
558 }574 }
@@ -926,14 +942,16 @@ ohos_prebuilt_etc("build_updater_sepolicy") {
926 install_images = [ "updater" ]942 install_images = [ "updater" ]
927}943}
928 944 
929-ohos_prebuilt_etc("selinux_version") {945+if (selinux_adapter_components == "vendor") {
930- deps = [ ":build_policy" ]946+ ohos_prebuilt_etc("selinux_version") {
931- source = target_out_dir + "/version"947+ deps = [ ":build_policy" ]
932- license_file = "LICENSE"948+ source = target_out_dir + "/version"
933- part_name = "selinux_adapter"949+ license_file = "LICENSE"
934- subsystem_name = "security"950+ part_name = "selinux_adapter"
935- relative_install_dir = "selinux/"951+ subsystem_name = "security"
936- install_images = [ "vendor" ]952+ relative_install_dir = "selinux/"
953+ install_images = [ "vendor" ]
954+ }
937}955}
938 956 
939ohos_prebuilt_etc("config") {957ohos_prebuilt_etc("config") {
@@ -1070,14 +1088,16 @@ ohos_prebuilt_etc("file_contexts_updater") {
1070 }1088 }
1071}1089}
1072 1090 
1073-ohos_prebuilt_etc("vendor_cil") {1091+if (selinux_adapter_components == "vendor") {
1074- deps = [ ":build_policy" ]1092+ ohos_prebuilt_etc("vendor_cil") {
1075- source = target_out_dir + "/vendor.cil"1093+ deps = [ ":build_policy" ]
1076- license_file = "LICENSE"1094+ source = target_out_dir + "/vendor.cil"
1077- part_name = "selinux_adapter"1095+ license_file = "LICENSE"
1078- subsystem_name = "security"1096+ part_name = "selinux_adapter"
1079- relative_install_dir = "selinux/"1097+ subsystem_name = "security"
1080- install_images = [ "vendor" ]1098+ relative_install_dir = "selinux/"
1099+ install_images = [ "vendor" ]
1100+ }
1081}1101}
1082 1102 
1083if (selinux_adapter_components == "vendor") {1103if (selinux_adapter_components == "vendor") {
@@ -1092,14 +1112,16 @@ if (selinux_adapter_components == "vendor") {
1092 }1112 }
1093}1113}
1094 1114 
1095-ohos_prebuilt_etc("public_cil") {1115+if (selinux_adapter_components == "vendor") {
1096- deps = [ ":build_policy" ]1116+ ohos_prebuilt_etc("public_cil") {
1097- source = target_out_dir + "/public.cil"1117+ deps = [ ":build_policy" ]
1098- license_file = "LICENSE"1118+ source = target_out_dir + "/public.cil"
1099- part_name = "selinux_adapter"1119+ license_file = "LICENSE"
1100- subsystem_name = "security"1120+ part_name = "selinux_adapter"
1101- relative_install_dir = "selinux/"1121+ subsystem_name = "security"
1102- install_images = [ "vendor" ]1122+ relative_install_dir = "selinux/"
1123+ install_images = [ "vendor" ]
1124+ }
1103}1125}
1104 1126 
1105if (selinux_adapter_components == "vendor") {1127if (selinux_adapter_components == "vendor") {
@@ -1114,15 +1136,17 @@ if (selinux_adapter_components == "vendor") {
1114 }1136 }
1115}1137}
1116 1138 
1117-ohos_prebuilt_etc("version_cil") {1139+if (selinux_adapter_components == "system") {
1118- deps = [ ":build_policy" ]1140+ ohos_prebuilt_etc("version_cil") {
1119- source =1141+ deps = [ ":build_policy" ]
1120- target_out_dir + "/compatible/$selinux_adapter_vendor_policy_version.cil"1142+ source =
1121- license_file = "LICENSE"1143+ target_out_dir + "/compatible/$selinux_adapter_vendor_policy_version.cil"
1122- part_name = "selinux_adapter"1144+ license_file = "LICENSE"
1123- subsystem_name = "security"1145+ part_name = "selinux_adapter"
1124- relative_install_dir = "selinux/compatible/"1146+ subsystem_name = "security"
1125- install_images = [ "system" ]1147+ relative_install_dir = "selinux/compatible/"
1148+ install_images = [ "system" ]
1149+ }
1126}1150}
1127 1151 
1128if (selinux_adapter_components == "vendor") {1152if (selinux_adapter_components == "vendor") {
@@ -1137,14 +1161,16 @@ if (selinux_adapter_components == "vendor") {
1137 }1161 }
1138}1162}
1139 1163 
1140-ohos_prebuilt_etc("system_cil") {1164+if (selinux_adapter_components == "system") {
1141- deps = [ ":build_policy" ]1165+ ohos_prebuilt_etc("system_cil") {
1142- source = target_out_dir + "/system.cil"1166+ deps = [ ":build_policy" ]
1143- license_file = "LICENSE"1167+ source = target_out_dir + "/system.cil"
1144- part_name = "selinux_adapter"1168+ license_file = "LICENSE"
1145- subsystem_name = "security"1169+ part_name = "selinux_adapter"
1146- relative_install_dir = "selinux/"1170+ subsystem_name = "security"
1147- install_images = [ "system" ]1171+ relative_install_dir = "selinux/"
1172+ install_images = [ "system" ]
1173+ }
1148}1174}
1149 1175 
1150if (selinux_adapter_components == "system") {1176if (selinux_adapter_components == "system") {
@@ -1159,59 +1185,69 @@ if (selinux_adapter_components == "system") {
1159 }1185 }
1160}1186}
1161 1187 
1162-ohos_prebuilt_etc("system_cil_sha256") {1188+if (selinux_adapter_components == "system") {
1163- deps = [ ":build_policy" ]1189+ ohos_prebuilt_etc("system_cil_sha256") {
1164- source = target_out_dir + "/system.cil.sha256"1190+ deps = [ ":build_policy" ]
1165- license_file = "LICENSE"1191+ source = target_out_dir + "/system.cil.sha256"
1166- part_name = "selinux_adapter"1192+ license_file = "LICENSE"
1167- subsystem_name = "security"1193+ part_name = "selinux_adapter"
1168- relative_install_dir = "selinux/"1194+ subsystem_name = "security"
1169- install_images = [ "system" ]1195+ relative_install_dir = "selinux/"
1196+ install_images = [ "system" ]
1197+ }
1170}1198}
1171 1199 
1172if (selinux_adapter_support_developer_mode) {1200if (selinux_adapter_support_developer_mode) {
1173- ohos_prebuilt_etc("system_developer_cil") {1201+ if (selinux_adapter_components == "system") {
1174- deps = [ ":build_policy" ]1202+ ohos_prebuilt_etc("system_developer_cil") {
1175- source = target_out_dir + "/developer/system.cil"1203+ deps = [ ":build_policy" ]
1176- output = "system_developer.cil"1204+ source = target_out_dir + "/developer/system.cil"
1177- license_file = "LICENSE"1205+ output = "system_developer.cil"
1178- part_name = "selinux_adapter"1206+ license_file = "LICENSE"
1179- subsystem_name = "security"1207+ part_name = "selinux_adapter"
1180- relative_install_dir = "selinux/"1208+ subsystem_name = "security"
1181- install_images = [ "system" ]1209+ relative_install_dir = "selinux/"
1210+ install_images = [ "system" ]
1211+ }
1182 }1212 }
1183 1213 
1184- ohos_prebuilt_etc("vendor_developer_cil") {1214+ if (selinux_adapter_components == "vendor") {
1185- deps = [ ":build_policy" ]1215+ ohos_prebuilt_etc("vendor_developer_cil") {
1186- source = target_out_dir + "/developer/vendor.cil"1216+ deps = [ ":build_policy" ]
1187- output = "vendor_developer.cil"1217+ source = target_out_dir + "/developer/vendor.cil"
1188- license_file = "LICENSE"1218+ output = "vendor_developer.cil"
1189- part_name = "selinux_adapter"1219+ license_file = "LICENSE"
1190- subsystem_name = "security"1220+ part_name = "selinux_adapter"
1191- relative_install_dir = "selinux/"1221+ subsystem_name = "security"
1192- install_images = [ "vendor" ]1222+ relative_install_dir = "selinux/"
1223+ install_images = [ "vendor" ]
1224+ }
1193 }1225 }
1194 1226 
1195- ohos_prebuilt_etc("public_developer_cil") {1227+ if (selinux_adapter_components == "vendor") {
1196- deps = [ ":build_policy" ]1228+ ohos_prebuilt_etc("public_developer_cil") {
1197- source = target_out_dir + "/developer/public.cil"1229+ deps = [ ":build_policy" ]
1198- output = "public_developer.cil"1230+ source = target_out_dir + "/developer/public.cil"
1199- license_file = "LICENSE"1231+ output = "public_developer.cil"
1200- part_name = "selinux_adapter"1232+ license_file = "LICENSE"
1201- subsystem_name = "security"1233+ part_name = "selinux_adapter"
1202- relative_install_dir = "selinux/"1234+ subsystem_name = "security"
1203- install_images = [ "vendor" ]1235+ relative_install_dir = "selinux/"
1236+ install_images = [ "vendor" ]
1237+ }
1204 }1238 }
1205 1239 
1206- ohos_prebuilt_etc("version_developer_cil") {1240+ if (selinux_adapter_components == "system") {
1207- deps = [ ":build_policy" ]1241+ ohos_prebuilt_etc("version_developer_cil") {
1208- source = target_out_dir +1242+ deps = [ ":build_policy" ]
1209- "/developer/compatible/$selinux_adapter_vendor_policy_version.cil"1243+ source = target_out_dir +
1210- license_file = "LICENSE"1244+ "/developer/compatible/$selinux_adapter_vendor_policy_version.cil"
1211- part_name = "selinux_adapter"1245+ license_file = "LICENSE"
1212- subsystem_name = "security"1246+ part_name = "selinux_adapter"
1213- relative_install_dir = "selinux/compatible_developer/"1247+ subsystem_name = "security"
1214- install_images = [ "system" ]1248+ relative_install_dir = "selinux/compatible_developer/"
1249+ install_images = [ "system" ]
1250+ }
1215 }1251 }
1216 1252 
1217 ohos_prebuilt_etc("developer_policy") {1253 ohos_prebuilt_etc("developer_policy") {
@@ -1243,15 +1279,17 @@ if (selinux_adapter_support_developer_mode) {
1243 }1279 }
1244 }1280 }
1245 1281 
1246- ohos_prebuilt_etc("system_developer_cil_sha256") {1282+ if (selinux_adapter_components == "system") {
1247- deps = [ ":build_policy" ]1283+ ohos_prebuilt_etc("system_developer_cil_sha256") {
1248- source = target_out_dir + "/developer/system.cil.sha256"1284+ deps = [ ":build_policy" ]
1249- output = "system_developer.cil.sha256"1285+ source = target_out_dir + "/developer/system.cil.sha256"
1250- license_file = "LICENSE"1286+ output = "system_developer.cil.sha256"
1251- part_name = "selinux_adapter"1287+ license_file = "LICENSE"
1252- subsystem_name = "security"1288+ part_name = "selinux_adapter"
1253- relative_install_dir = "selinux/"1289+ subsystem_name = "security"
1254- install_images = [ "system" ]1290+ relative_install_dir = "selinux/"
1291+ install_images = [ "system" ]
1292+ }
1255 }1293 }
1256}1294}
1257 1295 
@@ -1356,16 +1394,18 @@ if (selinux_adapter_components != "default") {
1356 script = "copy_file_or_dir.sh"1394 script = "copy_file_or_dir.sh"
1357 }1395 }
1358 1396 
1359- action("eng_system_system_cil_sha256") {1397+ if (selinux_adapter_components == "system") {
1360- deps = [ ":build_policy" ]1398+ action("eng_system_system_cil_sha256") {
1361- sources = [ "$target_out_dir/system.cil.sha256" ]1399+ deps = [ ":build_policy" ]
1362- outputs =1400+ sources = [ "$target_out_dir/system.cil.sha256" ]
1363- [ "$root_out_dir/$eng_system_base_dir/etc/selinux/system.cil.sha256" ]1401+ outputs =
1364- args = [1402+ [ "$root_out_dir/$eng_system_base_dir/etc/selinux/system.cil.sha256" ]
1365- rebase_path(sources[0]),1403+ args = [
1366- rebase_path(outputs[0]),1404+ rebase_path(sources[0]),
1367- ]1405+ rebase_path(outputs[0]),
1368- script = "copy_file_or_dir.sh"1406+ ]
1407+ script = "copy_file_or_dir.sh"
1408+ }
1369 }1409 }
1370 1410 
1371 action("eng_system_system_common_cil") {1411 action("eng_system_system_common_cil") {
@@ -1393,15 +1433,17 @@ if (selinux_adapter_components != "default") {
1393 script = "copy_file_or_dir.sh"1433 script = "copy_file_or_dir.sh"
1394 }1434 }
1395 1435 
1396- action("eng_system_system_developer_cil_sha256") {1436+ if (selinux_adapter_components == "system") {
1397- deps = [ ":build_policy" ]1437+ action("eng_system_system_developer_cil_sha256") {
1398- sources = [ "$target_out_dir/developer/system.cil.sha256" ]1438+ deps = [ ":build_policy" ]
1399- outputs = [ "$root_out_dir/$eng_system_base_dir/etc/selinux/system_developer.cil.sha256" ]1439+ sources = [ "$target_out_dir/developer/system.cil.sha256" ]
1400- args = [1440+ outputs = [ "$root_out_dir/$eng_system_base_dir/etc/selinux/system_developer.cil.sha256" ]
1401- rebase_path(sources[0]),1441+ args = [
1402- rebase_path(outputs[0]),1442+ rebase_path(sources[0]),
1403- ]1443+ rebase_path(outputs[0]),
1404- script = "copy_file_or_dir.sh"1444+ ]
1445+ script = "copy_file_or_dir.sh"
1446+ }
1405 }1447 }
1406 1448 
1407 action("eng_chipset_developer_policy") {1449 action("eng_chipset_developer_policy") {
@@ -1528,12 +1570,17 @@ if (selinux_adapter_components != "default") {
1528 ":eng_system_compatible",1570 ":eng_system_compatible",
1529 ":eng_system_compatible_developer",1571 ":eng_system_compatible_developer",
1530 ":eng_system_system_cil",1572 ":eng_system_system_cil",
1531- ":eng_system_system_cil_sha256",
1532 ":eng_system_system_common_cil",1573 ":eng_system_system_common_cil",
1533 ":eng_system_system_developer_cil",1574 ":eng_system_system_developer_cil",
1534- ":eng_system_system_developer_cil_sha256",
1535 ":filecontexts_toolchain",1575 ":filecontexts_toolchain",
1536 ]1576 ]
1577+ 
1578+ if (selinux_adapter_components == "system") {
1579+ deps += [
1580+ ":eng_system_system_cil_sha256",
1581+ ":eng_system_system_developer_cil_sha256"
1582+ ]
1583+ }
1537 }1584 }
1538 1585 
1539 group("eng_chipset_selinux_group") {1586 group("eng_chipset_selinux_group") {