The clean task is currently a separate script, which is already problematic:
Fix mod project paths containing spaces #56 isn't applied to cleaning logic
clean_cooker_output.ps1 had to be a separate file (it's called from both clean and build) and duplicates logic from build:
# TODO: duplicates the logic in build_common.ps1
$actualTfcSuffix = " _$ ( $modNameCanonical ) _DLCTFC_XPACK_"
$cookerOutputPath = [io.path ]::combine($sdkPath , ' XComGame' , ' Published' , ' CookedPCConsole' )
clean.ps1 is forced to use some flaky logic due to lack of access to project's ContentOptions.json
# This needs to be before $srcDirectory\BuildCache is deleted - otherwise we will miss our collection maps
# This is dumb, yes, but to fix this we need to rework how BuildProject is used from build.ps1 (and here)
CleanModAssetCookerOutput $sdkPath $modName @ (" $srcDirectory \$modName \ContentForCook" , " $srcDirectory \BuildCache\CollectionMaps" )
Fixing this however requires significantly changing how individual projects consume X2MBC (and some internal refactor of X2MBC)
cc @robojumper
The clean task is currently a separate script, which is already problematic:
clean_cooker_output.ps1had to be a separate file (it's called from both clean and build) and duplicates logic from build:X2ModBuildCommon/clean_cooker_output.ps1
Lines 6 to 8 in 9c81722
clean.ps1is forced to use some flaky logic due to lack of access to project'sContentOptions.jsonX2ModBuildCommon/clean.ps1
Lines 22 to 24 in 9c81722
Fixing this however requires significantly changing how individual projects consume X2MBC (and some internal refactor of X2MBC)
cc @robojumper