diff --git a/lime/project/HXProject.hx b/lime/project/HXProject.hx index 764dbb067..fec7bfef3 100644 --- a/lime/project/HXProject.hx +++ b/lime/project/HXProject.hx @@ -1087,9 +1087,9 @@ class HXProject { #if lime - if (PathHelper.haxelibOverrides.exists (name)) { + if (HaxelibHelper.pathOverrides.exists (name)) { - var param = "-cp " + PathHelper.haxelibOverrides.get (name); + var param = "-cp " + HaxelibHelper.pathOverrides.get (name); compilerFlags.remove (param); compilerFlags.push (param); diff --git a/lime/project/ProjectXMLParser.hx b/lime/project/ProjectXMLParser.hx index 41c4bfdac..40a345c7c 100644 --- a/lime/project/ProjectXMLParser.hx +++ b/lime/project/ProjectXMLParser.hx @@ -1188,7 +1188,7 @@ class ProjectXMLParser extends HXProject { if (element.has.haxelib) { haxelib = new Haxelib (substitute (element.att.haxelib)); - path = findIncludeFile (PathHelper.getHaxelib (haxelib, true)); + path = findIncludeFile (HaxelibHelper.getPath (haxelib, true)); addSourcePath = false; } else if (element.has.path) { @@ -1303,12 +1303,12 @@ class ProjectXMLParser extends HXProject { } - /*if (name == "nme" && defines.exists ("openfl")) { + if (version != "" && defines.exists (name) && defines.get (name) != version) { - name = "openfl-nme-compatibility"; - version = ""; + LogHelper.warn ("Ignoring requested haxelib \"" + name + "\" version " + version + " (version " + defines.get (name) + " was already included)"); + continue; - }*/ + } var haxelib = new Haxelib (name, version); @@ -1316,11 +1316,11 @@ class ProjectXMLParser extends HXProject { if (defines.exists ("setup")) { - path = PathHelper.getHaxelib (haxelib); + path = HaxelibHelper.getPath (haxelib); } else { - path = PathHelper.getHaxelib (haxelib, !optional); + path = HaxelibHelper.getPath (haxelib, !optional); if (optional && path == "") { @@ -1336,11 +1336,11 @@ class ProjectXMLParser extends HXProject { if (version != "") { - PathHelper.haxelibOverrides.set (name + ":" + version, path); + HaxelibHelper.pathOverrides.set (name + ":" + version, path); } else { - PathHelper.haxelibOverrides.set (name, path); + HaxelibHelper.pathOverrides.set (name, path); } @@ -1684,7 +1684,7 @@ class ProjectXMLParser extends HXProject { if (element.has.haxelib) { - var haxelibPath = PathHelper.getHaxelib (new Haxelib (substitute (element.att.haxelib)), true); + var haxelibPath = HaxelibHelper.getPath (new Haxelib (substitute (element.att.haxelib)), true); var path = PathHelper.combine (haxelibPath, substitute (element.att.path)); templatePaths.push (path); @@ -2198,7 +2198,7 @@ class ProjectXMLParser extends HXProject { if (string.substr (0, 8) == "haxelib:") { - var path = PathHelper.getHaxelib (new Haxelib (string.substr (8)), true); + var path = HaxelibHelper.getPath (new Haxelib (string.substr (8)), true); return PathHelper.standardize (path); } else if (defines.exists (string)) { diff --git a/lime/tools/helpers/HaxelibHelper.hx b/lime/tools/helpers/HaxelibHelper.hx index f76d1b105..642c8d1af 100644 --- a/lime/tools/helpers/HaxelibHelper.hx +++ b/lime/tools/helpers/HaxelibHelper.hx @@ -2,7 +2,9 @@ package lime.tools.helpers; import haxe.Json; +import lime.project.Architecture; import lime.project.Haxelib; +import lime.project.Platform; import sys.io.File; import sys.FileSystem; @@ -10,21 +12,222 @@ import sys.FileSystem; class HaxelibHelper { - public static function getVersion (haxelib:Haxelib = null):String { + public static var pathOverrides = new Map (); + + private static var repositoryPath:String; + private static var paths = new Map (); + private static var versions = new Map (); + + + public static function getRepositoryPath ():String { - if (haxelib == null) { + if (repositoryPath == null) { - haxelib = new Haxelib ("lime"); + var cache = LogHelper.verbose; + LogHelper.verbose = false; + var output = ""; + + try { + + var cacheDryRun = ProcessHelper.dryRun; + ProcessHelper.dryRun = false; + + output = ProcessHelper.runProcess (Sys.getEnv ("HAXEPATH"), "haxelib", [ "config" ], true, true, true); + if (output == null) output = ""; + + ProcessHelper.dryRun = cacheDryRun; + + } catch (e:Dynamic) { } + + LogHelper.verbose = cache; + + repositoryPath = StringTools.trim (output); + + } + + return repositoryPath; + + } + + + public static function getPath (haxelib:Haxelib, validate:Bool = false, clearCache:Bool = false):String { + + var name = haxelib.name; + + if (pathOverrides.exists (name)) { + + if (!versions.exists (name)) { + + versions.set (name, getPathVersion (pathOverrides.get (name))); + + } + + return pathOverrides.get (name); } if (haxelib.version != "") { - return haxelib.version; + name += ":" + haxelib.version; } - var path = PathHelper.getHaxelib (haxelib, true) + "/haxelib.json"; + if (pathOverrides.exists (name)) { + + if (!versions.exists (name)) { + + versions.set (haxelib.name, haxelib.version); + versions.set (name, haxelib.version); + + } + + return pathOverrides.get (name); + + } + + if (clearCache) { + + paths.remove (name); + versions.remove (name); + + } + + if (!paths.exists (name)) { + + var libraryPath = PathHelper.combine (getRepositoryPath (), haxelib.name); + var result = ""; + + if (FileSystem.exists (libraryPath)) { + + var devPath = PathHelper.combine (libraryPath, ".dev"); + var currentPath = PathHelper.combine (libraryPath, ".current"); + + if (haxelib.version != "") { + + if (FileSystem.exists (devPath)) { + + result = StringTools.trim (File.getContent (devPath)); + + if (!FileSystem.exists (result) || getPathVersion (result) != haxelib.version) { + + result = PathHelper.combine (libraryPath, StringTools.replace (haxelib.version, ".", ",")); + + } + + } else { + + result = PathHelper.combine (libraryPath, StringTools.replace (haxelib.version, ".", ",")); + + } + + } else { + + if (FileSystem.exists (devPath)) { + + result = StringTools.trim (File.getContent (devPath)); + + } else { + + result = StringTools.trim (File.getContent (currentPath)); + result = PathHelper.combine (libraryPath, StringTools.replace (result, ".", ",")); + + } + + } + + if (!FileSystem.exists (result)) result = ""; + + } + + if (validate && result == "") { + + if (haxelib.version != "") { + + LogHelper.error ("Could not find haxelib \"" + haxelib.name + "\" version \"" + haxelib.version + "\", does it need to be installed?"); + + } else { + + LogHelper.error ("Could not find haxelib \"" + haxelib.name + "\", does it need to be installed?"); + + } + + } + + // if (validate) { + + // if (result == "") { + + // if (output.indexOf ("does not have") > -1) { + + // var directoryName = ""; + + // if (PlatformHelper.hostPlatform == Platform.WINDOWS) { + + // directoryName = "Windows"; + + // } else if (PlatformHelper.hostPlatform == Platform.MAC) { + + // directoryName = PlatformHelper.hostArchitecture == Architecture.X64 ? "Mac64" : "Mac"; + + // } else { + + // directoryName = PlatformHelper.hostArchitecture == Architecture.X64 ? "Linux64" : "Linux"; + + // } + + // LogHelper.error ("haxelib \"" + haxelib.name + "\" does not have an \"ndll/" + directoryName + "\" directory"); + + // } else if (output.indexOf ("haxelib install ") > -1 && output.indexOf ("haxelib install " + haxelib.name) == -1) { + + // var start = output.indexOf ("haxelib install ") + 16; + // var end = output.lastIndexOf ("'"); + // var dependencyName = output.substring (start, end); + + // LogHelper.error ("Could not find haxelib \"" + dependencyName + "\" (dependency of \"" + haxelib.name + "\"), does it need to be installed?"); + + // } else { + + // if (haxelib.version != "") { + + // LogHelper.error ("Could not find haxelib \"" + haxelib.name + "\" version \"" + haxelib.version + "\", does it need to be installed?"); + + // } else { + + // LogHelper.error ("Could not find haxelib \"" + haxelib.name + "\", does it need to be installed?"); + + // } + + // } + + // } + + // } + + paths.set (name, result); + + if (haxelib.version != "") { + + paths.set (haxelib.name, result); + + versions.set (name, haxelib.version); + versions.set (haxelib.name, haxelib.version); + + } else { + + versions.set (name, getPathVersion (result)); + + } + + } + + return paths.get (name); + + } + + + public static function getPathVersion (path:String):String { + + path = PathHelper.combine (path, "haxelib.json"); if (FileSystem.exists (path)) { @@ -38,4 +241,47 @@ class HaxelibHelper { } + public static function getVersion (haxelib:Haxelib = null):String { + + var clearCache = false; + + if (haxelib == null) { + + haxelib = new Haxelib ("lime"); + clearCache = true; + + } + + if (haxelib.version != "") { + + return haxelib.version; + + } + + getPath (haxelib, true, clearCache); + + return versions.get (haxelib.name); + + } + + + public static function setOverridePath (haxelib:Haxelib, path:String):Void { + + var name = haxelib.name; + var version = haxelib.version; + + if (version == "") { + + version = getPathVersion (path); + + } + + pathOverrides.set (name, path); + pathOverrides.set (name + ":" + version, path); + versions.set (name, version); + versions.set (name + ":" + version, version); + + } + + } \ No newline at end of file diff --git a/lime/tools/helpers/PathHelper.hx b/lime/tools/helpers/PathHelper.hx index 4ba6d1140..8a558cce0 100644 --- a/lime/tools/helpers/PathHelper.hx +++ b/lime/tools/helpers/PathHelper.hx @@ -15,11 +15,6 @@ import sys.FileSystem; class PathHelper { - public static var haxelibOverrides = new Map (); - - private static var haxelibPaths = new Map (); - - public static function combine (firstPath:String, secondPath:String):String { if (firstPath == null || firstPath == "") { @@ -244,145 +239,7 @@ class PathHelper { public static function getHaxelib (haxelib:Haxelib, validate:Bool = false, clearCache:Bool = false):String { - var name = haxelib.name; - - if (haxelibOverrides.exists (name)) { - - return haxelibOverrides.get (name); - - } - - if (haxelib.version != "") { - - name += ":" + haxelib.version; - - } - - if (haxelibOverrides.exists (name)) { - - return haxelibOverrides.get (name); - - } - - if (clearCache) { - - haxelibPaths.remove (name); - - } - - if (!haxelibPaths.exists (name)) { - - var cache = LogHelper.verbose; - LogHelper.verbose = false; - var output = ""; - - try { - - var cacheDryRun = ProcessHelper.dryRun; - ProcessHelper.dryRun = false; - - output = ProcessHelper.runProcess (Sys.getEnv ("HAXEPATH"), "haxelib", [ "path", name ], true, true, true); - if (output == null) output = ""; - - ProcessHelper.dryRun = cacheDryRun; - - } catch (e:Dynamic) { } - - LogHelper.verbose = cache; - - var lines = output.split ("\n"); - var result = ""; - - for (i in 1...lines.length) { - - var trim = StringTools.trim (lines[i]); - - if (trim == "-D " + haxelib.name || StringTools.startsWith (trim, "-D " + haxelib.name + "=")) { - - result = StringTools.trim (lines[i - 1]); - - } - - } - - if (result == "") { - - try { - - for (line in lines) { - - if (line != "" && line.substr (0, 1) != "-") { - - if (FileSystem.exists (line)) { - - result = line; - break; - - } - - } - - } - - } catch (e:Dynamic) {} - - } - - if (validate) { - - if (result == "") { - - if (output.indexOf ("does not have") > -1) { - - var directoryName = ""; - - if (PlatformHelper.hostPlatform == Platform.WINDOWS) { - - directoryName = "Windows"; - - } else if (PlatformHelper.hostPlatform == Platform.MAC) { - - directoryName = PlatformHelper.hostArchitecture == Architecture.X64 ? "Mac64" : "Mac"; - - } else { - - directoryName = PlatformHelper.hostArchitecture == Architecture.X64 ? "Linux64" : "Linux"; - - } - - LogHelper.error ("haxelib \"" + haxelib.name + "\" does not have an \"ndll/" + directoryName + "\" directory"); - - } else if (output.indexOf ("haxelib install ") > -1 && output.indexOf ("haxelib install " + haxelib.name) == -1) { - - var start = output.indexOf ("haxelib install ") + 16; - var end = output.lastIndexOf ("'"); - var dependencyName = output.substring (start, end); - - LogHelper.error ("Could not find haxelib \"" + dependencyName + "\" (dependency of \"" + haxelib.name + "\"), does it need to be installed?"); - - } else { - - if (haxelib.version != "") { - - LogHelper.error ("Could not find haxelib \"" + haxelib.name + "\" version \"" + haxelib.version + "\", does it need to be installed?"); - - } else { - - LogHelper.error ("Could not find haxelib \"" + haxelib.name + "\", does it need to be installed?"); - - } - - } - - } - - } - - haxelibPaths.set (name, result); - - } - - return haxelibPaths.get (name); + return HaxelibHelper.getPath (haxelib, validate, clearCache); } diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx index 1fa3d4f0b..11c6dcab0 100644 --- a/tools/CommandLineTools.hx +++ b/tools/CommandLineTools.hx @@ -59,7 +59,7 @@ class CommandLineTools { overrides = new HXProject (); overrides.architectures = []; - PathHelper.haxelibOverrides.set ("lime-tools", PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("lime")), "tools")); + HaxelibHelper.setOverridePath (new Haxelib ("lime-tools"), PathHelper.combine (HaxelibHelper.getPath (new Haxelib ("lime")), "tools")); processArguments (); version = HaxelibHelper.getVersion (); @@ -141,7 +141,7 @@ class CommandLineTools { if (words.length == 1) { - var haxelibPath = PathHelper.getHaxelib (new Haxelib (words[0]), false); + var haxelibPath = HaxelibHelper.getPath (new Haxelib (words[0]), false); if (haxelibPath != "" && haxelibPath != null) { @@ -215,7 +215,7 @@ class CommandLineTools { } - var haxelibPath = PathHelper.getHaxelib (new Haxelib (words[0])); + var haxelibPath = HaxelibHelper.getPath (new Haxelib (words[0])); if (!FileSystem.exists (path) && haxelibPath != null) { @@ -227,7 +227,7 @@ class CommandLineTools { if (haxelib != null) { - var haxelibPath = PathHelper.getHaxelib (haxelib, true); + var haxelibPath = HaxelibHelper.getPath (haxelib, true); hxmlPath = PathHelper.combine (haxelibPath, "rebuild.hxml"); } @@ -318,11 +318,11 @@ class CommandLineTools { if (project == null) { project = new HXProject (); - project.config.set ("project.rebuild.path", PathHelper.combine (PathHelper.getHaxelib (haxelib), "project")); + project.config.set ("project.rebuild.path", PathHelper.combine (HaxelibHelper.getPath (haxelib), "project")); } else { - project.config.set ("project.rebuild.path", PathHelper.combine (PathHelper.getHaxelib (haxelib), project.config.get ("project.rebuild.path"))); + project.config.set ("project.rebuild.path", PathHelper.combine (HaxelibHelper.getPath (haxelib), project.config.get ("project.rebuild.path"))); } @@ -579,7 +579,7 @@ class CommandLineTools { var temporaryFile = PathHelper.getTemporaryFile (); File.saveContent (temporaryFile, projectData); - var targetDir = PathHelper.getHaxelib (new Haxelib (handler)); + var targetDir = HaxelibHelper.getPath (new Haxelib (handler)); var exePath = Path.join ([targetDir, "run.exe"]); var exeExists = FileSystem.exists (exePath); @@ -770,7 +770,7 @@ class CommandLineTools { CreateTemplate.createSample (words, userDefines); - } else if (PathHelper.getHaxelib (new Haxelib (projectName)) != "") { + } else if (HaxelibHelper.getPath (new Haxelib (projectName)) != "") { CreateTemplate.listSamples (projectName, userDefines); @@ -1046,7 +1046,7 @@ class CommandLineTools { var sourcePath = words[0]; var glyphs = "32-255"; - ProcessHelper.runCommand (Path.directory (sourcePath), "neko", [ PathHelper.getHaxelib (new Haxelib ("lime")) + "/templates/bin/hxswfml.n", "ttf2hash2", Path.withoutDirectory (sourcePath), Path.withoutDirectory (sourcePath) + ".hash", "-glyphs", glyphs ]); + ProcessHelper.runCommand (Path.directory (sourcePath), "neko", [ HaxelibHelper.getPath (new Haxelib ("lime")) + "/templates/bin/hxswfml.n", "ttf2hash2", Path.withoutDirectory (sourcePath), Path.withoutDirectory (sourcePath) + ".hash", "-glyphs", glyphs ]); } else if (targetFlags.exists ("font-details")) { @@ -1634,7 +1634,7 @@ class CommandLineTools { if (haxelib.name == "openfl") { - PathHelper.haxelibOverrides.set ("openfl", PathHelper.getHaxelib (haxelib)); + HaxelibHelper.setOverridePath (haxelib, HaxelibHelper.getPath (haxelib)); } @@ -1644,15 +1644,29 @@ class CommandLineTools { LogHelper.info ("", LogHelper.accentColor + "Requesting tools version " + getToolsVersion (haxelib.version) + "...\x1b[0m"); - var path = PathHelper.getHaxelib (haxelib); + var path = HaxelibHelper.getPath (haxelib); var args = Sys.args (); var workingDirectory = args.pop (); - args.push ("--haxelib-lime=" + path); + + for (haxelib in project.haxelibs) { + + args.push ("--haxelib-" + haxelib.name + "=" + HaxelibHelper.getPath (haxelib)); + + } + args.push ("-notoolscheck"); - var args = [ "run", "lime:" + haxelib.version ].concat (args); - Sys.exit (Sys.command ("haxelib", args)); + Sys.setCwd (path); + var args = [ PathHelper.combine (path, "run.n") ].concat (args); + args.push (workingDirectory); + + //trace (args); + + Sys.exit (Sys.command ("neko", args)); + + //var args = [ "run", "lime:" + haxelib.version ].concat (args); + //Sys.exit (Sys.command ("haxelib", args)); } else { @@ -1814,11 +1828,11 @@ class CommandLineTools { if (FileSystem.exists ("tools.n")) { - PathHelper.haxelibOverrides.set ("lime", PathHelper.combine (Sys.getCwd (), "../")); + HaxelibHelper.setOverridePath (new Haxelib ("lime"), PathHelper.combine (Sys.getCwd (), "../")); } else if (FileSystem.exists ("run.n")) { - PathHelper.haxelibOverrides.set ("lime", Sys.getCwd ()); + HaxelibHelper.setOverridePath (new Haxelib ("lime"), Sys.getCwd ()); } @@ -1888,7 +1902,7 @@ class CommandLineTools { } else if (StringTools.startsWith (field, "haxelib-")) { var name = field.substr (8); - PathHelper.haxelibOverrides.set (name, PathHelper.tryFullPath (argValue)); + HaxelibHelper.setOverridePath (new Haxelib (name), PathHelper.tryFullPath (argValue)); } else if (field == "source") { @@ -2125,7 +2139,7 @@ class CommandLineTools { } var haxelib = new Haxelib (name); - var path = PathHelper.getHaxelib (haxelib); + var path = HaxelibHelper.getPath (haxelib); switch (command) { diff --git a/tools/RunScript.hx b/tools/RunScript.hx index 0dca9fd90..e116ee14b 100644 --- a/tools/RunScript.hx +++ b/tools/RunScript.hx @@ -18,9 +18,9 @@ class RunScript { private static function rebuildTools (rebuildBinaries = true):Void { - var limeDirectory = PathHelper.getHaxelib (new Haxelib ("lime"), true); + var limeDirectory = HaxelibHelper.getPath (new Haxelib ("lime"), true); var toolsDirectory = PathHelper.combine (limeDirectory, "tools"); - /*var extendedToolsDirectory = PathHelper.getHaxelib (new Haxelib ("lime-extended"), false); + /*var extendedToolsDirectory = HaxelibHelper.getPath (new Haxelib ("lime-extended"), false); if (extendedToolsDirectory != null && extendedToolsDirectory != "") { diff --git a/tools/utils/CreateTemplate.hx b/tools/utils/CreateTemplate.hx index 280e4da74..cedca046a 100644 --- a/tools/utils/CreateTemplate.hx +++ b/tools/utils/CreateTemplate.hx @@ -2,6 +2,7 @@ package utils; import lime.tools.helpers.FileHelper; +import lime.tools.helpers.HaxelibHelper; import lime.tools.helpers.LogHelper; import lime.tools.helpers.PathHelper; import lime.project.Haxelib; @@ -41,7 +42,7 @@ class CreateTemplate { context.ANDROID_GRADLE_PLUGIN = "::ANDROID_GRADLE_PLUGIN::"; PathHelper.mkdir (title); - FileHelper.recursiveCopyTemplate ([ PathHelper.getHaxelib (new Haxelib ("lime"), true) + "/templates" ], "extension", title, context); + FileHelper.recursiveCopyTemplate ([ HaxelibHelper.getPath (new Haxelib ("lime"), true) + "/templates" ], "extension", title, context); if (FileSystem.exists (title + "/Extension.hx")) { diff --git a/tools/utils/PlatformSetup.hx b/tools/utils/PlatformSetup.hx index e878403ac..fcafd94bc 100644 --- a/tools/utils/PlatformSetup.hx +++ b/tools/utils/PlatformSetup.hx @@ -8,6 +8,7 @@ import haxe.zip.Reader; import lime.tools.helpers.BlackBerryHelper; import lime.tools.helpers.CLIHelper; import lime.tools.helpers.FileHelper; +import lime.tools.helpers.HaxelibHelper; import lime.tools.helpers.LogHelper; import lime.tools.helpers.PathHelper; import lime.tools.helpers.PlatformHelper; @@ -784,7 +785,7 @@ class PlatformSetup { if (PlatformHelper.hostPlatform != Platform.WINDOWS && FileSystem.exists (Sys.getEnv ("HOME") + "/.android")) { ProcessHelper.runCommand ("", "chmod", [ "-R", "777", "~/.android" ], false); - ProcessHelper.runCommand ("", "cp", [ PathHelper.getHaxelib (new Haxelib ("lime")) + "/templates/bin/debug.keystore", "~/.android/debug.keystore" ], false); + ProcessHelper.runCommand ("", "cp", [ HaxelibHelper.getPath (new Haxelib ("lime")) + "/templates/bin/debug.keystore", "~/.android/debug.keystore" ], false); } @@ -1445,7 +1446,7 @@ class PlatformSetup { basePath = StringTools.trim (basePath.split ("\n")[0]); } - var lib = PathHelper.getHaxelib (haxelib, false, true); + var lib = HaxelibHelper.getPath (haxelib, false, true); if (lib != null && !StringTools.startsWith (PathHelper.standardize (lib), PathHelper.standardize (basePath))) { defines.set ("dev", 1); @@ -1460,7 +1461,7 @@ class PlatformSetup { if (setupHaxelibs.exists (lib.name)) continue; - var path = PathHelper.getHaxelib (lib, false, true); + var path = HaxelibHelper.getPath (lib, false, true); if (path == null || path == "" || (lib.version != null && lib.version != "")) { @@ -1623,8 +1624,8 @@ class PlatformSetup { } - try { File.copy (PathHelper.getHaxelib (new Haxelib ("lime")) + "\\templates\\\\bin\\lime.exe", haxePath + "\\lime.exe"); } catch (e:Dynamic) {} - try { File.copy (PathHelper.getHaxelib (new Haxelib ("lime")) + "\\templates\\\\bin\\lime.sh", haxePath + "\\lime"); } catch (e:Dynamic) {} + try { File.copy (HaxelibHelper.getPath (new Haxelib ("lime")) + "\\templates\\\\bin\\lime.exe", haxePath + "\\lime.exe"); } catch (e:Dynamic) {} + try { File.copy (HaxelibHelper.getPath (new Haxelib ("lime")) + "\\templates\\\\bin\\lime.sh", haxePath + "\\lime"); } catch (e:Dynamic) {} } else { @@ -1651,7 +1652,7 @@ class PlatformSetup { try { - ProcessHelper.runCommand ("", "sudo", [ "cp", "-f", PathHelper.getHaxelib (new Haxelib ("lime")) + "/templates/bin/lime.sh", "/usr/local/bin/lime" ], false); + ProcessHelper.runCommand ("", "sudo", [ "cp", "-f", HaxelibHelper.getPath (new Haxelib ("lime")) + "/templates/bin/lime.sh", "/usr/local/bin/lime" ], false); ProcessHelper.runCommand ("", "sudo", [ "chmod", "755", "/usr/local/bin/lime" ], false); installedCommand = true; @@ -1667,7 +1668,7 @@ class PlatformSetup { Sys.println (" a) Manually add an alias called \"lime\" to run \"haxelib run lime\""); Sys.println (" b) Run the following commands:"); Sys.println (""); - Sys.println ("sudo cp \"" + PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("lime")), "templates/bin/lime.sh") + "\" /usr/local/bin/lime"); + Sys.println ("sudo cp \"" + PathHelper.combine (HaxelibHelper.getPath (new Haxelib ("lime")), "templates/bin/lime.sh") + "\" /usr/local/bin/lime"); Sys.println ("sudo chmod 755 /usr/local/bin/lime"); Sys.println (""); @@ -1817,10 +1818,10 @@ class PlatformSetup { } - try { File.copy (PathHelper.getHaxelib (new Haxelib ("lime")) + "\\templates\\\\bin\\lime.exe", haxePath + "\\lime.exe"); } catch (e:Dynamic) {} - try { File.copy (PathHelper.getHaxelib (new Haxelib ("lime")) + "\\templates\\\\bin\\lime.sh", haxePath + "\\lime"); } catch (e:Dynamic) {} - try { File.copy (PathHelper.getHaxelib (new Haxelib ("openfl")) + "\\templates\\\\bin\\openfl.exe", haxePath + "\\openfl.exe"); } catch (e:Dynamic) {} - try { File.copy (PathHelper.getHaxelib (new Haxelib ("openfl")) + "\\templates\\\\bin\\openfl.sh", haxePath + "\\openfl"); } catch (e:Dynamic) {} + try { File.copy (HaxelibHelper.getPath (new Haxelib ("lime")) + "\\templates\\\\bin\\lime.exe", haxePath + "\\lime.exe"); } catch (e:Dynamic) {} + try { File.copy (HaxelibHelper.getPath (new Haxelib ("lime")) + "\\templates\\\\bin\\lime.sh", haxePath + "\\lime"); } catch (e:Dynamic) {} + try { File.copy (HaxelibHelper.getPath (new Haxelib ("openfl")) + "\\templates\\\\bin\\openfl.exe", haxePath + "\\openfl.exe"); } catch (e:Dynamic) {} + try { File.copy (HaxelibHelper.getPath (new Haxelib ("openfl")) + "\\templates\\\\bin\\openfl.sh", haxePath + "\\openfl"); } catch (e:Dynamic) {} } else { @@ -1847,9 +1848,9 @@ class PlatformSetup { try { - ProcessHelper.runCommand ("", "sudo", [ "cp", "-f", PathHelper.getHaxelib (new Haxelib ("lime")) + "/templates/bin/lime.sh", "/usr/local/bin/lime" ], false); + ProcessHelper.runCommand ("", "sudo", [ "cp", "-f", HaxelibHelper.getPath (new Haxelib ("lime")) + "/templates/bin/lime.sh", "/usr/local/bin/lime" ], false); ProcessHelper.runCommand ("", "sudo", [ "chmod", "755", "/usr/local/bin/lime" ], false); - ProcessHelper.runCommand ("", "sudo", [ "cp", "-f", PathHelper.getHaxelib (new Haxelib ("openfl")) + "/templates/bin/openfl.sh", "/usr/local/bin/openfl" ], false); + ProcessHelper.runCommand ("", "sudo", [ "cp", "-f", HaxelibHelper.getPath (new Haxelib ("openfl")) + "/templates/bin/openfl.sh", "/usr/local/bin/openfl" ], false); ProcessHelper.runCommand ("", "sudo", [ "chmod", "755", "/usr/local/bin/openfl" ], false); installedCommand = true; @@ -1865,9 +1866,9 @@ class PlatformSetup { Sys.println (" a) Manually add an alias called \"openfl\" to run \"haxelib run openfl\""); Sys.println (" b) Run the following commands:"); Sys.println (""); - Sys.println ("sudo cp \"" + PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("lime")), "templates/bin/lime.sh") + "\" /usr/local/bin/lime"); + Sys.println ("sudo cp \"" + PathHelper.combine (HaxelibHelper.getPath (new Haxelib ("lime")), "templates/bin/lime.sh") + "\" /usr/local/bin/lime"); Sys.println ("sudo chmod 755 /usr/local/bin/lime"); - Sys.println ("sudo cp \"" + PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("openfl")), "templates/bin/openfl.sh") + "\" /usr/local/bin/openfl"); + Sys.println ("sudo cp \"" + PathHelper.combine (HaxelibHelper.getPath (new Haxelib ("openfl")), "templates/bin/openfl.sh") + "\" /usr/local/bin/openfl"); Sys.println ("sudo chmod 755 /usr/local/bin/openfl"); Sys.println (""); @@ -2082,7 +2083,7 @@ class PlatformSetup { } - var lib = PathHelper.getHaxelib (haxelib, false, true); + var lib = HaxelibHelper.getPath (haxelib, false, true); if (StringTools.startsWith (PathHelper.standardize (lib), PathHelper.standardize (basePath))) {