Allow fallback to alternate tools if setting HAXELIB_PATH in project

This commit is contained in:
Joshua Granick
2017-08-16 10:57:01 -07:00
parent f83c7e53bc
commit 041db4d98e
4 changed files with 53 additions and 5 deletions

View File

@@ -20,6 +20,8 @@ import utils.CreateTemplate;
import utils.JavaExternGenerator;
import utils.PlatformSetup;
@:access(lime.project.HXProject)
class CommandLineTools {
@@ -1695,6 +1697,30 @@ class CommandLineTools {
}
if (project != null && project.needRerun && !project.targetFlags.exists ("norerun")) {
HaxelibHelper.pathOverrides.remove ("lime");
var workingDirectory = Sys.getCwd ();
var limePath = HaxelibHelper.getPath (new Haxelib ("lime"), true, true);
Sys.setCwd (workingDirectory);
LogHelper.info ("", LogHelper.accentColor + "Requesting alternate tools from custom haxelib path...\x1b[0m\n\n");
var args = Sys.args ();
args.pop ();
Sys.setCwd (limePath);
args = [ PathHelper.combine (limePath, "run.n") ].concat (args);
args.push ("--haxelib-lime=" + limePath);
args.push ("-norerun");
args.push (workingDirectory);
Sys.exit (Sys.command ("neko", args));
return null;
}
if (project == null || (command != "rebuild" && project.sources.length == 0 && !FileSystem.exists (project.app.main + ".hx"))) {
LogHelper.error ("You must have a \"project.xml\" file or specify another valid project file when using the '" + command + "' command");