Improve finding of NDLL folder in tools

This commit is contained in:
Joshua Granick
2018-07-07 06:49:12 -07:00
parent 673d1cf014
commit b9b3121c29
2 changed files with 26 additions and 52 deletions

View File

@@ -512,68 +512,39 @@ class CommandLineTools {
if (FileSystem.exists ("tools.n")) {
path = PathHelper.combine (Sys.getCwd (), "../");
path = PathHelper.combine (Sys.getCwd (), "../ndll/");
} else if (FileSystem.exists ("run.n")) {
path = Sys.getCwd ();
path = Sys.getCwd () + "/ndll/";
}
if (path == "") {
var process = new Process ("haxelib", [ "path", "lime" ]);
var lines = new Array<String> ();
try {
while (true) {
var length = lines.length;
var line = StringTools.trim (process.stdout.readLine ());
trace (line);
if (StringTools.startsWith (line, "-L ")) {
if (length > 0 && (line == "-D lime" || StringTools.startsWith (line, "-D lime="))) {
path = StringTools.trim (lines[length - 1]);
path = StringTools.trim (line.substr (2));
break;
}
lines.push (line);
}
} catch (e:Dynamic) {
}
if (path == "") {
for (line in lines) {
if (line != "" && line.substr (0, 1) != "-") {
try {
if (FileSystem.exists (line)) {
path = line;
}
} catch (e:Dynamic) {}
}
}
}
process.close ();
}
path += "../ndll/";
switch (PlatformHelper.hostPlatform) {
case WINDOWS:

View File

@@ -26,36 +26,39 @@ class SVGExport {
var haxePath = Sys.getEnv ("HAXEPATH");
var command = (haxePath != null && haxePath != "") ? haxePath + "/haxelib" : "haxelib";
var process = new Process (command, [ "path", "lime" ]);
var path = "";
if (FileSystem.exists ("svg.n")) {
path = PathHelper.combine (Sys.getCwd (), "../ndll/");
}
if (path == "") {
var process = new Process ("haxelib", [ "path", "lime" ]);
try {
var lines = new Array<String> ();
while (true) {
var length = lines.length;
var line = StringTools.trim (process.stdout.readLine ());
trace (line);
if (StringTools.startsWith (line, "-L ")) {
if (length > 0 && (line == "-D lime" || StringTools.startsWith (line, "-D lime="))) {
path = StringTools.trim (lines[length - 1]);
path = StringTools.trim (line.substr (2));
break;
}
lines.push (line);
}
} catch (e:Dynamic) {
} catch (e:Dynamic) {}
process.close ();
}
path += "../ndll/";
switch (PlatformHelper.hostPlatform) {
case WINDOWS: