Skip to content
Draft
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions docs/build.hx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ class Build extends Script
html5.define("html5");
html5.build();

System.runCommand("", "haxelib", [
System.runCommand("", "haxelib " + [
"run", "dox", "-i", "xml", "-in", "lime", "--title", "Lime API Reference", "-D", "source-path",
"https://github.com/openfl/lime/tree/develop/src/", "-D", "website", "http://lime.software", "-D", "logo", "/images/logo.png", "-D", "textColor",
"0x777777", "-theme", "../assets/docs-theme", "--toplevel-package", "lime"
]);
].join(" "));
}
}
2 changes: 1 addition & 1 deletion src/lime/_internal/macros/AssetsMacro.hx
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class AssetsMacro
if (path != null && path != "")
{
#if html5
Sys.command("haxelib", ["run", "lime", "generate", "-font-hash", sys.FileSystem.fullPath(path)]);
Sys.command("haxelib run lime generate -font-hash \"" + sys.FileSystem.fullPath(path) + "\"");
path += ".hash";
#end

Expand Down
2 changes: 1 addition & 1 deletion src/lime/system/CFFI.hx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class CFFI
#if (sys && !macro && !html5)
try
{
var proc = new Process("haxelib", ["path", library]);
var proc = new Process("haxelib path "+ library);

if (proc != null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/lime/tools/AssetHelper.hx
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class AssetHelper
for (handler in handlers)
{
var outputFile = System.getTemporaryFile();
var args = ["run", handler, "process", temporaryFile, outputFile];
var args = ["run", '"$handler"', "process", '"$temporaryFile"', '"$outputFile"'];

if (Log.verbose)
{
Expand All @@ -476,7 +476,7 @@ class AssetHelper

if (targetDirectory != null)
{
args.push("--targetDirectory=" + Path.tryFullPath(targetDirectory));
args.push("--targetDirectory=\"" + Path.tryFullPath(targetDirectory) + '"');
}

try
Expand Down
16 changes: 16 additions & 0 deletions src/lime/tools/CPPHelper.hx
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,24 @@ class CPPHelper
Sys.putEnv("HXCPP_COMPILE_THREADS", Std.string(threads));
}

var scoped = FileSystem.exists(".lime") && FileSystem.isDirectory(".lime");

if (scoped)
{
var localTemp = ".lime/temp";

System.recursiveCopy(path, localTemp);

path = localTemp;
}

Sys.putEnv("HXCPP_EXIT_ON_ERROR", "");

Haxelib.runCommand(path, args);

if (scoped)
{
System.removeDirectory(path);
}
}
}
4 changes: 2 additions & 2 deletions src/lime/tools/FlashHelper.hx
Original file line number Diff line number Diff line change
Expand Up @@ -743,13 +743,13 @@ class FlashHelper
// Have to daisy-chain it to fix Haxe compiler issue

args.push ("-swf-lib");
args.push (destination + "/.assets.swf");
args.push ("\"" + destination + "/.assets.swf\"");
args.push ("-D");
args.push ("flash-use-stage");

}

System.runCommand ("", "haxe", args);
System.runCommand ("", "haxe " + args.join(" "), null);

if (FileSystem.exists (destination + "/.assets.swf")) {

Expand Down
13 changes: 7 additions & 6 deletions src/lime/tools/HXProject.hx
Original file line number Diff line number Diff line change
Expand Up @@ -532,12 +532,13 @@ class HXProject extends Script
var tempDirectory = System.getTemporaryDirectory();
var classFile = Path.combine(tempDirectory, name + ".hx");
var nekoOutput = Path.combine(tempDirectory, name + ".n");
var hxpSourcesPath = Path.combine(Haxelib.getPath(new Haxelib("hxp")), "src");

System.copyFile(path, classFile);

#if lime
var args = [
name, "-main", "lime.tools.HXProject", "-cp", tempDirectory, "-neko", nekoOutput, "-cp", Path.combine(Haxelib.getPath(new Haxelib("hxp")), "src"),
name, "-main", "lime.tools.HXProject", "-cp", '"$tempDirectory"', "-neko", '"$nekoOutput"', "-cp", '"$hxpSourcesPath"',
"-lib", "lime", "-lib", "hxp"
];
#else
Expand All @@ -547,9 +548,9 @@ class HXProject extends Script
"-main",
"lime.tools.HXProject",
"-cp",
tempDirectory,
'"$tempDirectory"',
"-cp",
Path.combine(Haxelib.getPath(new Haxelib("hxp")), "src")
'"$hxpSourcesPath"'
];
#end
var input = File.read(classFile, false);
Expand All @@ -575,7 +576,7 @@ class HXProject extends Script
System.dryRun = false;

#if lime
System.runCommand("", "haxe", args);
System.runCommand("", "haxe " + args.join(" "), null);
#end

var inputFile = Path.combine(tempDirectory, "input.dat");
Expand All @@ -602,9 +603,9 @@ class HXProject extends Script
try
{
#if lime
System.runCommand("", "neko", [FileSystem.fullPath(nekoOutput), inputFile, outputFile]);
System.runCommand("", 'neko "${FileSystem.fullPath(nekoOutput)}" "$inputFile" "$outputFile"', null);
#else
System.runCommand("", "haxe", args.concat(["--", inputFile, outputFile]));
System.runCommand("", "haxe " + args.concat(["--", '"$inputFile"', '"$outputFile"']).join(" "), null);
#end
}
catch (e:Dynamic)
Expand Down
8 changes: 4 additions & 4 deletions src/lime/tools/ImageHelper.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class ImageHelper

try
{
System.runCommand("", "neko", [
System.runCommand("", "neko " + [
Path.combine(Haxelib.getPath(new Haxelib(#if lime "lime" #else "hxp" #end)), "svg.n"),
"process",
path,
'"$path"',
Std.string(width),
Std.string(height),
temp
], true, true);
'"$temp"'
].join(" "), null, true, true);

if (FileSystem.exists(temp))
{
Expand Down
2 changes: 1 addition & 1 deletion src/lime/tools/ModuleHelper.hx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class ModuleHelper
File.saveContent(importPath, moduleImport);
File.saveContent(hxmlPath, hxml);

System.runCommand("", "haxe", [hxmlPath]);
System.runCommand("", 'haxe "$hxmlPath"', null);

patchFile(outputPath);

Expand Down
24 changes: 14 additions & 10 deletions tools/CommandLineTools.hx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class CommandLineTools
var cacheValue = Sys.getEnv("HAXELIB_PATH");
Sys.putEnv("HAXELIB_PATH", Haxelib.getRepositoryPath());

System.runCommand(Path.directory(hxmlPath), "haxe", [Path.withoutDirectory(hxmlPath)]);
HXML.buildFile(hxmlPath, Sys.getCwd());

if (cacheValue != null)
{
Expand Down Expand Up @@ -437,7 +437,11 @@ class CommandLineTools

var path = "";

if (FileSystem.exists("tools.n"))
if (Path.normalize(Sys.getCwd()).substr(-6, 6) == "/.lime")
{
path = Path.combine(Sys.getCwd(), "/ndll/");
}
else if (FileSystem.exists("tools.n"))
{
path = Path.combine(Sys.getCwd(), "../ndll/");
}
Expand All @@ -448,7 +452,7 @@ class CommandLineTools

if (path == "")
{
var process = new Process("haxelib", ["path", "lime"]);
var process = new Process("haxelib path lime");

try
{
Expand Down Expand Up @@ -548,7 +552,7 @@ class CommandLineTools
var exePath = Path.join([targetDir, "run.exe"]);
var exeExists = FileSystem.exists(exePath);

var args = [command, temporaryFile];
var args = [command, '"$temporaryFile"'];

if (Log.verbose) args.push("-verbose");
if (!Log.enableColor) args.push("-nocolor");
Expand Down Expand Up @@ -1216,14 +1220,14 @@ class CommandLineTools
var sourcePath = words[0];
var glyphs = "32-255";

System.runCommand(Path.directory(sourcePath), "neko", [
Haxelib.getPath(new Haxelib("lime")) + "/templates/bin/hxswfml.n",
System.runCommand(Path.directory(sourcePath), "neko " + [
'"${Haxelib.getPath(new Haxelib("lime")) + "/templates/bin/hxswfml.n"}"',
"ttf2hash2",
Path.withoutDirectory(sourcePath),
Path.withoutDirectory(sourcePath) + ".hash",
'"${Path.withoutDirectory(sourcePath)}"',
'"${Path.withoutDirectory(sourcePath) + ".hash"}"',
"-glyphs",
glyphs
]);
].join(" "), null);
}
else if (targetFlags.exists("font-details"))
{
Expand Down Expand Up @@ -1643,7 +1647,7 @@ class CommandLineTools

try
{
var process = new Process("haxe", ["-version"]);
var process = new Process("haxe -version");
var haxeVersion = StringTools.trim(process.stderr.readAll().toString());

if (haxeVersion == "")
Expand Down
Loading