Fix embed for runtime-generated asset files

This commit is contained in:
Joshua Granick
2015-11-01 07:53:38 -08:00
parent ac544d8bb4
commit 573db646a3
10 changed files with 134 additions and 2 deletions

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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);

View File

@@ -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");

View File

@@ -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")) {

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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")) {