Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use absolute paths when running Lime. #1873

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions tools/RunScript.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,8 @@ import sys.FileSystem;

class RunScript
{
private static function rebuildTools(rebuildBinaries = true):Void
private static function rebuildTools(limeDirectory:String, toolsDirectory:String, rebuildBinaries = true):Void
{
var limeDirectory = Haxelib.getPath(new Haxelib("lime"), true);
var toolsDirectory = Path.combine(limeDirectory, "tools");

if (!FileSystem.exists(toolsDirectory))
{
toolsDirectory = Path.combine(limeDirectory, "../tools");
}

/*var extendedToolsDirectory = Haxelib.getPath (new Haxelib ("lime-extended"), false);

if (extendedToolsDirectory != null && extendedToolsDirectory != "") {
Expand Down Expand Up @@ -135,6 +127,15 @@ class RunScript
{
var args = Sys.args();

var limeDirectory = Haxelib.getPath(new Haxelib("lime"), true);
var toolsDirectory = Path.combine(limeDirectory, "tools");

if (!FileSystem.exists(toolsDirectory))
{
limeDirectory = Path.combine(limeDirectory, "..");
toolsDirectory = Path.combine(limeDirectory, "tools");
}

if (args.length > 2 && args[0] == "rebuild" && args[1] == "tools")
{
var lastArgument = new Path(args[args.length - 1]).toString();
Expand Down Expand Up @@ -187,7 +188,7 @@ class RunScript
}
}

rebuildTools(rebuildBinaries);
rebuildTools(limeDirectory, toolsDirectory, rebuildBinaries);

if (args.indexOf("-openfl") > -1)
{
Expand All @@ -207,21 +208,22 @@ class RunScript

var args = [
"-D", "lime",
"-cp", "tools",
"-cp", "tools/platforms",
"-cp", toolsDirectory,
"-cp", Path.combine(toolsDirectory, "platforms"),
"-cp", "src",
"-lib", "format",
"-lib", "hxp",
"--run", "CommandLineTools"].concat(args);
Sys.exit(runCommand("", "haxe", args));
}

if (!FileSystem.exists("tools/tools.n") || args.indexOf("-rebuild") > -1)
var tools_n = Path.combine(toolsDirectory, "tools.n");
if (!FileSystem.exists(tools_n) || args.indexOf("-rebuild") > -1)
{
rebuildTools();
rebuildTools(limeDirectory, toolsDirectory);
}

var args = ["tools/tools.n"].concat(args);
var args = [tools_n].concat(args);
Sys.exit(runCommand("", "neko", args));
}
}