fix regression and recreate asset fo
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package;
|
||||
|
||||
import openfl.display.Sprite;
|
||||
import Assets; // Forces build(macros.AssetMacro.build()) to run.
|
||||
|
||||
class Main extends Sprite {
|
||||
public function new() {
|
||||
|
||||
@@ -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")) {
|
||||
|
||||
Reference in New Issue
Block a user