fix regression and recreate asset fo

This commit is contained in:
2026-08-06 00:49:21 +02:00
parent 370ee3aabf
commit e64d86ee03
2 changed files with 19 additions and 1 deletions

View File

@@ -41,7 +41,10 @@ class AssetMacro {
var manifestDir = outputDir + "/manifest";
var assetsOutputDir = outputDir + "/assets";
// Create directories if they don't exist
// These directories are owned by this macro. Recreate them so removed or
// renamed source assets cannot survive as stale build output.
removeDirectory(manifestDir);
removeDirectory(assetsOutputDir);
createDirectory(manifestDir);
createDirectory(assetsOutputDir);
copyLimeNativeLibrary(outputDir);
@@ -241,6 +244,20 @@ class AssetMacro {
}
}
private static function removeDirectory(path:String):Void {
if (!FileSystem.exists(path)) return;
for (entry in FileSystem.readDirectory(path)) {
var entryPath = path + "/" + entry;
if (FileSystem.isDirectory(entryPath)) {
removeDirectory(entryPath);
} else {
FileSystem.deleteFile(entryPath);
}
}
FileSystem.deleteDirectory(path);
}
/** Stage the Lime CFFI module that matches the selected haxelib version. */
private static function copyLimeNativeLibrary(outputDir:String):Void {
var platformDirectory = if (Context.defined("linux")) {