Fix embed for runtime-generated asset files
This commit is contained in:
@@ -254,7 +254,20 @@ class AndroidPlatform extends PlatformTarget {
|
||||
|
||||
public override function update ():Void {
|
||||
|
||||
//project = project.clone ();
|
||||
project = project.clone ();
|
||||
|
||||
for (asset in project.assets) {
|
||||
|
||||
if (asset.embed && asset.sourcePath == "") {
|
||||
|
||||
var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath);
|
||||
PathHelper.mkdir (Path.directory (path));
|
||||
FileHelper.copyAsset (asset, path);
|
||||
asset.sourcePath = path;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//initialize (project);
|
||||
|
||||
|
||||
@@ -259,9 +259,22 @@ class BlackBerryPlatform extends PlatformTarget {
|
||||
|
||||
public override function update ():Void {
|
||||
|
||||
//project = project.clone ();
|
||||
project = project.clone ();
|
||||
//initialize (project);
|
||||
|
||||
for (asset in project.assets) {
|
||||
|
||||
if (asset.embed && asset.sourcePath == "") {
|
||||
|
||||
var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath);
|
||||
PathHelper.mkdir (Path.directory (path));
|
||||
FileHelper.copyAsset (asset, path);
|
||||
asset.sourcePath = path;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!project.targetFlags.exists ("html5")) {
|
||||
|
||||
for (asset in project.assets) {
|
||||
|
||||
@@ -244,6 +244,19 @@ class EmscriptenPlatform extends PlatformTarget {
|
||||
|
||||
project = project.clone ();
|
||||
|
||||
for (asset in project.assets) {
|
||||
|
||||
if (asset.embed && asset.sourcePath == "") {
|
||||
|
||||
var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath);
|
||||
PathHelper.mkdir (Path.directory (path));
|
||||
FileHelper.copyAsset (asset, path);
|
||||
asset.sourcePath = path;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (asset in project.assets) {
|
||||
|
||||
asset.resourceName = "assets/" + asset.resourceName;
|
||||
|
||||
@@ -368,6 +368,19 @@ class IOSPlatform extends PlatformTarget {
|
||||
|
||||
project = project.clone ();
|
||||
|
||||
for (asset in project.assets) {
|
||||
|
||||
if (asset.embed && asset.sourcePath == "") {
|
||||
|
||||
var path = PathHelper.combine (targetDirectory + "/" + project.app.file + "/obj/tmp", asset.targetPath);
|
||||
PathHelper.mkdir (Path.directory (path));
|
||||
FileHelper.copyAsset (asset, path);
|
||||
asset.sourcePath = path;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var manifest = new Asset ();
|
||||
manifest.id = "__manifest__";
|
||||
manifest.data = AssetHelper.createManifest (project);
|
||||
|
||||
@@ -300,6 +300,19 @@ class LinuxPlatform extends PlatformTarget {
|
||||
project = project.clone ();
|
||||
//initialize (project);
|
||||
|
||||
for (asset in project.assets) {
|
||||
|
||||
if (asset.embed && asset.sourcePath == "") {
|
||||
|
||||
var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath);
|
||||
PathHelper.mkdir (Path.directory (path));
|
||||
FileHelper.copyAsset (asset, path);
|
||||
asset.sourcePath = path;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (project.targetFlags.exists ("xml")) {
|
||||
|
||||
project.haxeflags.push ("-xml " + targetDirectory + "/types.xml");
|
||||
|
||||
@@ -282,6 +282,19 @@ class MacPlatform extends PlatformTarget {
|
||||
|
||||
}
|
||||
|
||||
for (asset in project.assets) {
|
||||
|
||||
if (asset.embed && asset.sourcePath == "") {
|
||||
|
||||
var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath);
|
||||
PathHelper.mkdir (Path.directory (path));
|
||||
FileHelper.copyAsset (asset, path);
|
||||
asset.sourcePath = path;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var context = generateContext ();
|
||||
|
||||
if (targetType == "cpp" && project.targetFlags.exists ("static")) {
|
||||
|
||||
@@ -335,6 +335,19 @@ class TVOSPlatform extends PlatformTarget {
|
||||
|
||||
project = project.clone ();
|
||||
|
||||
for (asset in project.assets) {
|
||||
|
||||
if (asset.embed && asset.sourcePath == "") {
|
||||
|
||||
var path = PathHelper.combine (targetDirectory + "/" + project.app.file + "/obj/tmp", asset.targetPath);
|
||||
PathHelper.mkdir (Path.directory (path));
|
||||
FileHelper.copyAsset (asset, path);
|
||||
asset.sourcePath = path;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var manifest = new Asset ();
|
||||
manifest.id = "__manifest__";
|
||||
manifest.data = AssetHelper.createManifest (project);
|
||||
|
||||
@@ -161,6 +161,20 @@ class TizenPlatform extends PlatformTarget {
|
||||
public override function update ():Void {
|
||||
|
||||
project = project.clone ();
|
||||
|
||||
for (asset in project.assets) {
|
||||
|
||||
if (asset.embed && asset.sourcePath == "") {
|
||||
|
||||
var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath);
|
||||
PathHelper.mkdir (Path.directory (path));
|
||||
FileHelper.copyAsset (asset, path);
|
||||
asset.sourcePath = path;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var destination = targetDirectory + "/bin/";
|
||||
PathHelper.mkdir (destination);
|
||||
|
||||
|
||||
@@ -142,6 +142,20 @@ class WebOSPlatform extends PlatformTarget {
|
||||
public override function update ():Void {
|
||||
|
||||
project = project.clone ();
|
||||
|
||||
for (asset in project.assets) {
|
||||
|
||||
if (asset.embed && asset.sourcePath == "") {
|
||||
|
||||
var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath);
|
||||
PathHelper.mkdir (Path.directory (path));
|
||||
FileHelper.copyAsset (asset, path);
|
||||
asset.sourcePath = path;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var destination = targetDirectory + "/bin/";
|
||||
PathHelper.mkdir (destination);
|
||||
|
||||
|
||||
@@ -275,6 +275,19 @@ class WindowsPlatform extends PlatformTarget {
|
||||
|
||||
}
|
||||
|
||||
for (asset in project.assets) {
|
||||
|
||||
if (asset.embed && asset.sourcePath == "") {
|
||||
|
||||
var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath);
|
||||
PathHelper.mkdir (Path.directory (path));
|
||||
FileHelper.copyAsset (asset, path);
|
||||
asset.sourcePath = path;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var context = generateContext ();
|
||||
|
||||
if (targetType == "cpp" && project.targetFlags.exists ("static")) {
|
||||
|
||||
Reference in New Issue
Block a user