Do not modify manifest root path on asset copy, try and make Assets.loadLibrary a bit more flexible on paths

This commit is contained in:
Joshua Granick
2019-06-05 15:14:54 -07:00
parent ac6d5c281c
commit a2794c9dea
2 changed files with 4 additions and 3 deletions

View File

@@ -761,9 +761,8 @@ class ProjectXMLParser extends HXProject
if (manifest != null) if (manifest != null)
{ {
library = targetPath; library = targetPath;
manifest.rootPath = targetPath;
var asset = new Asset("", Path.combine(targetPath, "library.json"), AssetType.MANIFEST); var asset = new Asset(jsonPath, Path.combine(targetPath, "library.json"), AssetType.MANIFEST);
asset.id = "libraries/" + library + ".json"; asset.id = "libraries/" + library + ".json";
asset.library = library; asset.library = library;
asset.data = manifest.serialize(); asset.data = manifest.serialize();

View File

@@ -409,15 +409,17 @@ class Assets
if (libraryPaths.exists(id)) if (libraryPaths.exists(id))
{ {
path = libraryPaths[id]; path = libraryPaths[id];
rootPath = defaultRootPath; rootPath = (defaultRootPath != "" ? defaultRootPath + "/" : "") + Path.directory(path);
} }
else else
{ {
if (StringTools.endsWith(path, ".bundle")) if (StringTools.endsWith(path, ".bundle"))
{ {
rootPath = path;
path += "/library.json"; path += "/library.json";
} }
rootPath = (defaultRootPath != "" ? defaultRootPath + "/" : "") + Path.directory(path);
path = __cacheBreak(path); path = __cacheBreak(path);
} }