diff --git a/docs/api/build.hx b/docs/api/build.hx index c290d3a6c..b0fb9c8b8 100644 --- a/docs/api/build.hx +++ b/docs/api/build.hx @@ -1,8 +1,6 @@ -import hxp.ProcessHelper; -import hxp.HXML; -import sys.io.File; +import hxp.*; -class Build extends hxp.Script { +class Build extends Script { public function new () { @@ -57,7 +55,7 @@ class Build extends hxp.Script { html5.define ("html5"); html5.build (); - ProcessHelper.runCommand ("", "haxelib", [ "run", "dox", "-i", "xml", "-in", "lime", "--title", "Lime API Reference", "-D", "website", "http://lime.software", "-D", "logo", "/images/logo.png", "-D", "textColor", "0x777777", "-theme", "../../assets/docs-theme", "--toplevel-package", "lime" ]); + System.runCommand ("", "haxelib", [ "run", "dox", "-i", "xml", "-in", "lime", "--title", "Lime API Reference", "-D", "website", "http://lime.software", "-D", "logo", "/images/logo.png", "-D", "textColor", "0x777777", "-theme", "../../assets/docs-theme", "--toplevel-package", "lime" ]); } diff --git a/src/lime/tools/AIRHelper.hx b/src/lime/tools/AIRHelper.hx index f56fb3b12..5747d10c0 100644 --- a/src/lime/tools/AIRHelper.hx +++ b/src/lime/tools/AIRHelper.hx @@ -1,7 +1,7 @@ package lime.tools; -import haxe.io.Path; +import hxp.Path; import hxp.*; import sys.FileSystem; @@ -74,7 +74,7 @@ class AIRHelper { if (project.keystore != null) { - var keystore = PathHelper.tryFullPath (project.keystore.path); + var keystore = Path.tryFullPath (project.keystore.path); var keystoreType = project.keystore.type != null ? project.keystore.type : "pkcs12"; signingOptions.push ("-storetype"); @@ -108,7 +108,7 @@ class AIRHelper { signingOptions.push ("-storetype"); signingOptions.push ("pkcs12"); signingOptions.push ("-keystore"); - signingOptions.push (PathHelper.findTemplate (project.templatePaths, "air/debug.pfx")); + signingOptions.push (System.findTemplate (project.templatePaths, "air/debug.pfx")); signingOptions.push ("-storepass"); signingOptions.push ("samplePassword"); @@ -160,7 +160,7 @@ class AIRHelper { args = args.concat ([ targetPath + extension, applicationXML ]); - if (targetPlatform == IOS && PlatformHelper.hostPlatform == MAC && project.targetFlags.exists ("simulator")) { + if (targetPlatform == IOS && System.hostPlatform == MAC && project.targetFlags.exists ("simulator")) { args.push ("-platformsdk"); args.push (IOSHelper.getSDKDirectory (project)); @@ -201,7 +201,7 @@ class AIRHelper { } - ProcessHelper.runCommand (workingDirectory, project.defines.get ("AIR_SDK") + "/bin/adt", args); + System.runCommand (workingDirectory, project.defines.get ("AIR_SDK") + "/bin/adt", args); return targetPath + extension; @@ -248,13 +248,13 @@ class AIRHelper { args.push ("-platformsdk"); args.push (IOSHelper.getSDKDirectory (project)); - ProcessHelper.runCommand ("", "killall", [ "iPhone Simulator" ], true, true); + System.runCommand ("", "killall", [ "iPhone Simulator" ], true, true); } - ProcessHelper.runCommand (workingDirectory, project.defines.get ("AIR_SDK") + "/bin/adt", [ "-uninstallApp" ].concat (args).concat ([ "-appid", project.meta.packageName ]), true, true); - ProcessHelper.runCommand (workingDirectory, project.defines.get ("AIR_SDK") + "/bin/adt", [ "-installApp" ].concat (args).concat ([ "-package", FileSystem.fullPath (workingDirectory) + "/" + (rootDirectory != null ? rootDirectory + "/" : "") + project.app.file + ".ipa" ])); - ProcessHelper.runCommand (workingDirectory, project.defines.get ("AIR_SDK") + "/bin/adt", [ "-launchApp" ].concat (args).concat ([ "-appid", project.meta.packageName ]), true, true); + System.runCommand (workingDirectory, project.defines.get ("AIR_SDK") + "/bin/adt", [ "-uninstallApp" ].concat (args).concat ([ "-appid", project.meta.packageName ]), true, true); + System.runCommand (workingDirectory, project.defines.get ("AIR_SDK") + "/bin/adt", [ "-installApp" ].concat (args).concat ([ "-package", FileSystem.fullPath (workingDirectory) + "/" + (rootDirectory != null ? rootDirectory + "/" : "") + project.app.file + ".ipa" ])); + System.runCommand (workingDirectory, project.defines.get ("AIR_SDK") + "/bin/adt", [ "-launchApp" ].concat (args).concat ([ "-appid", project.meta.packageName ]), true, true); if (project.targetFlags.exists ("simulator")) { @@ -266,7 +266,7 @@ class AIRHelper { } - ProcessHelper.runCommand ("", "open", [ simulatorAppPath ]); + System.runCommand ("", "open", [ simulatorAppPath ]); } @@ -309,7 +309,7 @@ class AIRHelper { } - ProcessHelper.runCommand (workingDirectory, project.defines.get ("AIR_SDK") + "/bin/adl", args); + System.runCommand (workingDirectory, project.defines.get ("AIR_SDK") + "/bin/adl", args); } diff --git a/src/lime/tools/AndroidHelper.hx b/src/lime/tools/AndroidHelper.hx index 9cff536a7..cdd20112e 100644 --- a/src/lime/tools/AndroidHelper.hx +++ b/src/lime/tools/AndroidHelper.hx @@ -49,14 +49,14 @@ class AndroidHelper { } - if (PlatformHelper.hostPlatform != WINDOWS) { + if (System.hostPlatform != WINDOWS) { - ProcessHelper.runCommand ("", "chmod", [ "755", PathHelper.combine (projectDirectory, "gradlew") ]); - ProcessHelper.runCommand (projectDirectory, "./gradlew", args); + System.runCommand ("", "chmod", [ "755", Path.combine (projectDirectory, "gradlew") ]); + System.runCommand (projectDirectory, "./gradlew", args); } else { - ProcessHelper.runCommand (projectDirectory, "gradlew", args); + System.runCommand (projectDirectory, "gradlew", args); } } @@ -72,7 +72,7 @@ class AndroidHelper { } - ProcessHelper.runCommand (adbPath, adbName, [ "connect", deviceID ]); + System.runCommand (adbPath, adbName, [ "connect", deviceID ]); } @@ -81,7 +81,7 @@ class AndroidHelper { public static function getBuildToolsVersion (project:Project):String { - var buildToolsPath = PathHelper.combine (project.environment.get ("ANDROID_SDK"), "build-tools/"); + var buildToolsPath = Path.combine (project.environment.get ("ANDROID_SDK"), "build-tools/"); var version = ~/^(\d+)\.(\d+)\.(\d+)$/i; var current = { major : 0, minor : 0, micro : 0 }; @@ -149,7 +149,7 @@ class AndroidHelper { if (devices.length > 0) { - var tempFile = PathHelper.getTemporaryFile (); + var tempFile = System.getTemporaryFile (); var args = [ "wait-for-device", "shell", "getprop", "ro.build.version.sdk", ">", tempFile ]; @@ -162,13 +162,13 @@ class AndroidHelper { } - if (PlatformHelper.hostPlatform == MAC) { + if (System.hostPlatform == MAC) { - ProcessHelper.runCommand (adbPath, "perl", [ "-e", 'alarm shift @ARGV; exec @ARGV', "3", adbName ].concat (args), true, true); + System.runCommand (adbPath, "perl", [ "-e", 'alarm shift @ARGV; exec @ARGV', "3", adbName ].concat (args), true, true); } else { - ProcessHelper.runCommand (adbPath, adbName, args, true, true); + System.runCommand (adbPath, adbName, args, true, true); } @@ -196,7 +196,7 @@ class AndroidHelper { androidName = "android"; emulatorName = "emulator"; - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { adbName += ".exe"; androidName += ".bat"; @@ -210,7 +210,7 @@ class AndroidHelper { } - if (PlatformHelper.hostPlatform != WINDOWS) { + if (System.hostPlatform != WINDOWS) { adbName = "./" + adbName; androidName = "./" + androidName; @@ -259,7 +259,7 @@ class AndroidHelper { Log.info ("Starting AVD: " + avds[0]); - ProcessHelper.runProcess (emulatorPath, emulatorName, [ "-avd", avds[0], "-gpu", "on" ], false); + System.runProcess (emulatorPath, emulatorName, [ "-avd", avds[0], "-gpu", "on" ], false); while (deviceID == null) { @@ -295,7 +295,7 @@ class AndroidHelper { } - ProcessHelper.runCommand (adbPath, adbName, [ "-s", deviceID, "shell", "input", "keyevent", "82" ]); + System.runCommand (adbPath, adbName, [ "-s", deviceID, "shell", "input", "keyevent", "82" ]); } @@ -318,7 +318,7 @@ class AndroidHelper { } - ProcessHelper.runCommand (adbPath, adbName, args); + System.runCommand (adbPath, adbName, args); return deviceID; @@ -328,7 +328,7 @@ class AndroidHelper { public static function listAVDs ():Array { var avds = new Array (); - var output = ProcessHelper.runProcess (androidPath, androidName, [ "list", "avd" ]); + var output = System.runProcess (androidPath, androidName, [ "list", "avd" ]); if (output != null && output != "") { @@ -354,11 +354,11 @@ class AndroidHelper { var devices = new Array (); var output = ""; - if (PlatformHelper.hostPlatform != WINDOWS) { + if (System.hostPlatform != WINDOWS) { - var tempFile = PathHelper.getTemporaryFile (); + var tempFile = System.getTemporaryFile (); - ProcessHelper.runCommand (adbPath, adbName, [ "devices", ">", tempFile ], true, true); + System.runCommand (adbPath, adbName, [ "devices", ">", tempFile ], true, true); if (FileSystem.exists (tempFile)) { @@ -369,7 +369,7 @@ class AndroidHelper { } else { - output = ProcessHelper.runProcess (adbPath, adbName, [ "devices" ], true, true); + output = System.runProcess (adbPath, adbName, [ "devices" ], true, true); } @@ -405,7 +405,7 @@ class AndroidHelper { } - ProcessHelper.runCommand (adbPath, adbName, args); + System.runCommand (adbPath, adbName, args); } @@ -427,12 +427,12 @@ class AndroidHelper { if (customFilter != null) { - ProcessHelper.runCommand (adbPath, adbName, args.concat ([ customFilter ])); + System.runCommand (adbPath, adbName, args.concat ([ customFilter ])); } else if (project.environment.exists("FULL_LOGCAT") || Log.verbose) { - ProcessHelper.runCommand (adbPath, adbName, args.concat ([ "-c" ])); - ProcessHelper.runCommand (adbPath, adbName, args); + System.runCommand (adbPath, adbName, args.concat ([ "-c" ])); + System.runCommand (adbPath, adbName, args); } else if (debug) { @@ -447,11 +447,11 @@ class AndroidHelper { Sys.println (filter); - ProcessHelper.runCommand (adbPath, adbName, args.concat ([ filter ])); + System.runCommand (adbPath, adbName, args.concat ([ filter ])); } else { - ProcessHelper.runCommand (adbPath, adbName, args.concat ([ "*:S trace:I" ])); + System.runCommand (adbPath, adbName, args.concat ([ "*:S trace:I" ])); } @@ -471,7 +471,7 @@ class AndroidHelper { } - ProcessHelper.runCommand (adbPath, adbName, args); + System.runCommand (adbPath, adbName, args); } diff --git a/src/lime/tools/Asset.hx b/src/lime/tools/Asset.hx index 56f44db8d..4c05b5156 100644 --- a/src/lime/tools/Asset.hx +++ b/src/lime/tools/Asset.hx @@ -1,11 +1,11 @@ package lime.tools; -import haxe.io.Path; -import hxp.FileHelper; -import hxp.ObjectHelper; -import hxp.StringHelper; -import hxp.PathHelper; +import hxp.Path; +import hxp.System; +import hxp.ObjectTools; +import hxp.StringTools; +import hxp.Path; import lime.tools.AssetType; import sys.FileSystem; @@ -36,7 +36,7 @@ class Asset { if (!setDefaults) return; this.embed = embed; - sourcePath = PathHelper.standardize (path); + sourcePath = Path.standardize (path); if (rename == "") { @@ -50,7 +50,7 @@ class Asset { id = targetPath; resourceName = targetPath; - flatName = StringHelper.getFlatName (targetPath); + flatName = StringTools.getFlatName (targetPath); format = Path.extension (path).toLowerCase (); glyphs = "32-255"; @@ -96,7 +96,7 @@ class Asset { default: - if (path != "" && FileHelper.isText (path)) { + if (path != "" && System.isText (path)) { this.type = AssetType.TEXT; @@ -136,7 +136,7 @@ class Asset { asset.targetPath = targetPath; asset.type = type; - //ObjectHelper.copyFields (this, asset); + //ObjectTools.copyFields (this, asset); return asset; diff --git a/src/lime/tools/AssetHelper.hx b/src/lime/tools/AssetHelper.hx index 92c18bfbd..e9d342e0d 100644 --- a/src/lime/tools/AssetHelper.hx +++ b/src/lime/tools/AssetHelper.hx @@ -1,10 +1,10 @@ package lime.tools; #if lime -import haxe.io.Path; +import hxp.Path; import haxe.Serializer; import haxe.Unserializer; -import hxp.PathHelper; +import hxp.Path; import hxp.*; import lime.tools.AssetType; import lime.tools.Asset; @@ -89,7 +89,7 @@ class AssetHelper { if (asset.sourcePath != "") { - FileHelper.copyFile (asset.sourcePath, destination, context, asset.type == TEMPLATE); + System.copyFile (asset.sourcePath, destination, context, asset.type == TEMPLATE); } else { @@ -97,7 +97,7 @@ class AssetHelper { if (asset.encoding == AssetEncoding.BASE64) { - File.saveBytes (destination, StringHelper.base64Decode (asset.data)); + File.saveBytes (destination, StringTools.base64Decode (asset.data)); } else if (Std.is (asset.data, Bytes)) { @@ -124,15 +124,15 @@ class AssetHelper { if (asset.sourcePath != "") { - if (FileHelper.isNewer (asset.sourcePath, destination)) { + if (System.isNewer (asset.sourcePath, destination)) { - FileHelper.copyFile (asset.sourcePath, destination, null, asset.type == TEMPLATE); + System.copyFile (asset.sourcePath, destination, null, asset.type == TEMPLATE); } } else { - PathHelper.mkdir (Path.directory (destination)); + System.mkdir (Path.directory (destination)); Log.info ("", " - \x1b[1mWriting file:\x1b[0m " + destination); @@ -140,7 +140,7 @@ class AssetHelper { if (asset.encoding == AssetEncoding.BASE64) { - File.saveBytes (destination, StringHelper.base64Decode (asset.data)); + File.saveBytes (destination, StringTools.base64Decode (asset.data)); } else if (Std.is (asset.data, Bytes)) { @@ -193,7 +193,7 @@ class AssetHelper { if (targetPath != null) { - PathHelper.mkdir (Path.directory (targetPath)); + System.mkdir (Path.directory (targetPath)); Log.info ("", " - \x1b[1mWriting asset manifest:\x1b[0m " + targetPath); File.saveContent (targetPath, manifest.serialize ()); @@ -250,12 +250,12 @@ class AssetHelper { if (targetDirectory != null) { - PathHelper.mkdir (targetDirectory); + System.mkdir (targetDirectory); var targetPath; for (manifest in manifests) { - targetPath = PathHelper.combine (targetDirectory, manifest.name + ".json"); + targetPath = Path.combine (targetDirectory, manifest.name + ".json"); Log.info ("", " - \x1b[1mWriting asset manifest:\x1b[0m " + targetPath); File.saveContent (targetPath, manifest.serialize ()); @@ -573,13 +573,13 @@ class AssetHelper { if (handlers.length > 0) { var projectData = Serializer.run (project); - var temporaryFile = PathHelper.getTemporaryFile (); + var temporaryFile = System.getTemporaryFile (); File.saveContent (temporaryFile, projectData); for (handler in handlers) { - var outputFile = PathHelper.getTemporaryFile (); + var outputFile = System.getTemporaryFile (); var args = [ "run", handler, "process", temporaryFile, outputFile ]; if (Log.verbose) { @@ -590,13 +590,13 @@ class AssetHelper { if (targetDirectory != null) { - args.push ("--targetDirectory=" + PathHelper.tryFullPath (targetDirectory)); + args.push ("--targetDirectory=" + Path.tryFullPath (targetDirectory)); } try { - HaxelibHelper.runCommand ("", args, false); + Haxelib.runCommand ("", args, false); } catch (e:Dynamic) { @@ -749,7 +749,7 @@ class AssetHelper { // TODO: Support caching - PathHelper.mkdir (cacheDirectory); + System.mkdir (cacheDirectory); if (FileSystem.exists (cacheDirectory + filename)) { diff --git a/src/lime/tools/CPPHelper.hx b/src/lime/tools/CPPHelper.hx index 3c786101e..076fc54f8 100644 --- a/src/lime/tools/CPPHelper.hx +++ b/src/lime/tools/CPPHelper.hx @@ -2,8 +2,8 @@ package lime.tools; import hxp.Log; -import hxp.PlatformHelper; -import hxp.ProcessHelper; +import hxp.System; +import hxp.System; import hxp.*; import lime.tools.Project; import lime.tools.Platform; @@ -27,12 +27,12 @@ class CPPHelper { try { - var options = PathHelper.combine (path, "Options.txt"); + var options = Path.combine (path, "Options.txt"); if (FileSystem.exists (options)) { args.push ("-options"); - args.push (PathHelper.tryFullPath (options)); + args.push (Path.tryFullPath (options)); // var list; // var input = File.read (options, false); @@ -117,13 +117,13 @@ class CPPHelper { } - if (PlatformHelper.hostPlatform == WINDOWS && !project.environment.exists ("HXCPP_COMPILE_THREADS")) { + if (System.hostPlatform == WINDOWS && !project.environment.exists ("HXCPP_COMPILE_THREADS")) { var threads = 1; - if (ProcessHelper.processorCores > 1) { + if (System.processorCores > 1) { - threads = ProcessHelper.processorCores - 1; + threads = System.processorCores - 1; } @@ -133,7 +133,7 @@ class CPPHelper { Sys.putEnv ("HXCPP_EXIT_ON_ERROR", ""); - var code = HaxelibHelper.runCommand (path, args); + var code = Haxelib.runCommand (path, args); if (code != 0) { @@ -159,7 +159,7 @@ class CPPHelper { if (!rebuiltLibraries.exists (haxelib.name)) { - var defines = StringMapHelper.copy (project.defines); + var defines = MapTools.copy (project.defines); defines.set ("rebuild", "1"); var haxelibProject = Project.fromHaxelib (haxelib, defines); @@ -167,11 +167,11 @@ class CPPHelper { if (haxelibProject == null) { haxelibProject = new Project (); - haxelibProject.config.set ("project.rebuild.path", PathHelper.combine (PathHelper.getHaxelib (haxelib), "project")); + haxelibProject.config.set ("project.rebuild.path", Path.combine (Haxelib.getPath (haxelib), "project")); } - StringMapHelper.copyKeys (project.targetFlags, haxelibProject.targetFlags); + MapTools.copyKeys (project.targetFlags, haxelibProject.targetFlags); rebuiltLibraries.set (haxelib.name, true); @@ -252,7 +252,7 @@ class CPPHelper { if (buildFile == null) buildFile = "Build.xml"; - if (!FileSystem.exists (PathHelper.combine (path, buildFile))) { + if (!FileSystem.exists (Path.combine (path, buildFile))) { return; @@ -307,13 +307,13 @@ class CPPHelper { } - if (PlatformHelper.hostPlatform == WINDOWS && !project.environment.exists ("HXCPP_COMPILE_THREADS")) { + if (System.hostPlatform == WINDOWS && !project.environment.exists ("HXCPP_COMPILE_THREADS")) { var threads = 1; - if (ProcessHelper.processorCores > 1) { + if (System.processorCores > 1) { - threads = ProcessHelper.processorCores - 1; + threads = System.processorCores - 1; } @@ -323,7 +323,7 @@ class CPPHelper { Sys.putEnv ("HXCPP_EXIT_ON_ERROR", ""); - HaxelibHelper.runCommand (path, args); + Haxelib.runCommand (path, args); } diff --git a/src/lime/tools/CSHelper.hx b/src/lime/tools/CSHelper.hx index 854fe19ac..4709ec082 100644 --- a/src/lime/tools/CSHelper.hx +++ b/src/lime/tools/CSHelper.hx @@ -3,7 +3,7 @@ package lime.tools; import lime.tools.Architecture; import lime.tools.Project; import hxp.NDLL; -import hxp.ProcessHelper; +import hxp.System; import hxp.*; import sys.io.File; import sys.FileSystem; @@ -99,7 +99,7 @@ class CSHelper { public static function copySourceFiles (templatePaths:Array, targetPath:String) { - FileHelper.recursiveCopyTemplate (templatePaths, "cs/src", targetPath); + System.recursiveCopyTemplate (templatePaths, "cs/src", targetPath); } @@ -260,7 +260,7 @@ class CSHelper { var args = [ "run", project.config.getString ("cs.buildLibrary", "hxcs"), buildFile, "--arch", arch, "--platform", platform, "--out", outPath, "--unsafe" ]; if (noCompile) args.push ("--no-compile"); - var code = HaxelibHelper.runCommand (path, args); + var code = Haxelib.runCommand (path, args); if (code != 0) { @@ -273,7 +273,7 @@ class CSHelper { public static function buildGradleProj (path:String) { var gradlePath = FileSystem.absolutePath(path + "/" + "gradlew"); - ProcessHelper.runCommand (path, gradlePath, ["build", "assembleRelease"]); + System.runCommand (path, gradlePath, ["build", "assembleRelease"]); } @@ -295,7 +295,7 @@ class CSHelper { } - ProcessHelper.runCommand (path, msBuildPath, args); + System.runCommand (path, msBuildPath, args); } diff --git a/src/lime/tools/CommandHelper.hx b/src/lime/tools/CommandHelper.hx index b1f548ee5..87de9c596 100644 --- a/src/lime/tools/CommandHelper.hx +++ b/src/lime/tools/CommandHelper.hx @@ -21,11 +21,11 @@ class CommandHelper { public static function openFile (file:String):CLICommand { - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { return new CLICommand ("start", [ file ]); - } else if (PlatformHelper.hostPlatform == MAC) { + } else if (System.hostPlatform == MAC) { return new CLICommand ("/usr/bin/open", [ file ]); diff --git a/src/lime/tools/ConfigData.hx b/src/lime/tools/ConfigData.hx index bcc20dae7..2db986456 100644 --- a/src/lime/tools/ConfigData.hx +++ b/src/lime/tools/ConfigData.hx @@ -3,7 +3,7 @@ package lime.tools; import haxe.xml.Fast; import hxp.Log; -import hxp.ObjectHelper; +import hxp.ObjectTools; abstract ConfigData(Dynamic) to Dynamic from Dynamic { @@ -32,7 +32,7 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic { public function clone ():ConfigData { - return ObjectHelper.deepCopy (this); + return ObjectTools.deepCopy (this); } @@ -313,7 +313,7 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic { if (!Reflect.hasField (destination, field + "___array")) { - Reflect.setField (destination, field + "___array", [ ObjectHelper.deepCopy (Reflect.field (destination, field)) ]); + Reflect.setField (destination, field + "___array", [ ObjectTools.deepCopy (Reflect.field (destination, field)) ]); } @@ -428,7 +428,7 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic { if (!Reflect.hasField (bucket, child.name + "___array")) { - Reflect.setField (bucket, child.name + "___array", [ ObjectHelper.deepCopy (Reflect.field (bucket, child.name)) ]); + Reflect.setField (bucket, child.name + "___array", [ ObjectTools.deepCopy (Reflect.field (bucket, child.name)) ]); } @@ -507,7 +507,7 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic { if (!Reflect.hasField (this, id + "___array")) { - Reflect.setField (this, id + "___array", Reflect.hasField (this, id) ? [ ObjectHelper.deepCopy (Reflect.field (this, id)) ] : []); + Reflect.setField (this, id + "___array", Reflect.hasField (this, id) ? [ ObjectTools.deepCopy (Reflect.field (this, id)) ] : []); } @@ -549,7 +549,7 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic { if (!Reflect.hasField (current, field + "___array")) { - Reflect.setField (current, field + "___array", Reflect.hasField (current, field) ? [ ObjectHelper.deepCopy (Reflect.field (current, field)) ] : []); + Reflect.setField (current, field + "___array", Reflect.hasField (current, field) ? [ ObjectTools.deepCopy (Reflect.field (current, field)) ] : []); } @@ -631,7 +631,7 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic { if (!Reflect.hasField (bucket, node + "___array")) { - Reflect.setField (bucket, node + "___array", [ ObjectHelper.deepCopy (Reflect.field (bucket, node)) ]); + Reflect.setField (bucket, node + "___array", [ ObjectTools.deepCopy (Reflect.field (bucket, node)) ]); } diff --git a/src/lime/tools/ConfigHelper.hx b/src/lime/tools/ConfigHelper.hx index 1f7d2a710..72ee1e8a1 100644 --- a/src/lime/tools/ConfigHelper.hx +++ b/src/lime/tools/ConfigHelper.hx @@ -1,7 +1,7 @@ package lime.tools; -import haxe.io.Path; +import hxp.Path; import lime.tools.Project; import lime.tools.Platform; import hxp.*; @@ -70,7 +70,7 @@ class ConfigHelper { configPath = home + "/.hxp/config.xml"; - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { configPath = configPath.split ("/").join ("\\"); @@ -82,7 +82,7 @@ class ConfigHelper { if (FileSystem.exists (limeConfig)) { - FileHelper.copyFile (limeConfig, configPath); + System.copyFile (limeConfig, configPath); } @@ -90,7 +90,7 @@ class ConfigHelper { if (!FileSystem.exists (configPath)) { - PathHelper.mkdir (Path.directory (configPath)); + System.mkdir (Path.directory (configPath)); var hxcppConfig = null; @@ -313,9 +313,9 @@ class ConfigHelper { try { - if (!FileSystem.exists (value) && FileSystem.exists (PathHelper.expand (value))) { + if (!FileSystem.exists (value) && FileSystem.exists (Path.expand (value))) { - value = PathHelper.expand (value); + value = Path.expand (value); } diff --git a/src/lime/tools/DeploymentHelper.hx b/src/lime/tools/DeploymentHelper.hx index b22a9bb8f..c3ebd6f17 100644 --- a/src/lime/tools/DeploymentHelper.hx +++ b/src/lime/tools/DeploymentHelper.hx @@ -11,9 +11,9 @@ class DeploymentHelper { public static function deploy (project:Project, targetFlags:Map, targetDirectory:String, targetName:String) { var name = project.meta.title + " (" + project.meta.version + " build " + project.meta.buildNumber + ") (" + targetName + ").zip"; - var targetPath = PathHelper.combine (targetDirectory + "/dist", name); + var targetPath = Path.combine (targetDirectory + "/dist", name); - ZipHelper.compress (PathHelper.combine (targetDirectory, "bin"), targetPath); + System.compress (Path.combine (targetDirectory, "bin"), targetPath); if (targetFlags.exists ("gdrive")) { @@ -35,7 +35,7 @@ class DeploymentHelper { } - ProcessHelper.runCommand ("", "drive", args); + System.runCommand ("", "drive", args); } diff --git a/src/lime/tools/ElectronHelper.hx b/src/lime/tools/ElectronHelper.hx index be54329ee..95fda1b7b 100644 --- a/src/lime/tools/ElectronHelper.hx +++ b/src/lime/tools/ElectronHelper.hx @@ -1,8 +1,8 @@ package lime.tools; -import hxp.PathHelper; -import hxp.ProcessHelper; +import hxp.Path; +import hxp.System; import lime.tools.Project; @@ -19,11 +19,11 @@ class ElectronHelper { } else { - electronPath = PathHelper.combine (electronPath, "electron"); + electronPath = Path.combine (electronPath, "electron"); } - ProcessHelper.runCommand ("", electronPath, [ path ]); + System.runCommand ("", electronPath, [ path ]); } diff --git a/src/lime/tools/FlashHelper.hx b/src/lime/tools/FlashHelper.hx index 0961e4781..09cf8c133 100644 --- a/src/lime/tools/FlashHelper.hx +++ b/src/lime/tools/FlashHelper.hx @@ -4,7 +4,7 @@ package lime.tools; //import openfl.text.Font; //import openfl.utils.ByteArray; import haxe.io.Bytes; -import haxe.io.Path; +import hxp.Path; import lime.tools.Asset; import lime.tools.AssetEncoding; import lime.tools.AssetType; @@ -13,7 +13,7 @@ import lime.tools.Project; import lime.text.Font; #end import hxp.Log; -import hxp.ProcessHelper; +import hxp.System; import hxp.*; import sys.io.File; import sys.FileSystem; @@ -276,7 +276,7 @@ class FlashHelper { if (inAsset.encoding == AssetEncoding.BASE64) { - outTags.push (TBitsJPEG (cid, JDJPEG2 (StringHelper.base64Decode (inAsset.data)))); + outTags.push (TBitsJPEG (cid, JDJPEG2 (StringTools.base64Decode (inAsset.data)))); } else { @@ -490,7 +490,7 @@ class FlashHelper { if (inAsset.encoding == AssetEncoding.BASE64) { - bytes = StringHelper.base64Decode (inAsset.data); + bytes = StringTools.base64Decode (inAsset.data); } else if (Std.is (inAsset.data, Bytes)) { @@ -598,7 +598,7 @@ class FlashHelper { try { - var path = switch (PlatformHelper.hostPlatform) { + var path = switch (System.hostPlatform) { case WINDOWS: Sys.getEnv ("HOMEDRIVE") + "/" + Sys.getEnv ("HOMEPATH") + "/mm.cfg"; //case MAC: "/Library/Application Support/Macromedia/mm.cfg"; @@ -621,7 +621,7 @@ class FlashHelper { #if format destination = destination + "/obj"; - PathHelper.mkdir (destination); + System.mkdir (destination); var label = (id > 0 ? Std.string (id + 1) : ""); @@ -732,7 +732,7 @@ class FlashHelper { /*private static function compileSWC (project:Project, embed:String, id:Int):Void { var destination = project.app.path + "/flash/obj"; - PathHelper.mkdir (destination); + System.mkdir (destination); var label = (id > 0 ? Std.string (id + 1) : ""); @@ -748,7 +748,7 @@ class FlashHelper { if (FileSystem.exists (destination + "/assets.swf")) { - FileHelper.copyFile (destination + "/assets.swf", destination + "/.assets.swf"); + System.copyFile (destination + "/assets.swf", destination + "/.assets.swf"); } @@ -761,7 +761,7 @@ class FlashHelper { } - ProcessHelper.runCommand ("", "haxe", args); + System.runCommand ("", "haxe", args); if (FileSystem.exists (destination + "/.assets.swf")) { @@ -816,12 +816,12 @@ class FlashHelper { if (asset.data != null) { - sourcePath = PathHelper.getTemporaryFile (); + sourcePath = System.getTemporaryFile (); tempFiles.push (sourcePath); if (asset.encoding == AssetEncoding.BASE64) { - File.saveBytes (sourcePath, StringHelper.base64Decode (asset.data)); + File.saveBytes (sourcePath, StringTools.base64Decode (asset.data)); } else if (Std.is (asset.data, Bytes)) { @@ -933,9 +933,9 @@ class FlashHelper { try { - var path = switch (PlatformHelper.hostPlatform) { + var path = switch (System.hostPlatform) { - case WINDOWS: PathHelper.escape (Sys.getEnv ("APPDATA") + "/Macromedia/Flash Player/Logs/flashlog.txt"); + case WINDOWS: Path.escape (Sys.getEnv ("APPDATA") + "/Macromedia/Flash Player/Logs/flashlog.txt"); case MAC: Sys.getEnv ("HOME") + "/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt"; default: Sys.getEnv ("HOME") + "/.macromedia/Flash_Player/Logs/flashlog.txt"; @@ -979,7 +979,7 @@ class FlashHelper { } - ProcessHelper.openFile (workingDirectory, targetPath, player); + System.openFile (workingDirectory, targetPath, player); } @@ -988,7 +988,7 @@ class FlashHelper { try { - var path = switch (PlatformHelper.hostPlatform) { + var path = switch (System.hostPlatform) { case WINDOWS: Sys.getEnv ("APPDATA") + "/Macromedia/Flash Player/Logs/flashlog.txt"; case MAC: Sys.getEnv ("HOME") + "/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt"; diff --git a/src/lime/tools/GUID.hx b/src/lime/tools/GUID.hx new file mode 100644 index 000000000..3cf73c8d7 --- /dev/null +++ b/src/lime/tools/GUID.hx @@ -0,0 +1,67 @@ +package lime.tools; + + +import haxe.crypto.Sha1; +import haxe.io.Bytes; +import haxe.crypto.Crc32; + + +// https://groups.google.com/d/msg/haxelang/N03kf5WSrTU/KU8nmsaqfIIJ +class GUID { + + inline public static function randomIntegerWithinRange (min:Int, max:Int, ?seeded:Bool = false):Int { + + return seeded ? + Math.floor(GUID.seededRandom() * (1 + max - min) + min) : + Math.floor(Math.random() * (1 + max - min) + min); + + } + + public static function createRandomIdentifier (length:Int, radix:Int = 61, ?seeded:Bool = false):String { + + var characters = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']; + var id:Array = new Array (); + radix = (radix > 61) ? 61 : radix; + + while (length-- > 0) { + + id.push (characters[GUID.randomIntegerWithinRange (0, radix, seeded)]); + } + + return id.join(''); + } + + public static function uuid (?seeded:Bool = false):String { + + var specialChars = ['8', '9', 'A', 'B']; + + return "{" + GUID.createRandomIdentifier (8, 15, seeded) + '-' + + GUID.createRandomIdentifier (4, 15, seeded) + '-4' + + GUID.createRandomIdentifier (3, 15, seeded) + '-' + + specialChars[GUID.randomIntegerWithinRange (0, 3, seeded)] + + GUID.createRandomIdentifier (3, 15, seeded) + '-' + + GUID.createRandomIdentifier (12, 15, seeded) + + "}"; + + } + + private static var seed:Int = 0; + + private static function setSeed(input:String):Int { + var inputBytes = Bytes.ofString(input); + var hashedBytes = Sha1.make(inputBytes); + return GUID.seed = Crc32.make(hashedBytes); + } + + private static function seededRandom():Float { + GUID.seed++; + var x = Math.sin(GUID.seed) * 10000; + return x - Math.floor(x); + } + + public static function seededUuid (seed:String):String { + GUID.setSeed(seed); + return uuid(true); + } + +} \ No newline at end of file diff --git a/src/lime/tools/HTML5Helper.hx b/src/lime/tools/HTML5Helper.hx index dafdf095c..97ea84020 100644 --- a/src/lime/tools/HTML5Helper.hx +++ b/src/lime/tools/HTML5Helper.hx @@ -1,12 +1,12 @@ package lime.tools; -import haxe.io.Path; +import hxp.Path; import haxe.Timer; import hxp.Log; -import hxp.PathHelper; -import hxp.PlatformHelper; -import hxp.ProcessHelper; +import hxp.Path; +import hxp.System; +import hxp.System; import lime.tools.Architecture; import hxp.*; import lime.tools.Asset; @@ -35,7 +35,7 @@ class HTML5Helper { if (filename != StringTools.urlEncode (filename)) { - var output = ProcessHelper.runProcess ("", "haxe", [ "-version" ], true, true, true, false, true); + var output = System.runProcess ("", "haxe", [ "-version" ], true, true, true, false, true); var haxeVer:Version = StringTools.trim (output); if (haxeVer < ("4.0.0" : Version)) { @@ -43,7 +43,7 @@ class HTML5Helper { var replaceString = "//# sourceMappingURL=" + filename + ".map"; var replacement = "//# sourceMappingURL=" + StringTools.urlEncode (filename) + ".map"; - FileHelper.replaceText (sourceFile, replaceString, replacement); + System.replaceText (sourceFile, replaceString, replacement); } @@ -58,8 +58,8 @@ class HTML5Helper { // if (!FileSystem.exists (FileSystem.fullPath (sourcePath) + ".hash")) { - // var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib (#if lime "lime" #else "hxp" #end)), "templates") ].concat (project.templatePaths); - // ProcessHelper.runCommand (Path.directory (sourcePath), "neko", [ PathHelper.findTemplate (templatePaths, "bin/hxswfml.n"), "ttf2hash2", Path.withoutDirectory (sourcePath), FileSystem.fullPath (sourcePath) + ".hash", "-glyphs", font.glyphs ]); + // var templatePaths = [ Path.combine (Haxelib.getPath (new Haxelib (#if lime "lime" #else "hxp" #end)), "templates") ].concat (project.templatePaths); + // System.runCommand (Path.directory (sourcePath), "neko", [ System.findTemplate (templatePaths, "bin/hxswfml.n"), "ttf2hash2", Path.withoutDirectory (sourcePath), FileSystem.fullPath (sourcePath) + ".hash", "-glyphs", font.glyphs ]); // } @@ -70,7 +70,7 @@ class HTML5Helper { public static function generateWebfonts (project:Project, font:Asset):Void { - var suffix = switch (PlatformHelper.hostPlatform) { + var suffix = switch (System.hostPlatform) { case WINDOWS: "-windows.exe"; case MAC: "-mac"; @@ -81,7 +81,7 @@ class HTML5Helper { if (suffix == "-linux") { - if (PlatformHelper.hostArchitecture == X86) { + if (System.hostArchitecture == X86) { suffix += "32"; @@ -93,9 +93,9 @@ class HTML5Helper { } - var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); - var webify = PathHelper.findTemplate (templatePaths, "bin/webify" + suffix); - if (PlatformHelper.hostPlatform != WINDOWS) { + var templatePaths = [ Path.combine (Haxelib.getPath (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); + var webify = System.findTemplate (templatePaths, "bin/webify" + suffix); + if (System.hostPlatform != WINDOWS) { Sys.command ("chmod", [ "+x", webify ]); @@ -103,11 +103,11 @@ class HTML5Helper { if (Log.verbose) { - ProcessHelper.runCommand ("", webify, [ FileSystem.fullPath (font.sourcePath) ]); + System.runCommand ("", webify, [ FileSystem.fullPath (font.sourcePath) ]); } else { - ProcessHelper.runProcess ("", webify, [ FileSystem.fullPath (font.sourcePath) ], true, true, true); + System.runProcess ("", webify, [ FileSystem.fullPath (font.sourcePath) ], true, true, true); } @@ -118,11 +118,11 @@ class HTML5Helper { if (project.app.url != null && project.app.url != "") { - ProcessHelper.openURL (project.app.url); + System.openURL (project.app.url); } else { - var suffix = switch (PlatformHelper.hostPlatform) { + var suffix = switch (System.hostPlatform) { case WINDOWS: "-windows.exe"; case MAC: "-mac"; @@ -133,7 +133,7 @@ class HTML5Helper { if (suffix == "-linux") { - if (PlatformHelper.hostArchitecture == X86) { + if (System.hostArchitecture == X86) { suffix += "32"; @@ -145,11 +145,11 @@ class HTML5Helper { } - var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); - var node = PathHelper.findTemplate (templatePaths, "bin/node/node" + suffix); - var server = PathHelper.findTemplate (templatePaths, "bin/node/http-server/bin/http-server"); + var templatePaths = [ Path.combine (Haxelib.getPath (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); + var node = System.findTemplate (templatePaths, "bin/node/node" + suffix); + var server = System.findTemplate (templatePaths, "bin/node/http-server/bin/http-server"); - if (PlatformHelper.hostPlatform != WINDOWS) { + if (System.hostPlatform != WINDOWS) { Sys.command ("chmod", [ "+x", node ]); @@ -166,7 +166,7 @@ class HTML5Helper { /*Thread.create (function () { Sys.sleep (0.5); - ProcessHelper.openURL ("http://localhost:" + port); + System.openURL ("http://localhost:" + port); });*/ @@ -188,7 +188,7 @@ class HTML5Helper { } - ProcessHelper.runCommand ("", node, args); + System.runCommand ("", node, args); } @@ -199,17 +199,17 @@ class HTML5Helper { if (FileSystem.exists (sourceFile)) { - var tempFile = PathHelper.getTemporaryFile (".js"); + var tempFile = System.getTemporaryFile (".js"); if (project.targetFlags.exists ("yui")) { - var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); - ProcessHelper.runCommand ("", "java", [ "-Dapple.awt.UIElement=true", "-jar", PathHelper.findTemplate (templatePaths, "bin/yuicompressor-2.4.7.jar"), "-o", tempFile, sourceFile ]); + var templatePaths = [ Path.combine (Haxelib.getPath (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); + System.runCommand ("", "java", [ "-Dapple.awt.UIElement=true", "-jar", System.findTemplate (templatePaths, "bin/yuicompressor-2.4.7.jar"), "-o", tempFile, sourceFile ]); } else { - var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); - var args = [ "-Dapple.awt.UIElement=true", "-jar", PathHelper.findTemplate (templatePaths, "bin/compiler.jar"), "--strict_mode_input", "false", "--js", sourceFile, "--js_output_file", tempFile ]; + var templatePaths = [ Path.combine (Haxelib.getPath (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); + var args = [ "-Dapple.awt.UIElement=true", "-jar", System.findTemplate (templatePaths, "bin/compiler.jar"), "--strict_mode_input", "false", "--js", sourceFile, "--js_output_file", tempFile ]; if (project.targetFlags.exists ("advanced")) { @@ -236,7 +236,7 @@ class HTML5Helper { } - ProcessHelper.runCommand ("", "java", args); + System.runCommand ("", "java", args); if (FileSystem.exists (tempFile + ".map")) { diff --git a/src/lime/tools/HXProject.hx b/src/lime/tools/HXProject.hx index 993a93e45..fecb22ecb 100644 --- a/src/lime/tools/HXProject.hx +++ b/src/lime/tools/HXProject.hx @@ -2,21 +2,21 @@ package lime.tools; import haxe.io.Eof; -import haxe.io.Path; +import hxp.Path; import haxe.xml.Fast; import haxe.Json; import haxe.Serializer; import haxe.Unserializer; -import hxp.ArrayHelper; -import hxp.FileHelper; -import hxp.HaxelibHelper; +import hxp.ArrayTools; +import hxp.System; +import hxp.Haxelib; import hxp.Log; -import hxp.ObjectHelper; -import hxp.PathHelper; -import hxp.PlatformHelper; -import hxp.ProcessHelper; -import hxp.StringHelper; -import hxp.StringMapHelper; +import hxp.ObjectTools; +import hxp.Path; +import hxp.System; +import hxp.System; +import hxp.StringTools; +import hxp.MapTools; import lime.tools.AssetType; import sys.FileSystem; import sys.io.File; @@ -108,10 +108,10 @@ class Project { Log.enableColor = inputData.logEnableColor; #if lime - ProcessHelper.dryRun = inputData.processDryRun; + System.dryRun = inputData.processDryRun; #end - HaxelibHelper.debug = inputData.haxelibDebug; + Haxelib.debug = inputData.haxelibDebug; initialize (); @@ -135,7 +135,7 @@ class Project { config = new ConfigData (); debug = _debug; target = _target; - targetFlags = StringMapHelper.copy (_targetFlags); + targetFlags = MapTools.copy (_targetFlags); templatePaths = _templatePaths.copy (); defaultMeta = { title: "MyApplication", description: "", packageName: "com.example.myapp", version: "1.0.0", company: "", companyUrl: "", buildNumber: null, companyId: "" } @@ -239,7 +239,7 @@ class Project { } else { - architectures = [ PlatformHelper.hostArchitecture ]; + architectures = [ System.hostArchitecture ]; } @@ -248,7 +248,7 @@ class Project { case MAC, LINUX: platformType = PlatformType.DESKTOP; - architectures = [ PlatformHelper.hostArchitecture ]; + architectures = [ System.hostArchitecture ]; defaultWindow.allowHighDPI = false; @@ -267,15 +267,15 @@ class Project { defaultArchitectures = architectures.copy (); - meta = ObjectHelper.copyFields (defaultMeta, {}); - app = ObjectHelper.copyFields (defaultApp, {}); - window = ObjectHelper.copyFields (defaultWindow, {}); + meta = ObjectTools.copyFields (defaultMeta, {}); + app = ObjectTools.copyFields (defaultApp, {}); + window = ObjectTools.copyFields (defaultWindow, {}); windows = [ window ]; assets = new Array (); if (_userDefines != null) { - defines = StringMapHelper.copy (_userDefines); + defines = MapTools.copy (_userDefines); } else { @@ -319,7 +319,7 @@ class Project { var project = new Project (); - ObjectHelper.copyFields (app, project.app); + ObjectTools.copyFields (app, project.app); project.architectures = architectures.copy (); project.assets = assets.copy (); @@ -393,7 +393,7 @@ class Project { } - ObjectHelper.copyFields (meta, project.meta); + ObjectTools.copyFields (meta, project.meta); for (key in modules.keys ()) { @@ -437,7 +437,7 @@ class Project { for (i in 0...windows.length) { - project.windows[i] = (ObjectHelper.copyFields (windows[i], {})); + project.windows[i] = (ObjectTools.copyFields (windows[i], {})); } @@ -511,16 +511,16 @@ class Project { var name = Path.withoutDirectory (Path.withoutExtension (projectFile)); name = name.substr (0, 1).toUpperCase () + name.substr (1); - var tempDirectory = PathHelper.getTemporaryDirectory (); - var classFile = PathHelper.combine (tempDirectory, name + ".hx"); - var nekoOutput = PathHelper.combine (tempDirectory, name + ".n"); + var tempDirectory = System.getTemporaryDirectory (); + var classFile = Path.combine (tempDirectory, name + ".hx"); + var nekoOutput = Path.combine (tempDirectory, name + ".n"); - FileHelper.copyFile (path, classFile); + System.copyFile (path, classFile); #if lime - var args = [ name, "-main", "lime.tools.Project", "-cp", tempDirectory, "-neko", nekoOutput, "-cp", PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("hxp")), "src"), "-lib", "hxp" ]; + var args = [ name, "-main", "lime.tools.Project", "-cp", tempDirectory, "-neko", nekoOutput, "-cp", Path.combine (Haxelib.getPath (new Haxelib ("hxp")), "src"), "-lib", "hxp" ]; #else - var args = [ name, "--interp", "-main", "lime.tools.Project", "-cp", tempDirectory, "-cp", PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("hxp")), "src") ]; + var args = [ name, "--interp", "-main", "lime.tools.Project", "-cp", tempDirectory, "-cp", Path.combine (Haxelib.getPath (new Haxelib ("hxp")), "src") ]; #end var input = File.read (classFile, false); var tag = "@:compiler("; @@ -543,15 +543,15 @@ class Project { input.close (); - var cacheDryRun = ProcessHelper.dryRun; - ProcessHelper.dryRun = false; + var cacheDryRun = System.dryRun; + System.dryRun = false; #if lime - ProcessHelper.runCommand ("", "haxe", args); + System.runCommand ("", "haxe", args); #end - var inputFile = PathHelper.combine (tempDirectory, "input.dat"); - var outputFile = PathHelper.combine (tempDirectory, "output.dat"); + var inputFile = Path.combine (tempDirectory, "input.dat"); + var outputFile = Path.combine (tempDirectory, "output.dat"); var inputData = Serializer.run ({ @@ -566,7 +566,7 @@ class Project { logVerbose: Log.verbose, logEnableColor: Log.enableColor, processDryRun: cacheDryRun, - haxelibDebug: HaxelibHelper.debug + haxelibDebug: Haxelib.debug }); @@ -575,9 +575,9 @@ class Project { try { #if lime - ProcessHelper.runCommand ("", "neko", [ FileSystem.fullPath (nekoOutput), inputFile, outputFile ]); + System.runCommand ("", "neko", [ FileSystem.fullPath (nekoOutput), inputFile, outputFile ]); #else - ProcessHelper.runCommand ("", "haxe", args.concat ([ "--", inputFile, outputFile ])); + System.runCommand ("", "haxe", args.concat ([ "--", inputFile, outputFile ])); #end } catch (e:Dynamic) { @@ -587,7 +587,7 @@ class Project { } - ProcessHelper.dryRun = cacheDryRun; + System.dryRun = cacheDryRun; var tPaths:Array = []; @@ -595,7 +595,7 @@ class Project { FileSystem.deleteFile (inputFile); - var outputPath = PathHelper.combine (tempDirectory, "output.dat"); + var outputPath = Path.combine (tempDirectory, "output.dat"); if (FileSystem.exists (outputPath)) { @@ -615,7 +615,7 @@ class Project { } catch (e:Dynamic) {} - PathHelper.removeDirectory (tempDirectory); + System.removeDirectory (tempDirectory); if (project != null) { @@ -625,13 +625,13 @@ class Project { } - var defines = StringMapHelper.copy (userDefines); - StringMapHelper.copyKeys (project.defines, defines); + var defines = MapTools.copy (userDefines); + MapTools.copyKeys (project.defines, defines); processHaxelibs (project, defines); //Adding template paths from the Project file - project.templatePaths = ArrayHelper.concatUnique (project.templatePaths, tPaths, true); + project.templatePaths = ArrayTools.concatUnique (project.templatePaths, tPaths, true); } return project; @@ -647,7 +647,7 @@ class Project { } - var path = PathHelper.getHaxelib (haxelib, false, clearCache); + var path = Haxelib.getPath (haxelib, false, clearCache); if (path == null || path == "") { @@ -657,7 +657,7 @@ class Project { //if (!userDefines.exists (haxelib.name)) { // - //userDefines.set (haxelib.name, HaxelibHelper.getVersion (haxelib)); + //userDefines.set (haxelib.name, Haxelib.getVersion (haxelib)); // //} @@ -679,9 +679,9 @@ class Project { for (file in files) { - if (projectFile == null && FileSystem.exists (PathHelper.combine (path, file))) { + if (projectFile == null && FileSystem.exists (Path.combine (path, file))) { - projectFile = PathHelper.combine (path, file); + projectFile = Path.combine (path, file); } @@ -693,7 +693,7 @@ class Project { if (project.config.get ("project.rebuild.path") == null) { - project.config.set ("project.rebuild.path", PathHelper.combine (path, "project")); + project.config.set ("project.rebuild.path", Path.combine (path, "project")); } @@ -712,8 +712,8 @@ class Project { if (version == "" || version == null) { - var haxelibPath = PathHelper.getHaxelib (haxelib); - var jsonPath = PathHelper.combine (haxelibPath, "haxelib.json"); + var haxelibPath = Haxelib.getPath (haxelib); + var jsonPath = Path.combine (haxelibPath, "haxelib.json"); try { @@ -833,7 +833,7 @@ class Project { if (_target == null) { - _target = PlatformHelper.hostPlatform; + _target = System.hostPlatform; } @@ -860,28 +860,28 @@ class Project { if (project != null) { - ObjectHelper.copyUniqueFields (project.meta, meta, project.defaultMeta); - ObjectHelper.copyUniqueFields (project.app, app, project.defaultApp); + ObjectTools.copyUniqueFields (project.meta, meta, project.defaultMeta); + ObjectTools.copyUniqueFields (project.app, app, project.defaultApp); for (i in 0...project.windows.length) { if (i < windows.length) { - ObjectHelper.copyUniqueFields (project.windows[i], windows[i], project.defaultWindow); + ObjectTools.copyUniqueFields (project.windows[i], windows[i], project.defaultWindow); } else { - windows.push (ObjectHelper.copyFields (project.windows[i], {})); + windows.push (ObjectTools.copyFields (project.windows[i], {})); } } - StringMapHelper.copyUniqueKeys (project.defines, defines); - StringMapHelper.copyUniqueKeys (project.environment, environment); - StringMapHelper.copyUniqueKeys (project.haxedefs, haxedefs); - StringMapHelper.copyUniqueKeys (project.libraryHandlers, libraryHandlers); - StringMapHelper.copyUniqueKeys (project.targetHandlers, targetHandlers); + MapTools.copyUniqueKeys (project.defines, defines); + MapTools.copyUniqueKeys (project.environment, environment); + MapTools.copyUniqueKeys (project.haxedefs, haxedefs); + MapTools.copyUniqueKeys (project.libraryHandlers, libraryHandlers); + MapTools.copyUniqueKeys (project.targetHandlers, targetHandlers); config.merge (project.config); @@ -909,12 +909,12 @@ class Project { } - assets = ArrayHelper.concatUnique (assets, project.assets); - dependencies = ArrayHelper.concatUnique (dependencies, project.dependencies, true); - haxeflags = ArrayHelper.concatUnique (haxeflags, project.haxeflags); - haxelibs = ArrayHelper.concatUnique (haxelibs, project.haxelibs, true, "name"); - icons = ArrayHelper.concatUnique (icons, project.icons); - javaPaths = ArrayHelper.concatUnique (javaPaths, project.javaPaths, true); + assets = ArrayTools.concatUnique (assets, project.assets); + dependencies = ArrayTools.concatUnique (dependencies, project.dependencies, true); + haxeflags = ArrayTools.concatUnique (haxeflags, project.haxeflags); + haxelibs = ArrayTools.concatUnique (haxelibs, project.haxelibs, true, "name"); + icons = ArrayTools.concatUnique (icons, project.icons); + javaPaths = ArrayTools.concatUnique (javaPaths, project.javaPaths, true); if (keystore == null) { @@ -926,8 +926,8 @@ class Project { } - languages = ArrayHelper.concatUnique (languages, project.languages, true); - libraries = ArrayHelper.concatUnique (libraries, project.libraries, true); + languages = ArrayTools.concatUnique (languages, project.languages, true); + libraries = ArrayTools.concatUnique (libraries, project.libraries, true); for (key in project.modules.keys ()) { @@ -943,13 +943,13 @@ class Project { } - ndlls = ArrayHelper.concatUnique (ndlls, project.ndlls); + ndlls = ArrayTools.concatUnique (ndlls, project.ndlls); postBuildCallbacks = postBuildCallbacks.concat (project.postBuildCallbacks); preBuildCallbacks = preBuildCallbacks.concat (project.preBuildCallbacks); - samplePaths = ArrayHelper.concatUnique (samplePaths, project.samplePaths, true); - sources = ArrayHelper.concatUnique (sources, project.sources, true); - splashScreens = ArrayHelper.concatUnique (splashScreens, project.splashScreens); - templatePaths = ArrayHelper.concatUnique (templatePaths, project.templatePaths, true); + samplePaths = ArrayTools.concatUnique (samplePaths, project.samplePaths, true); + sources = ArrayTools.concatUnique (sources, project.sources, true); + splashScreens = ArrayTools.concatUnique (splashScreens, project.splashScreens); + templatePaths = ArrayTools.concatUnique (templatePaths, project.templatePaths, true); } @@ -980,7 +980,7 @@ class Project { for (haxelib in haxelibs) { - var validatePath = PathHelper.getHaxelib (haxelib, true); + var validatePath = Haxelib.getPath (haxelib, true); project.haxelibs.push (haxelib); var includeProject = Project.fromHaxelib (haxelib, userDefines); @@ -1036,9 +1036,9 @@ class Project { if (name == "HAXELIB_PATH") { - var currentPath = HaxelibHelper.getRepositoryPath (); + var currentPath = Haxelib.getRepositoryPath (); Sys.putEnv (name, value); - var newPath = HaxelibHelper.getRepositoryPath (true); + var newPath = Haxelib.getRepositoryPath (true); if (currentPath != newPath) { @@ -1080,7 +1080,7 @@ class Project { private function get_host ():Platform { - return PlatformHelper.hostPlatform; + return System.hostPlatform; } @@ -1099,12 +1099,12 @@ class Project { } - ObjectHelper.copyMissingFields (defaultApp, app); - ObjectHelper.copyMissingFields (defaultMeta, meta); + ObjectTools.copyMissingFields (defaultApp, app); + ObjectTools.copyMissingFields (defaultMeta, meta); for (item in windows) { - ObjectHelper.copyMissingFields (defaultWindow, item); + ObjectTools.copyMissingFields (defaultWindow, item); } @@ -1112,7 +1112,7 @@ class Project { for (field in Reflect.fields (app)) { - Reflect.setField (context, "APP_" + StringHelper.formatUppercaseVariable (field), Reflect.field (app, field)); + Reflect.setField (context, "APP_" + StringTools.formatUppercaseVariable (field), Reflect.field (app, field)); } @@ -1128,8 +1128,8 @@ class Project { for (field in Reflect.fields (meta)) { - Reflect.setField (context, "APP_" + StringHelper.formatUppercaseVariable (field), Reflect.field (meta, field)); - Reflect.setField (context, "META_" + StringHelper.formatUppercaseVariable (field), Reflect.field (meta, field)); + Reflect.setField (context, "APP_" + StringTools.formatUppercaseVariable (field), Reflect.field (meta, field)); + Reflect.setField (context, "META_" + StringTools.formatUppercaseVariable (field), Reflect.field (meta, field)); } @@ -1137,8 +1137,8 @@ class Project { for (field in Reflect.fields (windows[0])) { - Reflect.setField (context, "WIN_" + StringHelper.formatUppercaseVariable (field), Reflect.field (windows[0], field)); - Reflect.setField (context, "WINDOW_" + StringHelper.formatUppercaseVariable (field), Reflect.field (windows[0], field)); + Reflect.setField (context, "WIN_" + StringTools.formatUppercaseVariable (field), Reflect.field (windows[0], field)); + Reflect.setField (context, "WINDOW_" + StringTools.formatUppercaseVariable (field), Reflect.field (windows[0], field)); } @@ -1160,7 +1160,7 @@ class Project { for (field in Reflect.fields (windows[i])) { - Reflect.setField (context, "WINDOW_" + StringHelper.formatUppercaseVariable (field) + "_" + i, Reflect.field (windows[i], field)); + Reflect.setField (context, "WINDOW_" + StringTools.formatUppercaseVariable (field) + "_" + i, Reflect.field (windows[i], field)); } @@ -1182,7 +1182,7 @@ class Project { if (StringTools.startsWith (haxeflag, "-lib")) { - Reflect.setField (context, "LIB_" + StringHelper.formatUppercaseVariable (haxeflag.substr (5)), "true"); + Reflect.setField (context, "LIB_" + StringTools.formatUppercaseVariable (haxeflag.substr (5)), "true"); } @@ -1195,9 +1195,9 @@ class Project { if (asset.type != AssetType.TEMPLATE) { var embeddedAsset:Dynamic = { }; - ObjectHelper.copyFields (asset, embeddedAsset); + ObjectTools.copyFields (asset, embeddedAsset); - embeddedAsset.sourcePath = PathHelper.standardize (asset.sourcePath); + embeddedAsset.sourcePath = Path.standardize (asset.sourcePath); if (asset.embed == null) { @@ -1235,7 +1235,7 @@ class Project { for (library in libraries) { var embeddedLibrary:Dynamic = { }; - ObjectHelper.copyFields (library, embeddedLibrary); + ObjectTools.copyFields (library, embeddedLibrary); context.libraries.push (embeddedLibrary); embeddedLibraries[library.name] = embeddedLibrary; @@ -1259,7 +1259,7 @@ class Project { for (ndll in ndlls) { var templateNDLL:Dynamic = { }; - ObjectHelper.copyFields (ndll, templateNDLL); + ObjectTools.copyFields (ndll, templateNDLL); templateNDLL.nameSafe = StringTools.replace (ndll.name, "-", "_"); context.ndlls.push (templateNDLL); @@ -1277,7 +1277,7 @@ class Project { // TODO: Handle real version when better/smarter haxelib available var version = haxelib.version; - //var version = HaxelibHelper.getVersion (haxelib); + //var version = Haxelib.getVersion (haxelib); if (version != null && version != "") { @@ -1287,21 +1287,21 @@ class Project { // #if lime - if (HaxelibHelper.pathOverrides.exists (name)) { + if (Haxelib.pathOverrides.exists (name)) { - var param = "-cp " + HaxelibHelper.pathOverrides.get (name); + var param = "-cp " + Haxelib.pathOverrides.get (name); compilerFlags.remove (param); compilerFlags.push (param); } else { var cache = Log.verbose; - Log.verbose = HaxelibHelper.debug; + Log.verbose = Haxelib.debug; var output = ""; try { - output = HaxelibHelper.runProcess ("", [ "path", name ], true, true, true); + output = Haxelib.runProcess ("", [ "path", name ], true, true, true); } catch (e:Dynamic) { } @@ -1322,7 +1322,7 @@ class Project { } else if (!StringTools.startsWith (arg, "-")) { - var path = PathHelper.standardize (arg); + var path = Path.standardize (arg); if (path != null && StringTools.trim (path) != "" && !StringTools.startsWith (StringTools.trim (path), "#")) { @@ -1333,7 +1333,7 @@ class Project { } var version = "0.0.0"; - var jsonPath = PathHelper.combine (path, "haxelib.json"); + var jsonPath = Path.combine (path, "haxelib.json"); try { @@ -1341,7 +1341,7 @@ class Project { var json = Json.parse (File.getContent (jsonPath)); haxelibName = json.name; - compilerFlags = ArrayHelper.concatUnique (compilerFlags, [ "-D " + haxelibName + "=" + json.version ], true); + compilerFlags = ArrayTools.concatUnique (compilerFlags, [ "-D " + haxelibName + "=" + json.version ], true); } @@ -1355,24 +1355,24 @@ class Project { if (name != haxelibName) { - compilerFlags = ArrayHelper.concatUnique (compilerFlags, [ "-D " + name ], true); + compilerFlags = ArrayTools.concatUnique (compilerFlags, [ "-D " + name ], true); } /*var haxelib = new Haxelib (arg.substr (3)); - var path = PathHelper.getHaxelib (haxelib); + var path = Haxelib.getPath (haxelib); var version = getHaxelibVersion (haxelib); if (path != null) { CompatibilityHelper.patchProject (this, haxelib, version); - compilerFlags = ArrayHelper.concatUnique (compilerFlags, [ "-D " + haxelib.name + "=" + version ], true); + compilerFlags = ArrayTools.concatUnique (compilerFlags, [ "-D " + haxelib.name + "=" + version ], true); }*/ } else if (!StringTools.startsWith (arg, "-L")) { - compilerFlags = ArrayHelper.concatUnique (compilerFlags, [ arg ], true); + compilerFlags = ArrayTools.concatUnique (compilerFlags, [ arg ], true); } @@ -1390,7 +1390,7 @@ class Project { // #end - Reflect.setField (context, "LIB_" + StringHelper.formatUppercaseVariable (haxelib.name), true); + Reflect.setField (context, "LIB_" + StringTools.formatUppercaseVariable (haxelib.name), true); if (name == "nme") { @@ -1416,11 +1416,11 @@ class Project { if (value == null || value == "") { - Reflect.setField (context, "SET_" + StringHelper.formatUppercaseVariable (key), true); + Reflect.setField (context, "SET_" + StringTools.formatUppercaseVariable (key), true); } else { - Reflect.setField (context, "SET_" + StringHelper.formatUppercaseVariable (key), value); + Reflect.setField (context, "SET_" + StringTools.formatUppercaseVariable (key), value); } @@ -1434,13 +1434,13 @@ class Project { compilerFlags.push ("-D " + key); - Reflect.setField (context, "DEFINE_" + StringHelper.formatUppercaseVariable (key), true); + Reflect.setField (context, "DEFINE_" + StringTools.formatUppercaseVariable (key), true); } else { compilerFlags.push ("-D " + key + "=" + value); - Reflect.setField (context, "DEFINE_" + StringHelper.formatUppercaseVariable (key), value); + Reflect.setField (context, "DEFINE_" + StringTools.formatUppercaseVariable (key), value); } @@ -1494,7 +1494,7 @@ class Project { for (templatePath in templatePaths) { - var path = PathHelper.combine (templatePath, hxml); + var path = Path.combine (templatePath, hxml); if (FileSystem.exists (path)) { @@ -1512,7 +1512,7 @@ class Project { if (keystore != null) { - context.KEY_STORE = PathHelper.tryFullPath (keystore.path); + context.KEY_STORE = Path.tryFullPath (keystore.path); if (keystore.password != null) { diff --git a/src/lime/tools/IOSHelper.hx b/src/lime/tools/IOSHelper.hx index 758d632e9..6c27bba8d 100644 --- a/src/lime/tools/IOSHelper.hx +++ b/src/lime/tools/IOSHelper.hx @@ -1,10 +1,10 @@ package lime.tools; -import haxe.io.Path; +import hxp.Path; import lime.tools.Platform; -import hxp.PathHelper; -import hxp.ProcessHelper; +import hxp.Path; +import hxp.System; import hxp.Haxelib; import hxp.*; import lime.tools.Project; @@ -33,7 +33,7 @@ class IOSHelper { commands.push ("-scheme"); commands.push (project.app.file); commands.push ("-archivePath"); - commands.push (PathHelper.combine ("build", PathHelper.combine (configuration + "-" + platformName, project.app.file))); + commands.push (Path.combine ("build", Path.combine (configuration + "-" + platformName, project.app.file))); } else { @@ -47,7 +47,7 @@ class IOSHelper { } - ProcessHelper.runCommand (workingDirectory, "xcodebuild", commands); + System.runCommand (workingDirectory, "xcodebuild", commands); } @@ -67,9 +67,9 @@ class IOSHelper { archiveCommands.push ("-scheme"); archiveCommands.push (project.app.file); archiveCommands.push ("-archivePath"); - archiveCommands.push (PathHelper.combine ("build", PathHelper.combine (configuration + "-" + platformName, project.app.file))); + archiveCommands.push (Path.combine ("build", Path.combine (configuration + "-" + platformName, project.app.file))); - ProcessHelper.runCommand (workingDirectory, "xcodebuild", archiveCommands); + System.runCommand (workingDirectory, "xcodebuild", archiveCommands); var supportedExportMethods = [ "adhoc", "development", "enterprise", "appstore" ]; var exportMethods = []; @@ -89,13 +89,13 @@ class IOSHelper { exportCommands.push ("-exportArchive"); exportCommands.push ("-archivePath"); - exportCommands.push (PathHelper.combine ("build", PathHelper.combine (configuration + "-" + platformName, project.app.file + ".xcarchive"))); + exportCommands.push (Path.combine ("build", Path.combine (configuration + "-" + platformName, project.app.file + ".xcarchive"))); exportCommands.push ("-exportOptionsPlist"); - exportCommands.push (PathHelper.combine (project.app.file, "exportOptions-" + exportMethod + ".plist")); + exportCommands.push (Path.combine (project.app.file, "exportOptions-" + exportMethod + ".plist")); exportCommands.push ("-exportPath"); - exportCommands.push (PathHelper.combine ("dist", exportMethod)); + exportCommands.push (Path.combine ("dist", exportMethod)); - ProcessHelper.runCommand (workingDirectory, "xcodebuild", exportCommands); + System.runCommand (workingDirectory, "xcodebuild", exportCommands); } } @@ -213,7 +213,7 @@ class IOSHelper { if (!project.environment.exists ("IPHONE_VER") || project.environment.get ("IPHONE_VER") == "4.2") { - if (!project.environment.exists ("DEVELOPER_DIR") && PlatformHelper.hostPlatform == MAC) { + if (!project.environment.exists ("DEVELOPER_DIR") && System.hostPlatform == MAC) { var process = new Process ("xcode-select", [ "--print-path" ]); var developerDir = process.stdout.readLine (); @@ -262,7 +262,7 @@ class IOSHelper { private static function getOSXVersion ():String { - var output = ProcessHelper.runProcess ("", "sw_vers", [ "-productVersion" ]); + var output = System.runProcess ("", "sw_vers", [ "-productVersion" ]); return StringTools.trim (output); @@ -273,11 +273,11 @@ class IOSHelper { if (project != null && project.config.exists ("ios.provisioning-profile")) { - return PathHelper.tryFullPath (project.config.getString ("ios.provisioning-profile")); + return Path.tryFullPath (project.config.getString ("ios.provisioning-profile")); - } else if (PlatformHelper.hostPlatform == MAC) { + } else if (System.hostPlatform == MAC) { - var path = PathHelper.expand ("~/Library/MobileDevice/Provisioning Profiles"); + var path = Path.expand ("~/Library/MobileDevice/Provisioning Profiles"); var files = FileSystem.readDirectory (path); for (file in files) { @@ -299,7 +299,7 @@ class IOSHelper { private static function getXcodeVersion ():String { - var output = ProcessHelper.runProcess ("", "xcodebuild", [ "-version" ]); + var output = System.runProcess ("", "xcodebuild", [ "-version" ]); var firstLine = output.split ("\n").shift (); return StringTools.trim (firstLine.substring ("Xcode".length, firstLine.length)); @@ -350,12 +350,12 @@ class IOSHelper { try { - ProcessHelper.runProcess ("", "open", [ "-Ra", "iOS Simulator" ], true, false); - ProcessHelper.runCommand ("", "open", [ "-a", "iOS Simulator", "--args", "-CurrentDeviceUDID", currentDeviceID ]); + System.runProcess ("", "open", [ "-Ra", "iOS Simulator" ], true, false); + System.runCommand ("", "open", [ "-a", "iOS Simulator", "--args", "-CurrentDeviceUDID", currentDeviceID ]); } catch (e:Dynamic) { - ProcessHelper.runCommand ("", "open", [ "-a", "Simulator", "--args", "-CurrentDeviceUDID", currentDeviceID ]); + System.runCommand ("", "open", [ "-a", "Simulator", "--args", "-CurrentDeviceUDID", currentDeviceID ]); } @@ -363,7 +363,7 @@ class IOSHelper { waitForDeviceState ("xcrun", [ "simctl", "install", currentDeviceID, applicationPath ]); waitForDeviceState ("xcrun", [ "simctl", "launch", currentDeviceID, project.meta.packageName ]); - ProcessHelper.runCommand ("", "tail", [ "-F", "~/Library/Logs/CoreSimulator/" + currentDeviceID + "/system.log"]); + System.runCommand ("", "tail", [ "-F", "~/Library/Logs/CoreSimulator/" + currentDeviceID + "/system.log"]); } else { @@ -379,13 +379,13 @@ class IOSHelper { } - var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); - var launcher = PathHelper.findTemplate (templatePaths, "bin/ios-deploy"); + var templatePaths = [ Path.combine (Haxelib.getPath (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); + var launcher = System.findTemplate (templatePaths, "bin/ios-deploy"); Sys.command ("chmod", [ "+x", launcher ]); // var xcodeVersion = getXcodeVersion (); - ProcessHelper.runCommand ("", launcher, [ "install", "--noninteractive", "--debug", "--bundle", FileSystem.fullPath (applicationPath) ]); + System.runCommand ("", launcher, [ "install", "--noninteractive", "--debug", "--bundle", FileSystem.fullPath (applicationPath) ]); } @@ -417,7 +417,7 @@ class IOSHelper { var applicationPath = "build/" + configuration + "-iphoneos/" + project.app.file + ".app"; commands.push (applicationPath); - ProcessHelper.runCommand (workingDirectory, "codesign", commands, true, true); + System.runCommand (workingDirectory, "codesign", commands, true, true); } @@ -428,7 +428,7 @@ class IOSHelper { while (true) { - output = ProcessHelper.runProcess ("", command, args, true, true, true); + output = System.runProcess ("", command, args, true, true, true); if (output != null && output.toLowerCase ().indexOf ("invalid device state") > -1) { diff --git a/src/lime/tools/IconHelper.hx b/src/lime/tools/IconHelper.hx index 48f92c8e3..e0cac791c 100644 --- a/src/lime/tools/IconHelper.hx +++ b/src/lime/tools/IconHelper.hx @@ -9,11 +9,11 @@ package lime.tools; //import format.SVG; import haxe.io.Bytes; import haxe.io.BytesOutput; -import haxe.io.Path; -import hxp.FileHelper; +import hxp.Path; +import hxp.System; import lime.tools.ImageHelper; import hxp.Log; -import hxp.PathHelper; +import hxp.Path; #if (lime && lime_cffi && !macro) import lime.graphics.Image; import lime.math.Rectangle; @@ -30,11 +30,11 @@ class IconHelper { if (FileSystem.exists (targetPath)) { - var cacheTime = FileHelper.getLastModified (targetPath); + var cacheTime = System.getLastModified (targetPath); for (icon in icons) { - if (FileHelper.getLastModified (icon.path) > cacheTime) { + if (System.getLastModified (icon.path) > cacheTime) { return false; @@ -65,8 +65,8 @@ class IconHelper { } - PathHelper.mkdir (Path.directory (targetPath)); - FileHelper.copyFile (icon.path, targetPath); + System.mkdir (Path.directory (targetPath)); + System.copyFile (icon.path, targetPath); return true; } else { @@ -85,7 +85,7 @@ class IconHelper { if (bytes != null) { - PathHelper.mkdir (Path.directory (targetPath)); + System.mkdir (Path.directory (targetPath)); File.saveBytes (targetPath, bytes); return true; diff --git a/src/lime/tools/ImageHelper.hx b/src/lime/tools/ImageHelper.hx index 83264ae0e..651a69a9c 100644 --- a/src/lime/tools/ImageHelper.hx +++ b/src/lime/tools/ImageHelper.hx @@ -6,7 +6,7 @@ import lime.graphics.Image; import lime.graphics.ImageBuffer; import lime.utils.UInt8Array; #end -import hxp.PathHelper; +import hxp.Path; import hxp.Haxelib; import lime.tools.Platform; import hxp.*; @@ -23,11 +23,11 @@ class ImageHelper { #if (lime && lime_cffi && !macro) if (path == null) return null; - var temp = PathHelper.getTemporaryFile (".png"); + var temp = System.getTemporaryFile (".png"); try { - ProcessHelper.runCommand ("", "neko", [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib (#if lime "lime" #else "hxp" #end)), "svg.n"), "process", path, Std.string (width), Std.string (height), temp ], true, true); + System.runCommand ("", "neko", [ Path.combine (Haxelib.getPath (new Haxelib (#if lime "lime" #else "hxp" #end)), "svg.n"), "process", path, Std.string (width), Std.string (height), temp ], true, true); if (FileSystem.exists (temp)) { @@ -49,7 +49,7 @@ class ImageHelper { } catch (e:Dynamic) {} - var rasterizer = PathHelper.getHaxelib (new Haxelib ("lime")) + "/templates/bin/batik/batik-rasterizer.jar"; + var rasterizer = Haxelib.getPath (new Haxelib ("lime")) + "/templates/bin/batik/batik-rasterizer.jar"; var args = [ "-Dapple.awt.UIElement=true", "-jar", rasterizer, "-d", temp, "-w", Std.string (width), "-h", Std.string (height) ]; if (backgroundColor != null) { @@ -66,7 +66,7 @@ class ImageHelper { args.push (path); - if (PlatformHelper.hostPlatform == MAC) { + if (System.hostPlatform == MAC) { try { @@ -98,11 +98,11 @@ class ImageHelper { if (Log.verbose) { - ProcessHelper.runCommand ("", "java", args, true, true); + System.runCommand ("", "java", args, true, true); } else { - ProcessHelper.runProcess ("", "java", args, true, true, true); + System.runProcess ("", "java", args, true, true, true); } diff --git a/src/lime/tools/JavaHelper.hx b/src/lime/tools/JavaHelper.hx index a3420a565..706a6dfd2 100644 --- a/src/lime/tools/JavaHelper.hx +++ b/src/lime/tools/JavaHelper.hx @@ -10,7 +10,7 @@ class JavaHelper { public static function copyLibraries (templatePaths:Array, platformName:String, targetPath:String) { - FileHelper.recursiveCopyTemplate (templatePaths, "java/ndll/" + platformName, targetPath); + System.recursiveCopyTemplate (templatePaths, "java/ndll/" + platformName, targetPath); } diff --git a/src/lime/tools/Library.hx b/src/lime/tools/Library.hx index a1cb2b27f..16505bda3 100644 --- a/src/lime/tools/Library.hx +++ b/src/lime/tools/Library.hx @@ -1,7 +1,7 @@ package lime.tools; -import haxe.io.Path; +import hxp.Path; class Library { diff --git a/src/lime/tools/ModuleData.hx b/src/lime/tools/ModuleData.hx index 786f6383e..a84a2be61 100644 --- a/src/lime/tools/ModuleData.hx +++ b/src/lime/tools/ModuleData.hx @@ -1,7 +1,7 @@ package lime.tools; -import hxp.ArrayHelper; +import hxp.ArrayTools; class ModuleData { @@ -41,10 +41,10 @@ class ModuleData { if (other.name == name) { - classNames = ArrayHelper.concatUnique (classNames, other.classNames); - excludeTypes = ArrayHelper.concatUnique (excludeTypes, other.excludeTypes); - haxeflags = ArrayHelper.concatUnique (haxeflags, other.haxeflags); - includeTypes = ArrayHelper.concatUnique (includeTypes, other.includeTypes); + classNames = ArrayTools.concatUnique (classNames, other.classNames); + excludeTypes = ArrayTools.concatUnique (excludeTypes, other.excludeTypes); + haxeflags = ArrayTools.concatUnique (haxeflags, other.haxeflags); + includeTypes = ArrayTools.concatUnique (includeTypes, other.includeTypes); return true; } diff --git a/src/lime/tools/ModuleHelper.hx b/src/lime/tools/ModuleHelper.hx index dbdfd920b..77538313c 100644 --- a/src/lime/tools/ModuleHelper.hx +++ b/src/lime/tools/ModuleHelper.hx @@ -1,7 +1,7 @@ package lime.tools; #if !macro -import haxe.io.Path; +import hxp.Path; import lime.tools.Dependency; import hxp.Haxelib; import hxp.*; @@ -29,7 +29,7 @@ class ModuleHelper { if (packageName != null && packageName.length > 0) { - path = PathHelper.combine (source, StringTools.replace (packageName, ".", "/")); + path = Path.combine (source, StringTools.replace (packageName, ".", "/")); } @@ -40,11 +40,11 @@ class ModuleHelper { public static function buildModules (project:Project, tempDirectory:String, outputDirectory:String):Void { - tempDirectory = PathHelper.combine (tempDirectory, "lib"); - outputDirectory = PathHelper.combine (outputDirectory, "lib"); + tempDirectory = Path.combine (tempDirectory, "lib"); + outputDirectory = Path.combine (outputDirectory, "lib"); - PathHelper.mkdir (tempDirectory); - PathHelper.mkdir (outputDirectory); + System.mkdir (tempDirectory); + System.mkdir (outputDirectory); var importName, hxmlPath, importPath, outputPath, moduleImport, hxml; @@ -54,16 +54,16 @@ class ModuleHelper { importName = "Module" + module.name.charAt (0).toUpperCase () + module.name.substr (1); - hxmlPath = PathHelper.combine (tempDirectory, module.name + ".hxml"); - importPath = PathHelper.combine (tempDirectory, importName + ".hx"); + hxmlPath = Path.combine (tempDirectory, module.name + ".hxml"); + importPath = Path.combine (tempDirectory, importName + ".hx"); if (project.targetFlags.exists ("final")) { - outputPath = PathHelper.combine (outputDirectory, module.name + ".min.js"); + outputPath = Path.combine (outputDirectory, module.name + ".min.js"); } else { - outputPath = PathHelper.combine (outputDirectory, module.name + ".js"); + outputPath = Path.combine (outputDirectory, module.name + ".js"); } @@ -74,7 +74,7 @@ class ModuleHelper { for (haxelib in project.haxelibs) { - hxml += "\n-cp " + PathHelper.getHaxelib (haxelib); + hxml += "\n-cp " + Haxelib.getPath (haxelib); } @@ -111,8 +111,8 @@ class ModuleHelper { if (otherModule != module) { - excludeTypes = excludeTypes.concat (ArrayHelper.getUnique (includeTypes, otherModule.classNames)); - excludeTypes = excludeTypes.concat (ArrayHelper.getUnique (includeTypes, otherModule.includeTypes)); + excludeTypes = excludeTypes.concat (ArrayTools.getUnique (includeTypes, otherModule.classNames)); + excludeTypes = excludeTypes.concat (ArrayTools.getUnique (includeTypes, otherModule.includeTypes)); } @@ -136,7 +136,7 @@ class ModuleHelper { File.saveContent (importPath, moduleImport); File.saveContent (hxmlPath, hxml); - ProcessHelper.runCommand ("", "haxe", [ hxmlPath ]); + System.runCommand ("", "haxe", [ hxmlPath ]); patchFile (outputPath); @@ -160,7 +160,7 @@ class ModuleHelper { for (file in files) { - filePath = PathHelper.combine (currentPath, file); + filePath = Path.combine (currentPath, file); if (FileSystem.isDirectory (filePath)) { @@ -171,7 +171,7 @@ class ModuleHelper { packageName = StringTools.replace (packageName, "/", "."); - if (StringHelper.filter (packageName, include, exclude)) { + if (StringTools.filter (packageName, include, exclude)) { parseModuleSource (source, moduleData, include, exclude, filePath); @@ -189,7 +189,7 @@ class ModuleHelper { className = StringTools.replace (className, "/", "."); className = StringTools.replace (className, ".hx", ""); - if (StringHelper.filter (className, include, exclude)) { + if (StringTools.filter (className, include, exclude)) { moduleData.classNames.push (className); @@ -207,7 +207,7 @@ class ModuleHelper { var replaceString = "var $hxClasses = {}"; var replacement = "if (!$hx_exports.$hxClasses) $hx_exports.$hxClasses = {};\nvar $hxClasses = $hx_exports.$hxClasses"; - FileHelper.replaceText (outputPath, replaceString, replacement); + System.replaceText (outputPath, replaceString, replacement); } @@ -222,9 +222,9 @@ class ModuleHelper { project.dependencies.push (new Dependency ("./lib/" + module.name + suffix, null)); - excludeTypes = ArrayHelper.concatUnique (excludeTypes, module.classNames); - excludeTypes = ArrayHelper.concatUnique (excludeTypes, module.excludeTypes); - excludeTypes = ArrayHelper.concatUnique (excludeTypes, module.includeTypes); + excludeTypes = ArrayTools.concatUnique (excludeTypes, module.classNames); + excludeTypes = ArrayTools.concatUnique (excludeTypes, module.excludeTypes); + excludeTypes = ArrayTools.concatUnique (excludeTypes, module.includeTypes); hasModules = true; diff --git a/src/lime/tools/NekoHelper.hx b/src/lime/tools/NekoHelper.hx index f08b9f54b..93a9e4280 100644 --- a/src/lime/tools/NekoHelper.hx +++ b/src/lime/tools/NekoHelper.hx @@ -1,8 +1,8 @@ package lime.tools; -import haxe.io.Path; -import hxp.PlatformHelper; +import hxp.Path; +import hxp.System; import hxp.Haxelib; import lime.tools.Platform; import hxp.*; @@ -15,14 +15,14 @@ class NekoHelper { public static function copyLibraries (templatePaths:Array, platformName:String, targetPath:String) { - //FileHelper.recursiveCopyTemplate (templatePaths, "neko/ndll/" + platformName, targetPath); + //System.recursiveCopyTemplate (templatePaths, "neko/ndll/" + platformName, targetPath); } public static function createExecutable (templatePaths:Array, platformName:String, source:String, target:String, iconPath:String = null):Void { - /*var executablePath = PathHelper.findTemplate (templatePaths, "neko/bin/neko-" + platformName); + /*var executablePath = System.findTemplate (templatePaths, "neko/bin/neko-" + platformName); var executable = File.getBytes (executablePath); var sourceContents = File.getBytes (source); @@ -33,28 +33,28 @@ class NekoHelper { output.writeInt32 (executable.length); output.close ();*/ - var path = PathHelper.tryFullPath (source); + var path = Path.tryFullPath (source); var file = Path.withoutDirectory (path); var dir = Path.directory (path); - ProcessHelper.runCommand (dir, "nekotools", [ "boot", file ]); + System.runCommand (dir, "nekotools", [ "boot", file ]); var path = Path.withoutExtension (source); - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { path += ".exe"; } - FileHelper.copyFile (path, target); + System.copyFile (path, target); } public static function createWindowsExecutable (templatePaths:Array, source:String, target:String, iconPath:String):Void { - /*var executablePath = PathHelper.findTemplate (templatePaths, "neko/bin/neko-windows"); + /*var executablePath = System.findTemplate (templatePaths, "neko/bin/neko-windows"); var executable = File.getBytes (executablePath); var sourceContents = File.getBytes (source); @@ -62,10 +62,10 @@ class NekoHelper { output.write (executable); output.close (); - if (iconPath != null && PlatformHelper.hostPlatform == WINDOWS) { + if (iconPath != null && System.hostPlatform == WINDOWS) { - var templates = [ PathHelper.getHaxelib (new Haxelib (#if lime "lime" #else "hxp" #end)) + "/templates" ].concat (templatePaths); - ProcessHelper.runCommand ("", PathHelper.findTemplate (templates, "bin/ReplaceVistaIcon.exe"), [ target, iconPath, "1" ], true, true); + var templates = [ Haxelib.getPath (new Haxelib (#if lime "lime" #else "hxp" #end)) + "/templates" ].concat (templatePaths); + System.runCommand ("", System.findTemplate (templates, "bin/ReplaceVistaIcon.exe"), [ target, iconPath, "1" ], true, true); } diff --git a/src/lime/tools/NodeJSHelper.hx b/src/lime/tools/NodeJSHelper.hx index e62c52deb..f5970da58 100644 --- a/src/lime/tools/NodeJSHelper.hx +++ b/src/lime/tools/NodeJSHelper.hx @@ -1,7 +1,7 @@ package lime.tools; -import haxe.io.Path; +import hxp.Path; import lime.tools.Architecture; import hxp.Haxelib; import lime.tools.Project; @@ -14,7 +14,7 @@ class NodeJSHelper { public static function run (project:Project, modulePath:String, args:Array = null):Void { - /*var suffix = switch (PlatformHelper.hostPlatform) { + /*var suffix = switch (System.hostPlatform) { case Platform.WINDOWS: "-windows.exe"; case Platform.MAC: "-mac"; @@ -25,7 +25,7 @@ class NodeJSHelper { if (suffix == "-linux") { - if (PlatformHelper.hostArchitecture == X86) { + if (System.hostArchitecture == X86) { suffix += "32"; @@ -37,10 +37,10 @@ class NodeJSHelper { } - var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib (#if lime "lime" #else "hxp" #end)), "templates") ].concat (project.templatePaths); - var node = PathHelper.findTemplate (templatePaths, "bin/node/node" + suffix); + var templatePaths = [ Path.combine (Haxelib.getPath (new Haxelib (#if lime "lime" #else "hxp" #end)), "templates") ].concat (project.templatePaths); + var node = System.findTemplate (templatePaths, "bin/node/node" + suffix); - if (PlatformHelper.hostPlatform != WINDOWS) { + if (System.hostPlatform != WINDOWS) { Sys.command ("chmod", [ "+x", node ]); @@ -54,7 +54,7 @@ class NodeJSHelper { args.unshift (Path.withoutDirectory (modulePath)); - ProcessHelper.runCommand (Path.directory (modulePath), "node", args); + System.runCommand (Path.directory (modulePath), "node", args); } diff --git a/src/lime/tools/PlatformTargetMain.hx b/src/lime/tools/PlatformTargetMain.hx index a7caccf2a..c4de6e923 100644 --- a/src/lime/tools/PlatformTargetMain.hx +++ b/src/lime/tools/PlatformTargetMain.hx @@ -1,16 +1,16 @@ package lime.tools; -import haxe.io.Path; +import hxp.Path; import haxe.Unserializer; import lime.tools.Architecture; import hxp.Haxelib; import lime.tools.Project; import lime.tools.Platform; -import hxp.HaxelibHelper; +import hxp.Haxelib; import hxp.Log; -import hxp.PathHelper; -import hxp.PlatformHelper; +import hxp.Path; +import hxp.System; import sys.io.File; import sys.io.Process; import sys.FileSystem; @@ -69,11 +69,11 @@ class PlatformTargetMain { if (FileSystem.exists ("tools.n")) { - HaxelibHelper.setOverridePath (new Haxelib("lime"), PathHelper.combine (Sys.getCwd (), "../")); + Haxelib.setOverridePath (new Haxelib("lime"), Path.combine (Sys.getCwd (), "../")); } else if (FileSystem.exists ("run.n")) { - HaxelibHelper.setOverridePath (new Haxelib("lime"), Sys.getCwd ()); + Haxelib.setOverridePath (new Haxelib("lime"), Sys.getCwd ()); } diff --git a/src/lime/tools/Project.hx b/src/lime/tools/Project.hx index c1f4acd7c..ddc1dd2f2 100644 --- a/src/lime/tools/Project.hx +++ b/src/lime/tools/Project.hx @@ -2,26 +2,26 @@ package lime.tools; import haxe.io.Eof; -import haxe.io.Path; +import hxp.Path; import haxe.xml.Fast; import haxe.Json; import haxe.Serializer; import haxe.Unserializer; import lime.tools.Architecture; -import hxp.ArrayHelper; -import hxp.FileHelper; +import hxp.ArrayTools; +import hxp.System; +import hxp.Haxelib; import hxp.Haxelib; -import hxp.HaxelibHelper; import hxp.Log; import hxp.NDLL; -import hxp.ObjectHelper; -import hxp.PathHelper; +import hxp.ObjectTools; +import hxp.Path; import lime.tools.Platform; -import hxp.PlatformHelper; -import hxp.ProcessHelper; +import hxp.System; +import hxp.System; import hxp.Script; -import hxp.StringHelper; -import hxp.StringMapHelper; +import hxp.StringTools; +import hxp.MapTools; import lime.tools.AssetType; import sys.FileSystem; import sys.io.File; @@ -113,10 +113,10 @@ class Project extends Script { Log.enableColor = inputData.logEnableColor; #if lime - ProcessHelper.dryRun = inputData.processDryRun; + System.dryRun = inputData.processDryRun; #end - HaxelibHelper.debug = inputData.haxelibDebug; + Haxelib.debug = inputData.haxelibDebug; initialize (); @@ -142,7 +142,7 @@ class Project extends Script { config = new ConfigData (); debug = _debug; target = _target; - targetFlags = StringMapHelper.copy (_targetFlags); + targetFlags = MapTools.copy (_targetFlags); templatePaths = _templatePaths.copy (); defaultMeta = { title: "MyApplication", description: "", packageName: "com.example.myapp", version: "1.0.0", company: "", companyUrl: "", buildNumber: null, companyId: "" } @@ -246,7 +246,7 @@ class Project extends Script { } else { - switch (PlatformHelper.hostArchitecture) { + switch (System.hostArchitecture) { case ARMV6: architectures = [ ARMV6 ]; case ARMV7: architectures = [ ARMV7 ]; case X86: architectures = [ X86 ]; @@ -261,7 +261,7 @@ class Project extends Script { case MAC, LINUX: platformType = PlatformType.DESKTOP; - switch (PlatformHelper.hostArchitecture) { + switch (System.hostArchitecture) { case ARMV6: architectures = [ ARMV6 ]; case ARMV7: architectures = [ ARMV7 ]; case X86: architectures = [ X86 ]; @@ -286,15 +286,15 @@ class Project extends Script { defaultArchitectures = architectures.copy (); - meta = ObjectHelper.copyFields (defaultMeta, {}); - app = ObjectHelper.copyFields (defaultApp, {}); - window = ObjectHelper.copyFields (defaultWindow, {}); + meta = ObjectTools.copyFields (defaultMeta, {}); + app = ObjectTools.copyFields (defaultApp, {}); + window = ObjectTools.copyFields (defaultWindow, {}); windows = [ window ]; assets = new Array (); if (_userDefines != null) { - defines = StringMapHelper.copy (_userDefines); + defines = MapTools.copy (_userDefines); } else { @@ -338,7 +338,7 @@ class Project extends Script { var project = new Project (); - ObjectHelper.copyFields (app, project.app); + ObjectTools.copyFields (app, project.app); project.architectures = architectures.copy (); project.assets = assets.copy (); @@ -412,7 +412,7 @@ class Project extends Script { } - ObjectHelper.copyFields (meta, project.meta); + ObjectTools.copyFields (meta, project.meta); for (key in modules.keys ()) { @@ -456,7 +456,7 @@ class Project extends Script { for (i in 0...windows.length) { - project.windows[i] = (ObjectHelper.copyFields (windows[i], {})); + project.windows[i] = (ObjectTools.copyFields (windows[i], {})); } @@ -530,16 +530,16 @@ class Project extends Script { var name = Path.withoutDirectory (Path.withoutExtension (projectFile)); name = name.substr (0, 1).toUpperCase () + name.substr (1); - var tempDirectory = PathHelper.getTemporaryDirectory (); - var classFile = PathHelper.combine (tempDirectory, name + ".hx"); - var nekoOutput = PathHelper.combine (tempDirectory, name + ".n"); + var tempDirectory = System.getTemporaryDirectory (); + var classFile = Path.combine (tempDirectory, name + ".hx"); + var nekoOutput = Path.combine (tempDirectory, name + ".n"); - FileHelper.copyFile (path, classFile); + System.copyFile (path, classFile); #if lime - var args = [ name, "-main", "lime.tools.Project", "-cp", tempDirectory, "-neko", nekoOutput, "-cp", PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("hxp")), "src"), "-lib", "hxp" ]; + var args = [ name, "-main", "lime.tools.Project", "-cp", tempDirectory, "-neko", nekoOutput, "-cp", Path.combine (Haxelib.getPath (new Haxelib ("hxp")), "src"), "-lib", "hxp" ]; #else - var args = [ name, "--interp", "-main", "lime.tools.Project", "-cp", tempDirectory, "-cp", PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("hxp")), "src") ]; + var args = [ name, "--interp", "-main", "lime.tools.Project", "-cp", tempDirectory, "-cp", Path.combine (Haxelib.getPath (new Haxelib ("hxp")), "src") ]; #end var input = File.read (classFile, false); var tag = "@:compiler("; @@ -562,15 +562,15 @@ class Project extends Script { input.close (); - var cacheDryRun = ProcessHelper.dryRun; - ProcessHelper.dryRun = false; + var cacheDryRun = System.dryRun; + System.dryRun = false; #if lime - ProcessHelper.runCommand ("", "haxe", args); + System.runCommand ("", "haxe", args); #end - var inputFile = PathHelper.combine (tempDirectory, "input.dat"); - var outputFile = PathHelper.combine (tempDirectory, "output.dat"); + var inputFile = Path.combine (tempDirectory, "input.dat"); + var outputFile = Path.combine (tempDirectory, "output.dat"); var inputData = Serializer.run ({ @@ -585,7 +585,7 @@ class Project extends Script { logVerbose: Log.verbose, logEnableColor: Log.enableColor, processDryRun: cacheDryRun, - haxelibDebug: HaxelibHelper.debug + haxelibDebug: Haxelib.debug }); @@ -594,9 +594,9 @@ class Project extends Script { try { #if lime - ProcessHelper.runCommand ("", "neko", [ FileSystem.fullPath (nekoOutput), inputFile, outputFile ]); + System.runCommand ("", "neko", [ FileSystem.fullPath (nekoOutput), inputFile, outputFile ]); #else - ProcessHelper.runCommand ("", "haxe", args.concat ([ "--", inputFile, outputFile ])); + System.runCommand ("", "haxe", args.concat ([ "--", inputFile, outputFile ])); #end } catch (e:Dynamic) { @@ -606,7 +606,7 @@ class Project extends Script { } - ProcessHelper.dryRun = cacheDryRun; + System.dryRun = cacheDryRun; var tPaths:Array = []; @@ -614,7 +614,7 @@ class Project extends Script { FileSystem.deleteFile (inputFile); - var outputPath = PathHelper.combine (tempDirectory, "output.dat"); + var outputPath = Path.combine (tempDirectory, "output.dat"); if (FileSystem.exists (outputPath)) { @@ -634,7 +634,7 @@ class Project extends Script { } catch (e:Dynamic) {} - PathHelper.removeDirectory (tempDirectory); + System.removeDirectory (tempDirectory); if (project != null) { @@ -644,13 +644,13 @@ class Project extends Script { } - var defines = StringMapHelper.copy (userDefines); - StringMapHelper.copyKeys (project.defines, defines); + var defines = MapTools.copyDynamic (userDefines); + MapTools.copyKeys (project.defines, defines); processHaxelibs (project, defines); //Adding template paths from the Project file - project.templatePaths = ArrayHelper.concatUnique (project.templatePaths, tPaths, true); + project.templatePaths = ArrayTools.concatUnique (project.templatePaths, tPaths, true); } return project; @@ -666,7 +666,7 @@ class Project extends Script { } - var path = PathHelper.getHaxelib (haxelib, false, clearCache); + var path = Haxelib.getPath (haxelib, false, clearCache); if (path == null || path == "") { @@ -676,7 +676,7 @@ class Project extends Script { //if (!userDefines.exists (haxelib.name)) { // - //userDefines.set (haxelib.name, HaxelibHelper.getVersion (haxelib)); + //userDefines.set (haxelib.name, Haxelib.getVersion (haxelib)); // //} @@ -698,9 +698,9 @@ class Project extends Script { for (file in files) { - if (projectFile == null && FileSystem.exists (PathHelper.combine (path, file))) { + if (projectFile == null && FileSystem.exists (Path.combine (path, file))) { - projectFile = PathHelper.combine (path, file); + projectFile = Path.combine (path, file); } @@ -712,7 +712,7 @@ class Project extends Script { if (project.config.get ("project.rebuild.path") == null) { - project.config.set ("project.rebuild.path", PathHelper.combine (path, "project")); + project.config.set ("project.rebuild.path", Path.combine (path, "project")); } @@ -731,8 +731,8 @@ class Project extends Script { if (version == "" || version == null) { - var haxelibPath = PathHelper.getHaxelib (haxelib); - var jsonPath = PathHelper.combine (haxelibPath, "haxelib.json"); + var haxelibPath = Haxelib.getPath (haxelib); + var jsonPath = Path.combine (haxelibPath, "haxelib.json"); try { @@ -852,7 +852,7 @@ class Project extends Script { if (_target == null) { - _target = cast PlatformHelper.hostPlatform; + _target = cast System.hostPlatform; } @@ -879,28 +879,28 @@ class Project extends Script { if (project != null) { - ObjectHelper.copyUniqueFields (project.meta, meta, project.defaultMeta); - ObjectHelper.copyUniqueFields (project.app, app, project.defaultApp); + ObjectTools.copyUniqueFields (project.meta, meta, project.defaultMeta); + ObjectTools.copyUniqueFields (project.app, app, project.defaultApp); for (i in 0...project.windows.length) { if (i < windows.length) { - ObjectHelper.copyUniqueFields (project.windows[i], windows[i], project.defaultWindow); + ObjectTools.copyUniqueFields (project.windows[i], windows[i], project.defaultWindow); } else { - windows.push (ObjectHelper.copyFields (project.windows[i], {})); + windows.push (ObjectTools.copyFields (project.windows[i], {})); } } - StringMapHelper.copyUniqueKeys (project.defines, defines); - StringMapHelper.copyUniqueKeys (project.environment, environment); - StringMapHelper.copyUniqueKeys (project.haxedefs, haxedefs); - StringMapHelper.copyUniqueKeys (project.libraryHandlers, libraryHandlers); - StringMapHelper.copyUniqueKeys (project.targetHandlers, targetHandlers); + MapTools.copyUniqueKeys (project.defines, defines); + MapTools.copyUniqueKeys (project.environment, environment); + MapTools.copyUniqueKeysDynamic (project.haxedefs, haxedefs); + MapTools.copyUniqueKeys (project.libraryHandlers, libraryHandlers); + MapTools.copyUniqueKeys (project.targetHandlers, targetHandlers); config.merge (project.config); @@ -928,12 +928,12 @@ class Project extends Script { } - assets = ArrayHelper.concatUnique (assets, project.assets); - dependencies = ArrayHelper.concatUnique (dependencies, project.dependencies, true); - haxeflags = ArrayHelper.concatUnique (haxeflags, project.haxeflags); - haxelibs = ArrayHelper.concatUnique (haxelibs, project.haxelibs, true, "name"); - icons = ArrayHelper.concatUnique (icons, project.icons); - javaPaths = ArrayHelper.concatUnique (javaPaths, project.javaPaths, true); + assets = ArrayTools.concatUnique (assets, project.assets); + dependencies = ArrayTools.concatUnique (dependencies, project.dependencies, true); + haxeflags = ArrayTools.concatUnique (haxeflags, project.haxeflags); + haxelibs = ArrayTools.concatUnique (haxelibs, project.haxelibs, true, "name"); + icons = ArrayTools.concatUnique (icons, project.icons); + javaPaths = ArrayTools.concatUnique (javaPaths, project.javaPaths, true); if (keystore == null) { @@ -945,8 +945,8 @@ class Project extends Script { } - languages = ArrayHelper.concatUnique (languages, project.languages, true); - libraries = ArrayHelper.concatUnique (libraries, project.libraries, true); + languages = ArrayTools.concatUnique (languages, project.languages, true); + libraries = ArrayTools.concatUnique (libraries, project.libraries, true); for (key in project.modules.keys ()) { @@ -962,13 +962,13 @@ class Project extends Script { } - ndlls = ArrayHelper.concatUnique (ndlls, project.ndlls); + ndlls = ArrayTools.concatUnique (ndlls, project.ndlls); postBuildCallbacks = postBuildCallbacks.concat (project.postBuildCallbacks); preBuildCallbacks = preBuildCallbacks.concat (project.preBuildCallbacks); - samplePaths = ArrayHelper.concatUnique (samplePaths, project.samplePaths, true); - sources = ArrayHelper.concatUnique (sources, project.sources, true); - splashScreens = ArrayHelper.concatUnique (splashScreens, project.splashScreens); - templatePaths = ArrayHelper.concatUnique (templatePaths, project.templatePaths, true); + samplePaths = ArrayTools.concatUnique (samplePaths, project.samplePaths, true); + sources = ArrayTools.concatUnique (sources, project.sources, true); + splashScreens = ArrayTools.concatUnique (splashScreens, project.splashScreens); + templatePaths = ArrayTools.concatUnique (templatePaths, project.templatePaths, true); } @@ -999,7 +999,7 @@ class Project extends Script { for (haxelib in haxelibs) { - var validatePath = PathHelper.getHaxelib (haxelib, true); + var validatePath = Haxelib.getPath (haxelib, true); project.haxelibs.push (haxelib); var includeProject = Project.fromHaxelib (haxelib, userDefines); @@ -1055,9 +1055,9 @@ class Project extends Script { if (name == "HAXELIB_PATH") { - var currentPath = HaxelibHelper.getRepositoryPath (); + var currentPath = Haxelib.getRepositoryPath (); Sys.putEnv (name, value); - var newPath = HaxelibHelper.getRepositoryPath (true); + var newPath = Haxelib.getRepositoryPath (true); if (currentPath != newPath) { @@ -1099,7 +1099,7 @@ class Project extends Script { private function get_host ():Platform { - return cast PlatformHelper.hostPlatform; + return cast System.hostPlatform; } @@ -1118,12 +1118,12 @@ class Project extends Script { } - ObjectHelper.copyMissingFields (defaultApp, app); - ObjectHelper.copyMissingFields (defaultMeta, meta); + ObjectTools.copyMissingFields (defaultApp, app); + ObjectTools.copyMissingFields (defaultMeta, meta); for (item in windows) { - ObjectHelper.copyMissingFields (defaultWindow, item); + ObjectTools.copyMissingFields (defaultWindow, item); } @@ -1131,7 +1131,7 @@ class Project extends Script { for (field in Reflect.fields (app)) { - Reflect.setField (context, "APP_" + StringHelper.formatUppercaseVariable (field), Reflect.field (app, field)); + Reflect.setField (context, "APP_" + StringTools.formatUppercaseVariable (field), Reflect.field (app, field)); } @@ -1147,8 +1147,8 @@ class Project extends Script { for (field in Reflect.fields (meta)) { - Reflect.setField (context, "APP_" + StringHelper.formatUppercaseVariable (field), Reflect.field (meta, field)); - Reflect.setField (context, "META_" + StringHelper.formatUppercaseVariable (field), Reflect.field (meta, field)); + Reflect.setField (context, "APP_" + StringTools.formatUppercaseVariable (field), Reflect.field (meta, field)); + Reflect.setField (context, "META_" + StringTools.formatUppercaseVariable (field), Reflect.field (meta, field)); } @@ -1156,8 +1156,8 @@ class Project extends Script { for (field in Reflect.fields (windows[0])) { - Reflect.setField (context, "WIN_" + StringHelper.formatUppercaseVariable (field), Reflect.field (windows[0], field)); - Reflect.setField (context, "WINDOW_" + StringHelper.formatUppercaseVariable (field), Reflect.field (windows[0], field)); + Reflect.setField (context, "WIN_" + StringTools.formatUppercaseVariable (field), Reflect.field (windows[0], field)); + Reflect.setField (context, "WINDOW_" + StringTools.formatUppercaseVariable (field), Reflect.field (windows[0], field)); } @@ -1179,7 +1179,7 @@ class Project extends Script { for (field in Reflect.fields (windows[i])) { - Reflect.setField (context, "WINDOW_" + StringHelper.formatUppercaseVariable (field) + "_" + i, Reflect.field (windows[i], field)); + Reflect.setField (context, "WINDOW_" + StringTools.formatUppercaseVariable (field) + "_" + i, Reflect.field (windows[i], field)); } @@ -1201,7 +1201,7 @@ class Project extends Script { if (StringTools.startsWith (haxeflag, "-lib")) { - Reflect.setField (context, "LIB_" + StringHelper.formatUppercaseVariable (haxeflag.substr (5)), "true"); + Reflect.setField (context, "LIB_" + StringTools.formatUppercaseVariable (haxeflag.substr (5)), "true"); } @@ -1214,9 +1214,9 @@ class Project extends Script { if (asset.type != AssetType.TEMPLATE) { var embeddedAsset:Dynamic = { }; - ObjectHelper.copyFields (asset, embeddedAsset); + ObjectTools.copyFields (asset, embeddedAsset); - embeddedAsset.sourcePath = PathHelper.standardize (asset.sourcePath); + embeddedAsset.sourcePath = Path.standardize (asset.sourcePath); if (asset.embed == null) { @@ -1254,7 +1254,7 @@ class Project extends Script { for (library in libraries) { var embeddedLibrary:Dynamic = { }; - ObjectHelper.copyFields (library, embeddedLibrary); + ObjectTools.copyFields (library, embeddedLibrary); context.libraries.push (embeddedLibrary); embeddedLibraries[library.name] = embeddedLibrary; @@ -1278,7 +1278,7 @@ class Project extends Script { for (ndll in ndlls) { var templateNDLL:Dynamic = { }; - ObjectHelper.copyFields (ndll, templateNDLL); + ObjectTools.copyFields (ndll, templateNDLL); templateNDLL.nameSafe = StringTools.replace (ndll.name, "-", "_"); context.ndlls.push (templateNDLL); @@ -1296,7 +1296,7 @@ class Project extends Script { // TODO: Handle real version when better/smarter haxelib available var version = haxelib.version; - //var version = HaxelibHelper.getVersion (haxelib); + //var version = Haxelib.getVersion (haxelib); if (version != null && version != "") { @@ -1306,21 +1306,21 @@ class Project extends Script { // #if lime - if (HaxelibHelper.pathOverrides.exists (name)) { + if (Haxelib.pathOverrides.exists (name)) { - var param = "-cp " + HaxelibHelper.pathOverrides.get (name); + var param = "-cp " + Haxelib.pathOverrides.get (name); compilerFlags.remove (param); compilerFlags.push (param); } else { var cache = Log.verbose; - Log.verbose = HaxelibHelper.debug; + Log.verbose = Haxelib.debug; var output = ""; try { - output = HaxelibHelper.runProcess ("", [ "path", name ], true, true, true); + output = Haxelib.runProcess ("", [ "path", name ], true, true, true); } catch (e:Dynamic) { } @@ -1341,7 +1341,7 @@ class Project extends Script { } else if (!StringTools.startsWith (arg, "-")) { - var path = PathHelper.standardize (arg); + var path = Path.standardize (arg); if (path != null && StringTools.trim (path) != "" && !StringTools.startsWith (StringTools.trim (path), "#")) { @@ -1352,7 +1352,7 @@ class Project extends Script { } var version = "0.0.0"; - var jsonPath = PathHelper.combine (path, "haxelib.json"); + var jsonPath = Path.combine (path, "haxelib.json"); try { @@ -1360,7 +1360,7 @@ class Project extends Script { var json = Json.parse (File.getContent (jsonPath)); haxelibName = json.name; - compilerFlags = ArrayHelper.concatUnique (compilerFlags, [ "-D " + haxelibName + "=" + json.version ], true); + compilerFlags = ArrayTools.concatUnique (compilerFlags, [ "-D " + haxelibName + "=" + json.version ], true); } @@ -1374,24 +1374,24 @@ class Project extends Script { if (name != haxelibName) { - compilerFlags = ArrayHelper.concatUnique (compilerFlags, [ "-D " + name ], true); + compilerFlags = ArrayTools.concatUnique (compilerFlags, [ "-D " + name ], true); } /*var haxelib = new Haxelib (arg.substr (3)); - var path = PathHelper.getHaxelib (haxelib); + var path = Haxelib.getPath (haxelib); var version = getHaxelibVersion (haxelib); if (path != null) { CompatibilityHelper.patchProject (this, haxelib, version); - compilerFlags = ArrayHelper.concatUnique (compilerFlags, [ "-D " + haxelib.name + "=" + version ], true); + compilerFlags = ArrayTools.concatUnique (compilerFlags, [ "-D " + haxelib.name + "=" + version ], true); }*/ } else if (!StringTools.startsWith (arg, "-L")) { - compilerFlags = ArrayHelper.concatUnique (compilerFlags, [ arg ], true); + compilerFlags = ArrayTools.concatUnique (compilerFlags, [ arg ], true); } @@ -1409,7 +1409,7 @@ class Project extends Script { // #end - Reflect.setField (context, "LIB_" + StringHelper.formatUppercaseVariable (haxelib.name), true); + Reflect.setField (context, "LIB_" + StringTools.formatUppercaseVariable (haxelib.name), true); if (name == "nme") { @@ -1435,11 +1435,11 @@ class Project extends Script { if (value == null || value == "") { - Reflect.setField (context, "SET_" + StringHelper.formatUppercaseVariable (key), true); + Reflect.setField (context, "SET_" + StringTools.formatUppercaseVariable (key), true); } else { - Reflect.setField (context, "SET_" + StringHelper.formatUppercaseVariable (key), value); + Reflect.setField (context, "SET_" + StringTools.formatUppercaseVariable (key), value); } @@ -1453,13 +1453,13 @@ class Project extends Script { compilerFlags.push ("-D " + key); - Reflect.setField (context, "DEFINE_" + StringHelper.formatUppercaseVariable (key), true); + Reflect.setField (context, "DEFINE_" + StringTools.formatUppercaseVariable (key), true); } else { compilerFlags.push ("-D " + key + "=" + value); - Reflect.setField (context, "DEFINE_" + StringHelper.formatUppercaseVariable (key), value); + Reflect.setField (context, "DEFINE_" + StringTools.formatUppercaseVariable (key), value); } @@ -1513,7 +1513,7 @@ class Project extends Script { for (templatePath in templatePaths) { - var path = PathHelper.combine (templatePath, hxml); + var path = Path.combine (templatePath, hxml); if (FileSystem.exists (path)) { @@ -1531,7 +1531,7 @@ class Project extends Script { if (keystore != null) { - context.KEY_STORE = PathHelper.tryFullPath (keystore.path); + context.KEY_STORE = Path.tryFullPath (keystore.path); if (keystore.password != null) { diff --git a/src/lime/tools/ProjectHelper.hx b/src/lime/tools/ProjectHelper.hx index 4a63249e7..fd3a53cc2 100644 --- a/src/lime/tools/ProjectHelper.hx +++ b/src/lime/tools/ProjectHelper.hx @@ -21,11 +21,11 @@ class ProjectHelper { public static function copyLibrary (project:Project, ndll:NDLL, directoryName:String, namePrefix:String, nameSuffix:String, targetDirectory:String, allowDebug:Bool = false, targetSuffix:String = null) { - var path = PathHelper.getLibraryPath (ndll, directoryName, namePrefix, nameSuffix, allowDebug); + var path = NDLL.getLibraryPath (ndll, directoryName, namePrefix, nameSuffix, allowDebug); if (FileSystem.exists (path)) { - var targetPath = PathHelper.combine (targetDirectory, namePrefix + ndll.name); + var targetPath = Path.combine (targetDirectory, namePrefix + ndll.name); if (targetSuffix != null) { @@ -41,7 +41,7 @@ class ProjectHelper { Log.info ("", " - \x1b[1mCopying library file:\x1b[0m " + path + " \x1b[3;37m->\x1b[0m " + targetPath); - PathHelper.mkdir (targetDirectory); + System.mkdir (targetDirectory); try { @@ -73,9 +73,9 @@ class ProjectHelper { var args = Sys.args (); args.remove ("-watch"); - if (HaxelibHelper.pathOverrides.exists ("lime-tools")) { + if (Haxelib.pathOverrides.exists ("lime-tools")) { - var tools = HaxelibHelper.pathOverrides.get ("lime-tools"); + var tools = Haxelib.pathOverrides.get ("lime-tools"); return "neko " + tools + "/tools.n " + args.join (" "); @@ -93,17 +93,17 @@ class ProjectHelper { public static function recursiveSmartCopyTemplate (project:Project, source:String, destination:String, context:Dynamic = null, process:Bool = true, warnIfNotFound:Bool = true) { var destinations = []; - var paths = PathHelper.findTemplateRecursive (project.templatePaths, source, warnIfNotFound, destinations); + var paths = System.findTemplateRecursive (project.templatePaths, source, warnIfNotFound, destinations); if (paths != null) { - PathHelper.mkdir (destination); + System.mkdir (destination); var itemDestination; for (i in 0...paths.length) { - itemDestination = PathHelper.combine (destination, ProjectHelper.substitutePath (project, destinations[i])); - FileHelper.copyFile (paths[i], itemDestination, context, process); + itemDestination = Path.combine (destination, ProjectHelper.substitutePath (project, destinations[i])); + System.copyFile (paths[i], itemDestination, context, process); } @@ -116,8 +116,8 @@ class ProjectHelper { if (string.substr (0, 8) == "haxelib:") { - var path = HaxelibHelper.getPath (new Haxelib (string.substr (8)), true); - return PathHelper.standardize (path); + var path = Haxelib.getPath (new Haxelib (string.substr (8)), true); + return Path.standardize (path); } else if (project.defines.exists (string)) { diff --git a/src/lime/tools/ProjectXMLParser.hx b/src/lime/tools/ProjectXMLParser.hx index ba95eee93..92665d2da 100644 --- a/src/lime/tools/ProjectXMLParser.hx +++ b/src/lime/tools/ProjectXMLParser.hx @@ -1,7 +1,7 @@ package lime.tools; -import haxe.io.Path; +import hxp.Path; import haxe.xml.Fast; import hxp.*; import lime.tools.CommandHelper; @@ -33,7 +33,7 @@ class ProjectXMLParser extends Project { if (defines != null) { - this.defines = StringMapHelper.copy (defines); + this.defines = MapTools.copy (defines); } @@ -136,7 +136,7 @@ class ProjectXMLParser extends Project { defines.set ("uwp", "1"); defines.set ("winjs", "1"); - } else if (platformType == DESKTOP && target != cast PlatformHelper.hostPlatform) { + } else if (platformType == DESKTOP && target != cast System.hostPlatform) { defines.set ("native", "1"); @@ -198,7 +198,7 @@ class ProjectXMLParser extends Project { defines.set ("target", Std.string (target).toLowerCase ()); defines.set ("platform", defines.get ("target")); - switch (PlatformHelper.hostPlatform) { + switch (System.hostPlatform) { case WINDOWS: defines.set ("host", "windows"); case MAC: defines.set ("host", "mac"); @@ -452,7 +452,7 @@ class ProjectXMLParser extends Project { case "path": - app.path = PathHelper.combine (extensionPath, substitute (element.att.path)); + app.path = Path.combine (extensionPath, substitute (element.att.path)); case "min-swf-version": @@ -513,7 +513,7 @@ class ProjectXMLParser extends Project { if (element.has.path) { - path = PathHelper.combine (basePath, substitute (element.att.path)); + path = Path.combine (basePath, substitute (element.att.path)); } @@ -842,7 +842,7 @@ class ProjectXMLParser extends Project { } var processedLibrary = false; - var jsonPath = PathHelper.combine (path, "library.json"); + var jsonPath = Path.combine (path, "library.json"); if (FileSystem.exists (jsonPath)) { @@ -856,7 +856,7 @@ class ProjectXMLParser extends Project { library = targetPath; manifest.rootPath = targetPath; - var asset = new Asset ("", PathHelper.combine (targetPath, "library.json"), AssetType.MANIFEST); + var asset = new Asset ("", Path.combine (targetPath, "library.json"), AssetType.MANIFEST); asset.id = "libraries/" + library + ".json"; asset.library = library; asset.data = manifest.serialize (); @@ -867,7 +867,7 @@ class ProjectXMLParser extends Project { if (Reflect.hasField (manifestAsset, "path")) { - var asset = new Asset (PathHelper.combine (path, manifestAsset.path), PathHelper.combine (targetPath, manifestAsset.path), type, embed); + var asset = new Asset (Path.combine (path, manifestAsset.path), Path.combine (targetPath, manifestAsset.path), type, embed); asset.id = manifestAsset.id; asset.library = library; asset.embed = embed; @@ -1026,7 +1026,7 @@ class ProjectXMLParser extends Project { if (element.has.resolve (sourceAttribute)) { - var source = PathHelper.combine (basePath, substitute (element.att.resolve (sourceAttribute))); + var source = Path.combine (basePath, substitute (element.att.resolve (sourceAttribute))); var packageName = ""; if (element.has.resolve ("package")) { @@ -1112,7 +1112,7 @@ class ProjectXMLParser extends Project { if (element.has.path) { - app.path = PathHelper.combine (extensionPath, substitute (element.att.path)); + app.path = Path.combine (extensionPath, substitute (element.att.path)); } @@ -1264,7 +1264,7 @@ class ProjectXMLParser extends Project { if (element.has.haxelib) { haxelib = new Haxelib (substitute (element.att.haxelib)); - path = findIncludeFile (HaxelibHelper.getPath (haxelib, true)); + path = findIncludeFile (Haxelib.getPath (haxelib, true)); addSourcePath = false; } else if (element.has.path) { @@ -1272,11 +1272,11 @@ class ProjectXMLParser extends Project { var subPath = substitute (element.att.path); if (subPath == "") subPath = element.att.path; - path = findIncludeFile (PathHelper.combine (extensionPath, subPath)); + path = findIncludeFile (Path.combine (extensionPath, subPath)); } else { - path = findIncludeFile (PathHelper.combine (extensionPath, substitute (element.att.name))); + path = findIncludeFile (Path.combine (extensionPath, substitute (element.att.name))); } @@ -1352,7 +1352,7 @@ class ProjectXMLParser extends Project { case "java": - javaPaths.push (PathHelper.combine (extensionPath, substitute (element.att.path))); + javaPaths.push (Path.combine (extensionPath, substitute (element.att.path))); case "language": @@ -1362,7 +1362,7 @@ class ProjectXMLParser extends Project { if (element.has.repository) { - setenv ("HAXELIB_PATH", PathHelper.combine (Sys.getCwd (), element.att.repository)); + setenv ("HAXELIB_PATH", Path.combine (Sys.getCwd (), element.att.repository)); if (needRerun) return; continue; @@ -1387,7 +1387,7 @@ class ProjectXMLParser extends Project { if (element.has.path) { - path = PathHelper.combine (extensionPath, substitute (element.att.path)); + path = Path.combine (extensionPath, substitute (element.att.path)); } @@ -1404,11 +1404,11 @@ class ProjectXMLParser extends Project { if (defines.exists ("setup")) { - path = HaxelibHelper.getPath (haxelib); + path = Haxelib.getPath (haxelib); } else { - path = HaxelibHelper.getPath (haxelib, !optional); + path = Haxelib.getPath (haxelib, !optional); if (optional && path == "") { @@ -1420,15 +1420,15 @@ class ProjectXMLParser extends Project { } else { - path = PathHelper.tryFullPath (PathHelper.combine (extensionPath, path)); + path = Path.tryFullPath (Path.combine (extensionPath, path)); if (version != "") { - HaxelibHelper.pathOverrides.set (name + ":" + version, path); + Haxelib.pathOverrides.set (name + ":" + version, path); } else { - HaxelibHelper.pathOverrides.set (name, path); + Haxelib.pathOverrides.set (name, path); } @@ -1436,7 +1436,7 @@ class ProjectXMLParser extends Project { if (!defines.exists (haxelib.name)) { - defines.set (haxelib.name, Std.string (HaxelibHelper.getVersion (haxelib))); + defines.set (haxelib.name, Std.string (Haxelib.getVersion (haxelib))); } @@ -1464,7 +1464,7 @@ class ProjectXMLParser extends Project { var name = substitute (element.att.name); var haxelib = null; - var type = NDLLType.AUTO; + var staticLink:Null = null; var registerStatics = true; var subdirectory = null; @@ -1488,7 +1488,9 @@ class ProjectXMLParser extends Project { if (element.has.type) { - type = Reflect.field (NDLLType, substitute (element.att.type).toUpperCase ()); + var typeString = substitute (element.att.type).toLowerCase (); + if (typeString == "static") staticLink = true; + if (typeString == "dynamic") staticLink = false; } @@ -1498,7 +1500,7 @@ class ProjectXMLParser extends Project { } - var ndll = new NDLL (name, haxelib, type, registerStatics); + var ndll = new NDLL (name, haxelib, staticLink, registerStatics); ndll.extensionPath = extensionPath; ndll.subdirectory = subdirectory; @@ -1512,7 +1514,7 @@ class ProjectXMLParser extends Project { if (Reflect.hasField (Architecture, name.toUpperCase ())) { - ArrayHelper.addUnique (architectures, Reflect.field (Architecture, name.toUpperCase ())); + ArrayTools.addUnique (architectures, Reflect.field (Architecture, name.toUpperCase ())); } @@ -1536,11 +1538,11 @@ class ProjectXMLParser extends Project { if (element.has.path) { - path = PathHelper.combine (extensionPath, substitute (element.att.path)); + path = Path.combine (extensionPath, substitute (element.att.path)); } else { - path = PathHelper.combine (extensionPath, substitute (element.att.name)); + path = Path.combine (extensionPath, substitute (element.att.name)); } @@ -1566,11 +1568,11 @@ class ProjectXMLParser extends Project { if (element.has.path) { - path = PathHelper.combine (extensionPath, substitute (element.att.path)); + path = Path.combine (extensionPath, substitute (element.att.path)); } else { - path = PathHelper.combine (extensionPath, substitute (element.att.name)); + path = Path.combine (extensionPath, substitute (element.att.name)); } @@ -1602,11 +1604,11 @@ class ProjectXMLParser extends Project { if (element.has.path) { - path = PathHelper.combine (extensionPath, substitute (element.att.path)); + path = Path.combine (extensionPath, substitute (element.att.path)); } else { - path = PathHelper.combine (extensionPath, substitute (element.att.name)); + path = Path.combine (extensionPath, substitute (element.att.name)); } @@ -1679,7 +1681,7 @@ class ProjectXMLParser extends Project { if (element.has.path) { - path = PathHelper.combine (extensionPath, substitute (element.att.path)); + path = Path.combine (extensionPath, substitute (element.att.path)); } @@ -1740,7 +1742,7 @@ class ProjectXMLParser extends Project { case "sample": - samplePaths.push (PathHelper.combine (extensionPath, substitute (element.att.path))); + samplePaths.push (Path.combine (extensionPath, substitute (element.att.path))); case "target": @@ -1756,7 +1758,7 @@ class ProjectXMLParser extends Project { if (element.has.name) { - targetHandlers.set (substitute (element.att.name), PathHelper.combine (extensionPath, substitute (element.att.path))); + targetHandlers.set (substitute (element.att.name), Path.combine (extensionPath, substitute (element.att.path))); } @@ -1768,13 +1770,13 @@ class ProjectXMLParser extends Project { if (element.has.haxelib) { - var haxelibPath = HaxelibHelper.getPath (new Haxelib (substitute (element.att.haxelib)), true); - var path = PathHelper.combine (haxelibPath, substitute (element.att.path)); + var haxelibPath = Haxelib.getPath (new Haxelib (substitute (element.att.haxelib)), true); + var path = Path.combine (haxelibPath, substitute (element.att.path)); templatePaths.push (path); } else { - var path = PathHelper.combine (extensionPath, substitute (element.att.path)); + var path = Path.combine (extensionPath, substitute (element.att.path)); if (FileSystem.exists (path) && !FileSystem.isDirectory (path)) { @@ -1796,7 +1798,7 @@ class ProjectXMLParser extends Project { case "templatePath": - templatePaths.push (PathHelper.combine (extensionPath, substitute (element.att.name))); + templatePaths.push (Path.combine (extensionPath, substitute (element.att.name))); case "preloader": @@ -1830,7 +1832,7 @@ class ProjectXMLParser extends Project { if (path != null) { - keystore = new Keystore (PathHelper.combine (extensionPath, substitute (element.att.path))); + keystore = new Keystore (Path.combine (extensionPath, substitute (element.att.path))); if (element.has.type) { @@ -1883,7 +1885,7 @@ class ProjectXMLParser extends Project { if (element.has.path) { - path = PathHelper.combine (extensionPath, substitute (element.att.path)); + path = Path.combine (extensionPath, substitute (element.att.path)); } @@ -1893,7 +1895,7 @@ class ProjectXMLParser extends Project { if (StringTools.endsWith (foundName, ".a") || StringTools.endsWith (foundName, ".dll")) { - path = PathHelper.combine (extensionPath, foundName); + path = Path.combine (extensionPath, foundName); } else { @@ -2025,17 +2027,17 @@ class ProjectXMLParser extends Project { case "fat": - ArrayHelper.addUnique (architectures, Architecture.ARMV6); - ArrayHelper.addUnique (architectures, Architecture.ARMV7); + ArrayTools.addUnique (architectures, Architecture.ARMV6); + ArrayTools.addUnique (architectures, Architecture.ARMV7); case "armv6": - ArrayHelper.addUnique (architectures, Architecture.ARMV6); + ArrayTools.addUnique (architectures, Architecture.ARMV6); architectures.remove (Architecture.ARMV7); case "armv7": - ArrayHelper.addUnique (architectures, Architecture.ARMV7); + ArrayTools.addUnique (architectures, Architecture.ARMV7); architectures.remove (Architecture.ARMV6); } @@ -2090,7 +2092,7 @@ class ProjectXMLParser extends Project { case "arm64": - ArrayHelper.addUnique (architectures, Architecture.ARM64); + ArrayTools.addUnique (architectures, Architecture.ARM64); } @@ -2163,7 +2165,7 @@ class ProjectXMLParser extends Project { while (id >= windows.length) { - windows.push (ObjectHelper.copyFields (defaultWindow, {})); + windows.push (ObjectTools.copyFields (defaultWindow, {})); } diff --git a/src/lime/tools/TVOSHelper.hx b/src/lime/tools/TVOSHelper.hx index 6b79d138e..5af8512f3 100644 --- a/src/lime/tools/TVOSHelper.hx +++ b/src/lime/tools/TVOSHelper.hx @@ -1,9 +1,9 @@ package lime.tools; -import haxe.io.Path; -import hxp.PathHelper; -import hxp.ProcessHelper; +import hxp.Path; +import hxp.Path; +import hxp.System; import hxp.Haxelib; import hxp.*; import lime.tools.Project; @@ -32,7 +32,7 @@ class TVOSHelper { commands.push ("-scheme"); commands.push (project.app.file); commands.push ("-archivePath"); - commands.push (PathHelper.combine ("build", PathHelper.combine (configuration + "-" + platformName, project.app.file))); + commands.push (Path.combine ("build", Path.combine (configuration + "-" + platformName, project.app.file))); } @@ -42,7 +42,7 @@ class TVOSHelper { } - ProcessHelper.runCommand (workingDirectory, "xcodebuild", commands); + System.runCommand (workingDirectory, "xcodebuild", commands); } @@ -62,9 +62,9 @@ class TVOSHelper { archiveCommands.push ("-scheme"); archiveCommands.push (project.app.file); archiveCommands.push ("-archivePath"); - archiveCommands.push (PathHelper.combine ("build", PathHelper.combine (configuration + "-" + platformName, project.app.file))); + archiveCommands.push (Path.combine ("build", Path.combine (configuration + "-" + platformName, project.app.file))); - ProcessHelper.runCommand (workingDirectory, "xcodebuild", archiveCommands); + System.runCommand (workingDirectory, "xcodebuild", archiveCommands); // generate IPA from xcarchive var exportCommands = commands.concat ([]); @@ -76,13 +76,13 @@ class TVOSHelper { exportCommands.push ("-exportArchive"); exportCommands.push ("-archivePath"); - exportCommands.push (PathHelper.combine("build", PathHelper.combine (configuration + "-" + platformName, project.app.file + ".xcarchive"))); + exportCommands.push (Path.combine("build", Path.combine (configuration + "-" + platformName, project.app.file + ".xcarchive"))); exportCommands.push ("-exportOptionsPlist"); - exportCommands.push (PathHelper.combine (project.app.file, "exportOptions-" + exportMethod + ".plist")); + exportCommands.push (Path.combine (project.app.file, "exportOptions-" + exportMethod + ".plist")); exportCommands.push ("-exportPath"); - exportCommands.push (PathHelper.combine ("dist", exportMethod)); + exportCommands.push (Path.combine ("dist", exportMethod)); - ProcessHelper.runCommand (workingDirectory, "xcodebuild", exportCommands); + System.runCommand (workingDirectory, "xcodebuild", exportCommands); } @@ -204,7 +204,7 @@ class TVOSHelper { private static function getOSXVersion ():String { - var output = ProcessHelper.runProcess ("", "sw_vers", [ "-productVersion" ]); + var output = System.runProcess ("", "sw_vers", [ "-productVersion" ]); return StringTools.trim (output); } @@ -212,7 +212,7 @@ class TVOSHelper { public static function getProvisioningFile ():String { - var path = PathHelper.expand ("~/Library/MobileDevice/Provisioning Profiles"); + var path = Path.expand ("~/Library/MobileDevice/Provisioning Profiles"); var files = FileSystem.readDirectory (path); for (file in files) { @@ -261,7 +261,7 @@ class TVOSHelper { private static function getXcodeVersion ():String { - var output = ProcessHelper.runProcess ("", "xcodebuild", [ "-version" ]); + var output = System.runProcess ("", "xcodebuild", [ "-version" ]); var firstLine = output.split ("\n").shift (); return StringTools.trim (firstLine.substring ("Xcode".length, firstLine.length)); @@ -308,8 +308,8 @@ class TVOSHelper { } - var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); - var launcher = PathHelper.findTemplate (templatePaths, "bin/ios-sim"); + var templatePaths = [ Path.combine (Haxelib.getPath (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); + var launcher = System.findTemplate (templatePaths, "bin/ios-sim"); Sys.command ("chmod", [ "+x", launcher ]); // device config @@ -357,7 +357,7 @@ class TVOSHelper { // check if device is available // $ ios-sim showdevicetypes - var devicesOutput:String = ProcessHelper.runProcess ("", launcher, [ "showdevicetypes" ]); + var devicesOutput:String = System.runProcess ("", launcher, [ "showdevicetypes" ]); var deviceTypeList:Array = devicesOutput.split ("\n"); for (i in 0...deviceTypeList.length) { @@ -386,11 +386,11 @@ class TVOSHelper { // run command with --devicetypeid if exists if (deviceTypeID != null) { - ProcessHelper.runCommand ("", launcher, [ "launch", FileSystem.fullPath (applicationPath), /*"--sdk", project.environment.get ("IPHONE_VER"),*/ "--devicetypeid", deviceTypeID, "--timeout", "60" ]); + System.runCommand ("", launcher, [ "launch", FileSystem.fullPath (applicationPath), /*"--sdk", project.environment.get ("IPHONE_VER"),*/ "--devicetypeid", deviceTypeID, "--timeout", "60" ]); } else { - ProcessHelper.runCommand ("", launcher, [ "launch", FileSystem.fullPath (applicationPath), /*"--sdk", project.environment.get ("IPHONE_VER"), "--devicetypeid", deviceTypeID,*/ "--timeout", "60" ]); + System.runCommand ("", launcher, [ "launch", FileSystem.fullPath (applicationPath), /*"--sdk", project.environment.get ("IPHONE_VER"), "--devicetypeid", deviceTypeID,*/ "--timeout", "60" ]); } @@ -408,13 +408,13 @@ class TVOSHelper { } - var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); - var launcher = PathHelper.findTemplate (templatePaths, "bin/ios-deploy"); + var templatePaths = [ Path.combine (Haxelib.getPath (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); + var launcher = System.findTemplate (templatePaths, "bin/ios-deploy"); Sys.command ("chmod", [ "+x", launcher ]); var xcodeVersion = getXcodeVersion (); - ProcessHelper.runCommand ("", launcher, [ "install", "--noninteractive", "--debug", "--timeout", "5", "--bundle", FileSystem.fullPath (applicationPath) ]); + System.runCommand ("", launcher, [ "install", "--noninteractive", "--debug", "--timeout", "5", "--bundle", FileSystem.fullPath (applicationPath) ]); } @@ -446,7 +446,7 @@ class TVOSHelper { var applicationPath = "build/" + configuration + "-appletvos/" + project.app.file + ".app"; commands.push (applicationPath); - ProcessHelper.runCommand (workingDirectory, "codesign", commands, true, true); + System.runCommand (workingDirectory, "codesign", commands, true, true); } diff --git a/src/lime/tools/TizenHelper.hx b/src/lime/tools/TizenHelper.hx index 639e90151..903afed1f 100644 --- a/src/lime/tools/TizenHelper.hx +++ b/src/lime/tools/TizenHelper.hx @@ -4,9 +4,9 @@ package lime.tools; import haxe.crypto.Crc32; import haxe.io.Bytes; import haxe.io.Eof; -import hxp.PathHelper; -import hxp.PlatformHelper; -import hxp.ProcessHelper; +import hxp.Path; +import hxp.System; +import hxp.System; import hxp.Haxelib; import lime.tools.Project; import lime.tools.Platform; @@ -27,7 +27,7 @@ class TizenHelper { if (project.keystore != null) { - keystore = PathHelper.tryFullPath (project.keystore.path); + keystore = Path.tryFullPath (project.keystore.path); password = project.keystore.password; if (password == null) { @@ -41,8 +41,8 @@ class TizenHelper { if (keystore == null) { - var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); - keystore = PathHelper.findTemplate (templatePaths, "bin/debug.p12"); + var templatePaths = [ Path.combine (Haxelib.getPath (new Haxelib (#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat (project.templatePaths); + keystore = System.findTemplate (templatePaths, "bin/debug.p12"); password = "1234"; } @@ -61,11 +61,11 @@ class TizenHelper { packageName += ".tpk"; - if (FileSystem.exists (PathHelper.combine (workingDirectory, packageName))) { + if (FileSystem.exists (Path.combine (workingDirectory, packageName))) { try { - FileSystem.deleteFile ((PathHelper.combine (workingDirectory, packageName))); + FileSystem.deleteFile ((Path.combine (workingDirectory, packageName))); } catch (e:Dynamic) {} @@ -84,7 +84,7 @@ class TizenHelper { var bytes = Bytes.ofString (project.meta.packageName); var crc = Crc32.make (bytes); - cacheUUID = StringHelper.generateUUID (10, null, crc); + cacheUUID = StringTools.generateUUID (10, null, crc); } else { @@ -164,7 +164,7 @@ class TizenHelper { } else { - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { sdkDirectory = "C:\\Development\\Tizen\\tizen-sdk"; @@ -176,7 +176,7 @@ class TizenHelper { } - ProcessHelper.runCommand (workingDirectory, PathHelper.combine (sdkDirectory, "tools/ide/bin/" + command), args); + System.runCommand (workingDirectory, Path.combine (sdkDirectory, "tools/ide/bin/" + command), args); } @@ -203,7 +203,7 @@ class TizenHelper { } else { - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { sdkDirectory = "C:\\Development\\Tizen\\tizen-sdk"; @@ -219,8 +219,8 @@ class TizenHelper { //var args = [ "dlog", project.meta.packageName + ":V", "*:E" ]; var args = [ "dlog", project.app.file + ":V", "*:F" ]; - ProcessHelper.runCommand ("", PathHelper.combine (sdkDirectory, "tools/sdb"), [ "dlog", "-c" ]); - ProcessHelper.runCommand ("", PathHelper.combine (sdkDirectory, "tools/sdb"), args); + System.runCommand ("", Path.combine (sdkDirectory, "tools/sdb"), [ "dlog", "-c" ]); + System.runCommand ("", Path.combine (sdkDirectory, "tools/sdb"), args); //runCommand (project, "", "native-debug", [ "-p", project.meta.packageName ]); } diff --git a/src/lime/tools/XCodeHelper.hx b/src/lime/tools/XCodeHelper.hx index c72aaece1..f5e52637c 100644 --- a/src/lime/tools/XCodeHelper.hx +++ b/src/lime/tools/XCodeHelper.hx @@ -133,7 +133,7 @@ class XCodeHelper { private static function getSimulators ():String { - return ProcessHelper.runProcess ("", "xcrun", [ "simctl", "list", "devices" ]); + return System.runProcess ("", "xcrun", [ "simctl", "list", "devices" ]); } diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx index e203e9811..23c30fb33 100644 --- a/tools/CommandLineTools.hx +++ b/tools/CommandLineTools.hx @@ -6,7 +6,7 @@ package; //import openfl.utils.CompressionAlgorithm; import haxe.Serializer; import haxe.Unserializer; -import haxe.io.Path; +import hxp.Path; import haxe.rtti.Meta; import hxp.*; import lime.system.CFFI; @@ -62,10 +62,10 @@ class CommandLineTools { overrides = new Project (); overrides.architectures = []; - //HaxelibHelper.setOverridePath (new Haxelib ("lime-tools"), PathHelper.combine (HaxelibHelper.getPath (new Haxelib ("lime")), "tools")); + //Haxelib.setOverridePath (new Haxelib ("lime-tools"), Path.combine (Haxelib.getPath (new Haxelib ("lime")), "tools")); processArguments (); - version = HaxelibHelper.getVersion (); + version = Haxelib.getVersion (); if (targetFlags.exists ("openfl")) { @@ -157,7 +157,7 @@ class CommandLineTools { if (words.length == 1) { - var haxelibPath = HaxelibHelper.getPath (new Haxelib (words[0]), false); + var haxelibPath = Haxelib.getPath (new Haxelib (words[0]), false); if (haxelibPath != "" && haxelibPath != null) { @@ -190,12 +190,12 @@ class CommandLineTools { if (!FileSystem.exists (words[0])) { - var fullPath = PathHelper.tryFullPath (words[0]); + var fullPath = Path.tryFullPath (words[0]); if (FileSystem.exists (fullPath)) { - path = PathHelper.combine (fullPath, "project"); - hxmlPath = PathHelper.combine (fullPath, "rebuild.hxml"); + path = Path.combine (fullPath, "project"); + hxmlPath = Path.combine (fullPath, "rebuild.hxml"); } else { @@ -207,17 +207,17 @@ class CommandLineTools { if (FileSystem.isDirectory (words[0])) { - if (FileSystem.exists (PathHelper.combine (words[0], "Build.xml"))) { + if (FileSystem.exists (Path.combine (words[0], "Build.xml"))) { path = words[0]; } else { - path = PathHelper.combine (words[0], "project/Build.xml"); + path = Path.combine (words[0], "project/Build.xml"); } - hxmlPath = PathHelper.combine (words[0], "rebuild.hxml"); + hxmlPath = Path.combine (words[0], "rebuild.hxml"); } else { @@ -231,7 +231,7 @@ class CommandLineTools { } - var haxelibPath = HaxelibHelper.getPath (new Haxelib (words[0])); + var haxelibPath = Haxelib.getPath (new Haxelib (words[0])); if (!FileSystem.exists (path) && haxelibPath != null) { @@ -243,21 +243,21 @@ class CommandLineTools { if (haxelib != null) { - var haxelibPath = HaxelibHelper.getPath (haxelib, true); + var haxelibPath = Haxelib.getPath (haxelib, true); switch (haxelib.name) { case "hxcpp": - hxmlPath = PathHelper.combine (haxelibPath, "tools/hxcpp/compile.hxml"); + hxmlPath = Path.combine (haxelibPath, "tools/hxcpp/compile.hxml"); case "haxelib": - hxmlPath = PathHelper.combine (haxelibPath, "../client.hxml"); + hxmlPath = Path.combine (haxelibPath, "../client.hxml"); default: - hxmlPath = PathHelper.combine (haxelibPath, "rebuild.hxml"); + hxmlPath = Path.combine (haxelibPath, "rebuild.hxml"); } @@ -271,32 +271,32 @@ class CommandLineTools { case "cpp": - target = cast PlatformHelper.hostPlatform; + target = cast System.hostPlatform; targetFlags.set ("cpp", ""); case "neko": - target = cast PlatformHelper.hostPlatform; + target = cast System.hostPlatform; targetFlags.set ("neko", ""); case "hl": - target = cast PlatformHelper.hostPlatform; + target = cast System.hostPlatform; targetFlags.set ("hl", ""); case "java": - target = cast PlatformHelper.hostPlatform; + target = cast System.hostPlatform; targetFlags.set ("java", ""); case "nodejs": - target = cast PlatformHelper.hostPlatform; + target = cast System.hostPlatform; targetFlags.set ("nodejs", ""); case "cs": - target = cast PlatformHelper.hostPlatform; + target = cast System.hostPlatform; targetFlags.set ("cs", ""); case "iphone", "iphoneos": @@ -352,9 +352,9 @@ class CommandLineTools { if (hxmlPath != null && FileSystem.exists (hxmlPath)) { var cacheValue = Sys.getEnv ("HAXELIB_PATH"); - Sys.putEnv ("HAXELIB_PATH", HaxelibHelper.getRepositoryPath ()); + Sys.putEnv ("HAXELIB_PATH", Haxelib.getRepositoryPath ()); - ProcessHelper.runCommand (Path.directory (hxmlPath), "haxe", [ Path.withoutDirectory (hxmlPath) ]); + System.runCommand (Path.directory (hxmlPath), "haxe", [ Path.withoutDirectory (hxmlPath) ]); if (cacheValue != null) { @@ -383,11 +383,11 @@ class CommandLineTools { if (project == null) { project = new Project (); - project.config.set ("project.rebuild.path", PathHelper.combine (HaxelibHelper.getPath (haxelib), "project")); + project.config.set ("project.rebuild.path", Path.combine (Haxelib.getPath (haxelib), "project")); } else { - project.config.set ("project.rebuild.path", PathHelper.combine (HaxelibHelper.getPath (haxelib), project.config.get ("project.rebuild.path"))); + project.config.set ("project.rebuild.path", Path.combine (Haxelib.getPath (haxelib), project.config.get ("project.rebuild.path"))); } @@ -513,7 +513,7 @@ class CommandLineTools { if (FileSystem.exists ("tools.n")) { - path = PathHelper.combine (Sys.getCwd (), "../ndll/"); + path = Path.combine (Sys.getCwd (), "../ndll/"); } else if (FileSystem.exists ("run.n")) { @@ -546,7 +546,7 @@ class CommandLineTools { } - switch (PlatformHelper.hostPlatform) { + switch (System.hostPlatform) { case WINDOWS: @@ -554,7 +554,7 @@ class CommandLineTools { case MAC: - //if (PlatformHelper.hostArchitecture == X64) { + //if (System.hostArchitecture == X64) { untyped $loader.path = $array (path + "Mac64/", $loader.path); @@ -575,11 +575,11 @@ class CommandLineTools { } - if (raspberryPi || PlatformHelper.hostArchitecture == ARMV6 || PlatformHelper.hostArchitecture == ARMV7) { + if (raspberryPi || System.hostArchitecture == ARMV6 || System.hostArchitecture == ARMV7) { untyped $loader.path = $array (path + "RPi/", $loader.path); - } else if (PlatformHelper.hostArchitecture == X64) { + } else if (System.hostArchitecture == X64) { untyped $loader.path = $array (path + "Linux64/", $loader.path); @@ -617,10 +617,10 @@ class CommandLineTools { var handler = project.targetHandlers.get (Std.string (project.target)); var projectData = Serializer.run (project); - var temporaryFile = PathHelper.getTemporaryFile (); + var temporaryFile = System.getTemporaryFile (); File.saveContent (temporaryFile, projectData); - var targetDir = HaxelibHelper.getPath (new Haxelib (handler)); + var targetDir = Haxelib.getPath (new Haxelib (handler)); var exePath = Path.join ([targetDir, "run.exe"]); var exeExists = FileSystem.exists (exePath); @@ -639,11 +639,11 @@ class CommandLineTools { if (exeExists) { - ProcessHelper.runCommand ("", exePath, args); + System.runCommand ("", exePath, args); } else { - HaxelibHelper.runCommand ("", [ "run", handler ].concat (args)); + Haxelib.runCommand ("", [ "run", handler ].concat (args)); } @@ -803,7 +803,7 @@ class CommandLineTools { for (samplePath in project.samplePaths) { - if (FileSystem.exists (PathHelper.combine (samplePath, projectName))) { + if (FileSystem.exists (Path.combine (samplePath, projectName))) { sampleExists = true; @@ -815,7 +815,7 @@ class CommandLineTools { CreateTemplate.createSample (words, userDefines); - } else if (HaxelibHelper.getPath (new Haxelib (projectName)) != "") { + } else if (Haxelib.getPath (new Haxelib (projectName)) != "") { CreateTemplate.listSamples (projectName, userDefines); @@ -1181,7 +1181,7 @@ class CommandLineTools { // for (i in 0...80) out += "-"; // Log.println (out); - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { Log.println (""); @@ -1238,21 +1238,21 @@ class CommandLineTools { private function findProjectFile (path:String):String { - if (FileSystem.exists (PathHelper.combine (path, "project.hxp"))) { + if (FileSystem.exists (Path.combine (path, "project.hxp"))) { - return PathHelper.combine (path, "project.hxp"); + return Path.combine (path, "project.hxp"); - } else if (FileSystem.exists (PathHelper.combine (path, "project.lime"))) { + } else if (FileSystem.exists (Path.combine (path, "project.lime"))) { - return PathHelper.combine (path, "project.lime"); + return Path.combine (path, "project.lime"); - } else if (FileSystem.exists (PathHelper.combine (path, "project.xml"))) { + } else if (FileSystem.exists (Path.combine (path, "project.xml"))) { - return PathHelper.combine (path, "project.xml"); + return Path.combine (path, "project.xml"); - } else if (FileSystem.exists (PathHelper.combine (path, "project.nmml"))) { + } else if (FileSystem.exists (Path.combine (path, "project.nmml"))) { - return PathHelper.combine (path, "project.nmml"); + return Path.combine (path, "project.nmml"); } else { @@ -1265,7 +1265,7 @@ class CommandLineTools { for (file in files) { - var path = PathHelper.combine (path, file); + var path = Path.combine (path, file); if (FileSystem.exists (path) && !FileSystem.isDirectory (path)) { @@ -1319,7 +1319,7 @@ class CommandLineTools { var sourcePath = words[0]; var glyphs = "32-255"; - 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 ]); + System.runCommand (Path.directory (sourcePath), "neko", [ Haxelib.getPath (new Haxelib ("lime")) + "/templates/bin/hxswfml.n", "ttf2hash2", Path.withoutDirectory (sourcePath), Path.withoutDirectory (sourcePath) + ".hash", "-glyphs", glyphs ]); } else if (targetFlags.exists ("font-details")) { @@ -1360,7 +1360,7 @@ class CommandLineTools { if (buildNumber == null) { - var versionFile = PathHelper.combine (project.app.path, ".build"); + var versionFile = Path.combine (project.app.path, ".build"); var version = 1; try { @@ -1391,7 +1391,7 @@ class CommandLineTools { try { - PathHelper.mkdir (project.app.path); + System.mkdir (project.app.path); var output = File.write (versionFile, false); output.writeString (Std.string (version)); @@ -1411,7 +1411,7 @@ class CommandLineTools { var cache = Log.mute; Log.mute = true; - var output = ProcessHelper.runProcess ("", "git", [ "rev-list", "HEAD", "--count" ], true, true, true); + var output = System.runProcess ("", "git", [ "rev-list", "HEAD", "--count" ], true, true, true); Log.mute = cache; @@ -1451,7 +1451,7 @@ class CommandLineTools { var cache = Log.mute; Log.mute = true; - var output = ProcessHelper.runProcess ("", "svn", [ "info" ], true, true, true); + var output = System.runProcess ("", "svn", [ "info" ], true, true, true); Log.mute = cache; @@ -1499,7 +1499,7 @@ class CommandLineTools { if (targetFlags.exists ("openfl")) { - return HaxelibHelper.getVersion (new Haxelib ("openfl")) + "-L" + StringHelper.generateUUID (5, null, StringHelper.generateHashCode (version)); + return Haxelib.getVersion (new Haxelib ("openfl")) + "-L" + StringTools.generateUUID (5, null, StringTools.generateHashCode (version)); } else { @@ -1571,19 +1571,19 @@ class CommandLineTools { var forceGlobal = (overrides.haxeflags.indexOf ("--global") > -1); var projectDirectory = Path.directory (projectFile); - var localRepository = PathHelper.combine (projectDirectory, ".haxelib"); + var localRepository = Path.combine (projectDirectory, ".haxelib"); if (!forceGlobal && FileSystem.exists (localRepository) && FileSystem.isDirectory (localRepository)) { - var overrideExists = HaxelibHelper.pathOverrides.exists ("lime"); - var cacheOverride = HaxelibHelper.pathOverrides.get ("lime"); - HaxelibHelper.pathOverrides.remove ("lime"); + var overrideExists = Haxelib.pathOverrides.exists ("lime"); + var cacheOverride = Haxelib.pathOverrides.get ("lime"); + Haxelib.pathOverrides.remove ("lime"); var workingDirectory = Sys.getCwd (); Sys.setCwd (projectDirectory); - var limePath = HaxelibHelper.getPath (new Haxelib ("lime"), true, true); - var toolsPath = HaxelibHelper.getPath (new Haxelib ("lime-tools")); + var limePath = Haxelib.getPath (new Haxelib ("lime"), true, true); + var toolsPath = Haxelib.getPath (new Haxelib ("lime-tools")); Sys.setCwd (workingDirectory); @@ -1596,7 +1596,7 @@ class CommandLineTools { Sys.setCwd (limePath); - args = [ PathHelper.combine (limePath, "run.n") ].concat (args); + args = [ Path.combine (limePath, "run.n") ].concat (args); args.push ("--haxelib-lime=" + limePath); args.push ("-nolocalrepocheck"); args.push (workingDirectory); @@ -1608,7 +1608,7 @@ class CommandLineTools { if (overrideExists) { - HaxelibHelper.pathOverrides.set ("lime", cacheOverride); + Haxelib.pathOverrides.set ("lime", cacheOverride); } @@ -1652,32 +1652,32 @@ class CommandLineTools { case "cpp": - target = cast PlatformHelper.hostPlatform; + target = cast System.hostPlatform; targetFlags.set ("cpp", ""); case "neko": - target = cast PlatformHelper.hostPlatform; + target = cast System.hostPlatform; targetFlags.set ("neko", ""); case "hl": - target = cast PlatformHelper.hostPlatform; + target = cast System.hostPlatform; targetFlags.set ("hl", ""); case "java": - target = cast PlatformHelper.hostPlatform; + target = cast System.hostPlatform; targetFlags.set ("java", ""); case "nodejs": - target = cast PlatformHelper.hostPlatform; + target = cast System.hostPlatform; targetFlags.set ("nodejs", ""); case "cs": - target = cast PlatformHelper.hostPlatform; + target = cast System.hostPlatform; targetFlags.set ("cs", ""); case "iphone", "iphoneos": @@ -1784,14 +1784,14 @@ class CommandLineTools { } - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { if (environment.get ("JAVA_HOME") != null) { - var javaPath = PathHelper.combine (environment.get ("JAVA_HOME"), "bin"); + var javaPath = Path.combine (environment.get ("JAVA_HOME"), "bin"); var value; - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { value = javaPath + ";" + Sys.getEnv ("PATH"); @@ -1830,7 +1830,7 @@ class CommandLineTools { if (!environment.exists ("HAXE_STD_PATH")) { - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { environment.set ("HAXE_STD_PATH", "C:\\HaxeToolkit\\haxe\\std\\"); @@ -1893,9 +1893,9 @@ class CommandLineTools { if (project != null && project.needRerun && !project.targetFlags.exists ("norerun")) { - HaxelibHelper.pathOverrides.remove ("lime"); + Haxelib.pathOverrides.remove ("lime"); var workingDirectory = Sys.getCwd (); - var limePath = HaxelibHelper.getPath (new Haxelib ("lime"), true, true); + var limePath = Haxelib.getPath (new Haxelib ("lime"), true, true); Sys.setCwd (workingDirectory); Log.info ("", Log.accentColor + "Requesting alternate tools from custom haxelib path...\x1b[0m\n\n"); @@ -1905,7 +1905,7 @@ class CommandLineTools { Sys.setCwd (limePath); - args = [ PathHelper.combine (limePath, "run.n") ].concat (args); + args = [ Path.combine (limePath, "run.n") ].concat (args); args.push ("--haxelib-lime=" + limePath); args.push ("-norerun"); args.push (workingDirectory); @@ -1956,7 +1956,7 @@ class CommandLineTools { if (haxelib.name == "openfl") { - HaxelibHelper.setOverridePath (haxelib, HaxelibHelper.getPath (haxelib)); + Haxelib.setOverridePath (haxelib, Haxelib.getPath (haxelib)); } @@ -1966,22 +1966,22 @@ class CommandLineTools { Log.info ("", Log.accentColor + "Requesting tools version " + getToolsVersion (haxelib.version) + "...\x1b[0m\n\n"); - HaxelibHelper.pathOverrides.remove ("lime"); - var path = HaxelibHelper.getPath (haxelib); + Haxelib.pathOverrides.remove ("lime"); + var path = Haxelib.getPath (haxelib); var args = Sys.args (); var workingDirectory = args.pop (); for (haxelib in project.haxelibs) { - args.push ("--haxelib-" + haxelib.name + "=" + HaxelibHelper.getPath (haxelib)); + args.push ("--haxelib-" + haxelib.name + "=" + Haxelib.getPath (haxelib)); } args.push ("-notoolscheck"); Sys.setCwd (path); - var args = [ PathHelper.combine (path, "run.n") ].concat (args); + var args = [ Path.combine (path, "run.n") ].concat (args); args.push (workingDirectory); Sys.exit (Sys.command ("neko", args)); @@ -1992,7 +1992,7 @@ class CommandLineTools { } else { - if (Std.string (version) != Std.string (HaxelibHelper.getVersion (haxelib))) { + if (Std.string (version) != Std.string (Haxelib.getVersion (haxelib))) { Log.warn ("", Log.accentColor + "Could not switch to requested tools version\x1b[0m"); @@ -2071,7 +2071,7 @@ class CommandLineTools { } - StringMapHelper.copyKeys (userDefines, project.haxedefs); + MapTools.copyKeysDynamic (userDefines, project.haxedefs); getBuildNumber (project, (project.command == "build" || project.command == "test")); @@ -2131,7 +2131,7 @@ class CommandLineTools { lastArgument = new Path (lastArgument).toString (); var isRootDirectory = false; - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { isRootDirectory = (lastArgument.length == 3 && lastArgument.charAt (1) == ":" && (lastArgument.charAt (2) == "/" || lastArgument.charAt (2) == "\\")); @@ -2143,7 +2143,7 @@ class CommandLineTools { if (FileSystem.exists (lastArgument) && FileSystem.isDirectory (lastArgument)) { - HaxelibHelper.setOverridePath (new Haxelib ("lime-tools"), PathHelper.combine (Sys.getCwd (), "tools")); + Haxelib.setOverridePath (new Haxelib ("lime-tools"), Path.combine (Sys.getCwd (), "tools")); Sys.setCwd (lastArgument); runFromHaxelib = true; @@ -2154,7 +2154,7 @@ class CommandLineTools { } - HaxelibHelper.workingDirectory = Sys.getCwd (); + Haxelib.workingDirectory = Sys.getCwd (); } @@ -2164,7 +2164,7 @@ class CommandLineTools { if (FileSystem.exists ("tools.n")) { - path = PathHelper.combine (Sys.getCwd (), "../"); + path = Path.combine (Sys.getCwd (), "../"); } else if (FileSystem.exists ("run.n")) { @@ -2176,8 +2176,8 @@ class CommandLineTools { } - HaxelibHelper.setOverridePath (new Haxelib ("lime"), path); - HaxelibHelper.setOverridePath (new Haxelib ("lime-tools"), PathHelper.combine (path, "tools")); + Haxelib.setOverridePath (new Haxelib ("lime"), path); + Haxelib.setOverridePath (new Haxelib ("lime-tools"), Path.combine (path, "tools")); } @@ -2259,7 +2259,7 @@ class CommandLineTools { } else if (StringTools.startsWith (field, "haxelib-")) { var name = field.substr (8); - HaxelibHelper.setOverridePath (new Haxelib (name), PathHelper.tryFullPath (argValue)); + Haxelib.setOverridePath (new Haxelib (name), Path.tryFullPath (argValue)); } else if (field == "source") { @@ -2382,7 +2382,7 @@ class CommandLineTools { } else if (argument == "-haxelib-debug") { - HaxelibHelper.debug = true; + Haxelib.debug = true; } else if (argument == "--help" || argument == "-help" || argument == "-h") { @@ -2441,7 +2441,7 @@ class CommandLineTools { } else if (argument == "-dryrun") { - ProcessHelper.dryRun = true; + System.dryRun = true; } else if (argument == "-notrace") { @@ -2521,7 +2521,7 @@ class CommandLineTools { } var haxelib = new Haxelib (name); - var path = HaxelibHelper.getPath (haxelib); + var path = Haxelib.getPath (haxelib); switch (command) { @@ -2543,7 +2543,7 @@ class CommandLineTools { if (path != null && path != "") { - HaxelibHelper.runCommand ("", [ "remove", name ]); + Haxelib.runCommand ("", [ "remove", name ]); } diff --git a/tools/RunScript.hx b/tools/RunScript.hx index 4eaa3ebe3..d3d63bcd4 100644 --- a/tools/RunScript.hx +++ b/tools/RunScript.hx @@ -1,7 +1,7 @@ package; -import haxe.io.Path; +import hxp.Path; import hxp.helpers.FileHelper; import hxp.helpers.HaxelibHelper; import hxp.helpers.Log; @@ -19,28 +19,28 @@ class RunScript { private static function rebuildTools (rebuildBinaries = true):Void { - var limeDirectory = HaxelibHelper.getPath (new Haxelib ("lime"), true); - var toolsDirectory = PathHelper.combine (limeDirectory, "tools"); + var limeDirectory = Haxelib.getPath (new Haxelib ("lime"), true); + var toolsDirectory = Path.combine (limeDirectory, "tools"); if (!FileSystem.exists (toolsDirectory)) { - toolsDirectory = PathHelper.combine (limeDirectory, "../tools"); + toolsDirectory = Path.combine (limeDirectory, "../tools"); } - /*var extendedToolsDirectory = HaxelibHelper.getPath (new Haxelib ("lime-extended"), false); + /*var extendedToolsDirectory = Haxelib.getPath (new Haxelib ("lime-extended"), false); if (extendedToolsDirectory != null && extendedToolsDirectory != "") { - var buildScript = File.getContent (PathHelper.combine (extendedToolsDirectory, "tools.hxml")); + var buildScript = File.getContent (Path.combine (extendedToolsDirectory, "tools.hxml")); buildScript = StringTools.replace (buildScript, "\r\n", "\n"); buildScript = StringTools.replace (buildScript, "\n", " "); - ProcessHelper.runCommand (toolsDirectory, "haxe", buildScript.split (" ")); + System.runCommand (toolsDirectory, "haxe", buildScript.split (" ")); } else {*/ - ProcessHelper.runCommand (toolsDirectory, "haxe", [ "tools.hxml" ]); + System.runCommand (toolsDirectory, "haxe", [ "tools.hxml" ]); //} @@ -50,8 +50,8 @@ class RunScript { for (platform in platforms) { - var source = PathHelper.combine (limeDirectory, "ndll/" + platform + "/lime.ndll"); - //var target = PathHelper.combine (toolsDirectory, "ndll/" + platform + "/lime.ndll"); + var source = Path.combine (limeDirectory, "ndll/" + platform + "/lime.ndll"); + //var target = Path.combine (toolsDirectory, "ndll/" + platform + "/lime.ndll"); if (!FileSystem.exists (source)) { @@ -73,33 +73,33 @@ class RunScript { case "Windows": - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { - ProcessHelper.runCommand (limeDirectory, "neko", args.concat ([ "windows", toolsDirectory ])); + System.runCommand (limeDirectory, "neko", args.concat ([ "windows", toolsDirectory ])); } case "Mac", "Mac64": - if (PlatformHelper.hostPlatform == MAC) { + if (System.hostPlatform == MAC) { - ProcessHelper.runCommand (limeDirectory, "neko", args.concat ([ "mac", toolsDirectory ])); + System.runCommand (limeDirectory, "neko", args.concat ([ "mac", toolsDirectory ])); } case "Linux": - if (PlatformHelper.hostPlatform == LINUX && PlatformHelper.hostArchitecture != X64) { + if (System.hostPlatform == LINUX && System.hostArchitecture != X64) { - ProcessHelper.runCommand (limeDirectory, "neko", args.concat ([ "linux", "-32", toolsDirectory ])); + System.runCommand (limeDirectory, "neko", args.concat ([ "linux", "-32", toolsDirectory ])); } case "Linux64": - if (PlatformHelper.hostPlatform == LINUX && PlatformHelper.hostArchitecture == X64) { + if (System.hostPlatform == LINUX && System.hostArchitecture == X64) { - ProcessHelper.runCommand (limeDirectory, "neko", args.concat ([ "linux", "-64", toolsDirectory ])); + System.runCommand (limeDirectory, "neko", args.concat ([ "linux", "-64", toolsDirectory ])); } @@ -117,7 +117,7 @@ class RunScript { } else { - //FileHelper.copyIfNewer (source, target); + //System.copyIfNewer (source, target); } @@ -186,7 +186,7 @@ class RunScript { } - HaxelibHelper.workingDirectory = Sys.getCwd (); + Haxelib.workingDirectory = Sys.getCwd (); var rebuildBinaries = true; for (arg in args) { @@ -201,7 +201,7 @@ class RunScript { if (StringTools.startsWith (field, "haxelib-")) { var name = field.substr (8); - HaxelibHelper.pathOverrides.set (name, PathHelper.tryFullPath (argValue)); + Haxelib.pathOverrides.set (name, Path.tryFullPath (argValue)); } diff --git a/tools/SVGExport.hx b/tools/SVGExport.hx index 7dc05fd00..8a509ae4d 100644 --- a/tools/SVGExport.hx +++ b/tools/SVGExport.hx @@ -2,7 +2,7 @@ package; import format.SVG; -import haxe.io.Path; +import hxp.Path; import hxp.helpers.Log; import hxp.helpers.PathHelper; import hxp.helpers.PlatformHelper; @@ -30,7 +30,7 @@ class SVGExport { if (FileSystem.exists ("svg.n")) { - path = PathHelper.combine (Sys.getCwd (), "../ndll/"); + path = Path.combine (Sys.getCwd (), "../ndll/"); } @@ -59,7 +59,7 @@ class SVGExport { } - switch (PlatformHelper.hostPlatform) { + switch (System.hostPlatform) { case WINDOWS: @@ -85,7 +85,7 @@ class SVGExport { untyped $loader.path = $array (path + "RPi/", $loader.path); - } else if (PlatformHelper.hostArchitecture == X64) { + } else if (System.hostArchitecture == X64) { untyped $loader.path = $array (path + "Linux64/", $loader.path); diff --git a/tools/platforms/AIRPlatform.hx b/tools/platforms/AIRPlatform.hx index 0c26cc3ef..2590e9910 100644 --- a/tools/platforms/AIRPlatform.hx +++ b/tools/platforms/AIRPlatform.hx @@ -1,24 +1,24 @@ package; -import haxe.io.Path; +import hxp.Path; import haxe.Template; import lime.tools.AIRHelper; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.DeploymentHelper; -import hxp.FileHelper; +import hxp.System; import lime.tools.FlashHelper; import lime.tools.Icon; import lime.tools.IconHelper; import hxp.Log; -import hxp.PathHelper; +import hxp.Path; import lime.tools.Platform; -import hxp.PlatformHelper; +import hxp.System; import lime.tools.PlatformType; import lime.tools.Project; import lime.tools.ProjectHelper; -import hxp.ZipHelper; +import hxp.System; import sys.io.File; import sys.FileSystem; @@ -36,7 +36,7 @@ class AIRPlatform extends FlashPlatform { super (command, _project, targetFlags); - targetDirectory = PathHelper.combine (project.app.path, project.config.getString ("air.output-directory", "air")); + targetDirectory = Path.combine (project.app.path, project.config.getString ("air.output-directory", "air")); if (targetFlags.exists ("android")) { @@ -60,7 +60,7 @@ class AIRPlatform extends FlashPlatform { } else { - targetPlatform = cast PlatformHelper.hostPlatform; + targetPlatform = cast System.hostPlatform; targetPlatformType = DESKTOP; } @@ -124,7 +124,7 @@ class AIRPlatform extends FlashPlatform { if (FileSystem.exists (targetDirectory)) { - PathHelper.removeDirectory (targetDirectory); + System.removeDirectory (targetDirectory); } @@ -140,7 +140,7 @@ class AIRPlatform extends FlashPlatform { } else { var rootDirectory = targetDirectory + "/bin"; - var paths = PathHelper.readDirectory (rootDirectory, [ project.app.file + ".apk", project.app.file + ".ipa", project.app.file + ".air" ]); + var paths = System.readDirectory (rootDirectory, [ project.app.file + ".apk", project.app.file + ".ipa", project.app.file + ".air" ]); var files = []; for (path in paths) { @@ -175,13 +175,13 @@ class AIRPlatform extends FlashPlatform { var outputPath = "dist/" + name; - PathHelper.mkdir (targetDirectory + "/dist"); + System.mkdir (targetDirectory + "/dist"); outputPath = AIRHelper.build (project, targetDirectory, targetPlatform, outputPath, "application.xml", files, "bin"); if (targetPlatformType == DESKTOP) { - ZipHelper.compress (PathHelper.combine (targetDirectory, outputPath), PathHelper.combine (targetDirectory, "dist/" + name + ".zip")); + System.compress (Path.combine (targetDirectory, outputPath), Path.combine (targetDirectory, "dist/" + name + ".zip")); } @@ -192,7 +192,7 @@ class AIRPlatform extends FlashPlatform { private override function getDisplayHXML ():String { - var hxml = PathHelper.findTemplate (project.templatePaths, "flash/hxml/" + buildType + ".hxml"); + var hxml = System.findTemplate (project.templatePaths, "flash/hxml/" + buildType + ".hxml"); var context = project.templateContext; context.WIN_FLASHBACKGROUND = StringTools.hex (project.window.background, 6); @@ -248,7 +248,7 @@ class AIRPlatform extends FlashPlatform { AssetHelper.processLibraries (project, targetDirectory); var destination = targetDirectory + "/bin/"; - PathHelper.mkdir (destination); + System.mkdir (destination); // project = project.clone (); @@ -308,7 +308,7 @@ class AIRPlatform extends FlashPlatform { if (icons.length == 0) { - icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ]; + icons = [ new Icon (System.findTemplate (project.templatePaths, "default/icon.svg")) ]; } @@ -380,9 +380,9 @@ class AIRPlatform extends FlashPlatform { if (asset.type == AssetType.TEMPLATE || asset.embed == false /*|| !usesLime*/) { - var path = PathHelper.combine (destination, asset.targetPath); + var path = Path.combine (destination, asset.targetPath); - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path, context); } @@ -396,7 +396,7 @@ class AIRPlatform extends FlashPlatform { for (splashScreen in project.splashScreens) { var path = Path.withoutDirectory (splashScreen.path); - FileHelper.copyFile (splashScreen.path, PathHelper.combine (destination, path), context); + System.copyFile (splashScreen.path, Path.combine (destination, path), context); splashScreenData.push ({ path: path }); } diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx index 2c8fdfeae..126a1f44a 100644 --- a/tools/platforms/AndroidPlatform.hx +++ b/tools/platforms/AndroidPlatform.hx @@ -1,26 +1,26 @@ package; -import haxe.io.Path; +import hxp.Path; import haxe.Template; import lime.tools.AndroidHelper; import lime.tools.Architecture; -import hxp.ArrayHelper; +import hxp.ArrayTools; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.DeploymentHelper; -import hxp.FileHelper; +import hxp.System; import hxp.Haxelib; import lime.tools.Icon; import lime.tools.IconHelper; import hxp.Log; -import hxp.PathHelper; +import hxp.Path; import lime.tools.PlatformTarget; -import hxp.ProcessHelper; +import hxp.System; import lime.tools.Project; import lime.tools.ProjectHelper; -import hxp.WatchHelper; +import hxp.System; import sys.io.File; import sys.FileSystem; @@ -55,7 +55,7 @@ class AndroidPlatform extends PlatformTarget { } - targetDirectory = PathHelper.combine (project.app.path, project.config.getString ("android.output-directory", "android")); + targetDirectory = Path.combine (project.app.path, project.config.getString ("android.output-directory", "android")); } @@ -66,10 +66,10 @@ class AndroidPlatform extends PlatformTarget { var hxml = targetDirectory + "/haxe/" + buildType + ".hxml"; var sourceSet = destination + "/app/src/main"; - var hasARMV5 = (ArrayHelper.containsValue (project.architectures, Architecture.ARMV5) || ArrayHelper.containsValue (project.architectures, Architecture.ARMV6)); - var hasARMV7 = ArrayHelper.containsValue (project.architectures, Architecture.ARMV7); - var hasARM64 = ArrayHelper.containsValue (project.architectures, Architecture.ARM64); - var hasX86 = ArrayHelper.containsValue (project.architectures, Architecture.X86); + var hasARMV5 = (ArrayTools.containsValue (project.architectures, Architecture.ARMV5) || ArrayTools.containsValue (project.architectures, Architecture.ARMV6)); + var hasARMV7 = ArrayTools.containsValue (project.architectures, Architecture.ARMV7); + var hasARM64 = ArrayTools.containsValue (project.architectures, Architecture.ARM64); + var hasX86 = ArrayTools.containsValue (project.architectures, Architecture.X86); var architectures = []; @@ -120,13 +120,13 @@ class AndroidPlatform extends PlatformTarget { } - ProcessHelper.runCommand ("", "haxe", haxeParams); + System.runCommand ("", "haxe", haxeParams); if (noOutput) return; CPPHelper.compile (project, targetDirectory + "/obj", cppParams); - FileHelper.copyIfNewer (targetDirectory + "/obj/libApplicationMain" + (project.debug ? "-debug" : "") + suffix, path + "/libApplicationMain.so"); + System.copyIfNewer (targetDirectory + "/obj/libApplicationMain" + (project.debug ? "-debug" : "") + suffix, path + "/libApplicationMain.so"); } @@ -134,7 +134,7 @@ class AndroidPlatform extends PlatformTarget { if (FileSystem.exists (sourceSet + "/jniLibs/armeabi")) { - PathHelper.removeDirectory (sourceSet + "/jniLibs/armeabi-"); + System.removeDirectory (sourceSet + "/jniLibs/armeabi-"); } @@ -144,7 +144,7 @@ class AndroidPlatform extends PlatformTarget { if (FileSystem.exists (sourceSet + "/jniLibs/armeabi-v7a")) { - PathHelper.removeDirectory (sourceSet + "/jniLibs/armeabi-v7a"); + System.removeDirectory (sourceSet + "/jniLibs/armeabi-v7a"); } @@ -154,7 +154,7 @@ class AndroidPlatform extends PlatformTarget { if (FileSystem.exists (sourceSet + "/jniLibs/arm64-v8a")) { - PathHelper.removeDirectory (sourceSet + "/jniLibs/arm64-v8a"); + System.removeDirectory (sourceSet + "/jniLibs/arm64-v8a"); } @@ -164,7 +164,7 @@ class AndroidPlatform extends PlatformTarget { if (FileSystem.exists (sourceSet + "/jniLibs/x86")) { - PathHelper.removeDirectory (sourceSet + "/jniLibs/x86"); + System.removeDirectory (sourceSet + "/jniLibs/x86"); } @@ -181,7 +181,7 @@ class AndroidPlatform extends PlatformTarget { if (FileSystem.exists (targetDirectory)) { - PathHelper.removeDirectory (targetDirectory); + System.removeDirectory (targetDirectory); } @@ -204,7 +204,7 @@ class AndroidPlatform extends PlatformTarget { private function getDisplayHXML ():String { - var hxml = PathHelper.findTemplate (project.templatePaths, "android/hxml/" + buildType + ".hxml"); + var hxml = System.findTemplate (project.templatePaths, "android/hxml/" + buildType + ".hxml"); var context = project.templateContext; context.CPP_DIR = targetDirectory + "/obj"; @@ -231,15 +231,15 @@ class AndroidPlatform extends PlatformTarget { if (project.config.exists ("android.gradle-build-directory")) { - outputDirectory = PathHelper.combine (project.config.getString ("android.gradle-build-directory"), project.app.file + "/app/outputs/apk"); + outputDirectory = Path.combine (project.config.getString ("android.gradle-build-directory"), project.app.file + "/app/outputs/apk"); } else { - outputDirectory = PathHelper.combine (FileSystem.fullPath (targetDirectory), "bin/app/build/outputs/apk"); + outputDirectory = Path.combine (FileSystem.fullPath (targetDirectory), "bin/app/build/outputs/apk"); } - var apkPath = PathHelper.combine (outputDirectory, project.app.file + build + ".apk"); + var apkPath = Path.combine (outputDirectory, project.app.file + build + ".apk"); deviceID = AndroidHelper.install (project, apkPath, deviceID); @@ -248,10 +248,10 @@ class AndroidPlatform extends PlatformTarget { public override function rebuild ():Void { - var armv5 = (command == "rebuild" || ArrayHelper.containsValue (project.architectures, Architecture.ARMV5) || ArrayHelper.containsValue (project.architectures, Architecture.ARMV6)); - var armv7 = (command == "rebuild" || ArrayHelper.containsValue (project.architectures, Architecture.ARMV7)); - var arm64 = (command == "rebuild" || ArrayHelper.containsValue (project.architectures, Architecture.ARM64)); - var x86 = (command == "rebuild" || ArrayHelper.containsValue (project.architectures, Architecture.X86)); + var armv5 = (command == "rebuild" || ArrayTools.containsValue (project.architectures, Architecture.ARMV5) || ArrayTools.containsValue (project.architectures, Architecture.ARMV6)); + var armv7 = (command == "rebuild" || ArrayTools.containsValue (project.architectures, Architecture.ARMV7)); + var arm64 = (command == "rebuild" || ArrayTools.containsValue (project.architectures, Architecture.ARM64)); + var x86 = (command == "rebuild" || ArrayTools.containsValue (project.architectures, Architecture.X86)); var commands = []; @@ -296,8 +296,8 @@ class AndroidPlatform extends PlatformTarget { if (asset.embed && asset.sourcePath == "") { - var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath); - PathHelper.mkdir (Path.directory (path)); + var path = Path.combine (targetDirectory + "/obj/tmp", asset.targetPath); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path); asset.sourcePath = path; @@ -309,11 +309,11 @@ class AndroidPlatform extends PlatformTarget { var destination = targetDirectory + "/bin"; var sourceSet = destination + "/app/src/main"; - PathHelper.mkdir (sourceSet); - PathHelper.mkdir (sourceSet + "/res/drawable-ldpi/"); - PathHelper.mkdir (sourceSet + "/res/drawable-mdpi/"); - PathHelper.mkdir (sourceSet + "/res/drawable-hdpi/"); - PathHelper.mkdir (sourceSet + "/res/drawable-xhdpi/"); + System.mkdir (sourceSet); + System.mkdir (sourceSet + "/res/drawable-ldpi/"); + System.mkdir (sourceSet + "/res/drawable-mdpi/"); + System.mkdir (sourceSet + "/res/drawable-hdpi/"); + System.mkdir (sourceSet + "/res/drawable-xhdpi/"); for (asset in project.assets) { @@ -330,7 +330,7 @@ class AndroidPlatform extends PlatformTarget { //asset.flatName += ((extension != "") ? "." + extension : ""); //asset.resourceName = asset.flatName; - targetPath = PathHelper.combine (sourceSet + "/assets/", asset.resourceName); + targetPath = Path.combine (sourceSet + "/assets/", asset.resourceName); //asset.resourceName = asset.id; //targetPath = sourceSet + "/res/raw/" + asset.flatName + "." + Path.extension (asset.targetPath); @@ -408,7 +408,7 @@ class AndroidPlatform extends PlatformTarget { for (dependency in project.dependencies) { - if (dependency.path != "" && FileSystem.exists (dependency.path) && FileSystem.isDirectory (dependency.path) && (FileSystem.exists (PathHelper.combine (dependency.path, "project.properties")) || FileSystem.exists (PathHelper.combine (dependency.path, "build.gradle")))) { + if (dependency.path != "" && FileSystem.exists (dependency.path) && FileSystem.isDirectory (dependency.path) && (FileSystem.exists (Path.combine (dependency.path, "project.properties")) || FileSystem.exists (Path.combine (dependency.path, "build.gradle")))) { var name = dependency.name; if (name == "") name = "project" + index; @@ -426,7 +426,7 @@ class AndroidPlatform extends PlatformTarget { if (icons.length == 0) { - icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ]; + icons = [ new Icon (System.findTemplate (project.templatePaths, "default/icon.svg")) ]; } @@ -444,7 +444,7 @@ class AndroidPlatform extends PlatformTarget { var packageDirectory = project.meta.packageName; packageDirectory = sourceSet + "/java/" + packageDirectory.split (".").join ("/"); - PathHelper.mkdir (packageDirectory); + System.mkdir (packageDirectory); for (javaPath in project.javaPaths) { @@ -452,17 +452,17 @@ class AndroidPlatform extends PlatformTarget { if (FileSystem.isDirectory (javaPath)) { - FileHelper.recursiveCopy (javaPath, sourceSet + "/java", context, true); + System.recursiveCopy (javaPath, sourceSet + "/java", context, true); } else { if (Path.extension (javaPath) == "jar") { - FileHelper.copyIfNewer (javaPath, destination + "/app/libs/" + Path.withoutDirectory (javaPath)); + System.copyIfNewer (javaPath, destination + "/app/libs/" + Path.withoutDirectory (javaPath)); } else { - FileHelper.copyIfNewer (javaPath, sourceSet + "/java/" + Path.withoutDirectory (javaPath)); + System.copyIfNewer (javaPath, sourceSet + "/java/" + Path.withoutDirectory (javaPath)); } @@ -478,12 +478,12 @@ class AndroidPlatform extends PlatformTarget { for (library in context.ANDROID_LIBRARY_PROJECTS) { - FileHelper.recursiveCopy (library.source, destination + "/deps/" + library.name, context, true); + System.recursiveCopy (library.source, destination + "/deps/" + library.name, context, true); } ProjectHelper.recursiveSmartCopyTemplate (project, "android/template", destination, context); - FileHelper.copyFileTemplate (project.templatePaths, "android/MainActivity.java", packageDirectory + "/MainActivity.java", context); + System.copyFileTemplate (project.templatePaths, "android/MainActivity.java", packageDirectory + "/MainActivity.java", context); ProjectHelper.recursiveSmartCopyTemplate (project, "haxe", targetDirectory + "/haxe", context); ProjectHelper.recursiveSmartCopyTemplate (project, "android/hxml", targetDirectory + "/haxe", context); @@ -491,8 +491,8 @@ class AndroidPlatform extends PlatformTarget { if (asset.type == AssetType.TEMPLATE) { - var targetPath = PathHelper.combine (destination, asset.targetPath); - PathHelper.mkdir (Path.directory (targetPath)); + var targetPath = Path.combine (destination, asset.targetPath); + System.mkdir (Path.directory (targetPath)); AssetHelper.copyAsset (asset, targetPath, context); } @@ -504,9 +504,9 @@ class AndroidPlatform extends PlatformTarget { public override function watch ():Void { - var dirs = WatchHelper.processHXML (getDisplayHXML (), project.app.path); + var dirs = []; // WatchHelper.processHXML (getDisplayHXML (), project.app.path); var command = ProjectHelper.getCurrentCommand (); - WatchHelper.watch (command, dirs); + System.watch (command, dirs); } diff --git a/tools/platforms/EmscriptenPlatform.hx b/tools/platforms/EmscriptenPlatform.hx index 02700bb34..43ff50f4c 100644 --- a/tools/platforms/EmscriptenPlatform.hx +++ b/tools/platforms/EmscriptenPlatform.hx @@ -1,20 +1,21 @@ package; -import haxe.io.Path; +import hxp.Path; +import hxp.NDLL; import haxe.Json; import haxe.Template; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.DeploymentHelper; -import hxp.FileHelper; +import hxp.System; import hxp.Haxelib; import lime.tools.HTML5Helper; import hxp.Log; -import hxp.PathHelper; +import hxp.Path; import lime.tools.PlatformTarget; -import hxp.ProcessHelper; +import hxp.System; import lime.tools.Project; import lime.tools.ProjectHelper; import sys.io.File; @@ -31,7 +32,7 @@ class EmscriptenPlatform extends PlatformTarget { super (command, _project, targetFlags); - targetDirectory = PathHelper.combine (project.app.path, project.config.getString ("emscripten.output-directory", "emscripten")); + targetDirectory = Path.combine (project.app.path, project.config.getString ("emscripten.output-directory", "emscripten")); outputFile = targetDirectory + "/bin/" + project.app.file + ".js"; } @@ -67,7 +68,7 @@ class EmscriptenPlatform extends PlatformTarget { } - ProcessHelper.runCommand ("", "haxe", args); + System.runCommand ("", "haxe", args); if (noOutput) return; @@ -75,18 +76,18 @@ class EmscriptenPlatform extends PlatformTarget { project.path (sdkPath); - ProcessHelper.runCommand ("", "emcc", [ targetDirectory + "/obj/Main.cpp", "-o", targetDirectory + "/obj/Main.o" ], true, false, true); + System.runCommand ("", "emcc", [ targetDirectory + "/obj/Main.cpp", "-o", targetDirectory + "/obj/Main.o" ], true, false, true); args = [ "Main.o" ]; for (ndll in project.ndlls) { - var path = PathHelper.getLibraryPath (ndll, "Emscripten", "lib", ".a", project.debug); + var path = NDLL.getLibraryPath (ndll, "Emscripten", "lib", ".a", project.debug); args.push (path); } - var json = Json.parse (File.getContent (PathHelper.getHaxelib (new Haxelib ("hxcpp"), true) + "/haxelib.json")); + var json = Json.parse (File.getContent (Haxelib.getPath (new Haxelib ("hxcpp"), true) + "/haxelib.json")); var prefix = ""; var version = Std.string (json.version); @@ -101,7 +102,7 @@ class EmscriptenPlatform extends PlatformTarget { } args = args.concat ([ prefix + "ApplicationMain" + (project.debug ? "-debug" : "") + ".a", "-o", "ApplicationMain.o" ]); - ProcessHelper.runCommand (targetDirectory + "/obj", "emcc", args, true, false, true); + System.runCommand (targetDirectory + "/obj", "emcc", args, true, false, true); args = [ "ApplicationMain.o" ]; @@ -192,8 +193,8 @@ class EmscriptenPlatform extends PlatformTarget { //if (project.targetFlags.exists ("compress")) { // //args.push ("--compression"); - //args.push (PathHelper.findTemplate (project.templatePaths, "bin/utils/lzma/compress.exe") + "," + PathHelper.findTemplate (project.templatePaths, "resources/lzma-decoder.js") + ",LZMA.decompress"); - //args.push ("haxelib run openfl compress," + PathHelper.findTemplate (project.templatePaths, "resources/lzma-decoder.js") + ",LZMA.decompress"); + //args.push (System.findTemplate (project.templatePaths, "bin/utils/lzma/compress.exe") + "," + System.findTemplate (project.templatePaths, "resources/lzma-decoder.js") + ",LZMA.decompress"); + //args.push ("haxelib run openfl compress," + System.findTemplate (project.templatePaths, "resources/lzma-decoder.js") + ",LZMA.decompress"); //args.push ("-o"); //args.push ("../bin/index.html"); // @@ -206,7 +207,7 @@ class EmscriptenPlatform extends PlatformTarget { //args.push ("../bin/index.html"); - ProcessHelper.runCommand (targetDirectory + "/obj", "emcc", args, true, false, true); + System.runCommand (targetDirectory + "/obj", "emcc", args, true, false, true); if (project.targetFlags.exists ("minify")) { @@ -241,7 +242,7 @@ class EmscriptenPlatform extends PlatformTarget { if (FileSystem.exists (targetDirectory)) { - PathHelper.removeDirectory (targetDirectory); + System.removeDirectory (targetDirectory); } @@ -257,7 +258,7 @@ class EmscriptenPlatform extends PlatformTarget { public override function display ():Void { - var hxml = PathHelper.findTemplate (project.templatePaths, "emscripten/hxml/" + buildType + ".hxml"); + var hxml = System.findTemplate (project.templatePaths, "emscripten/hxml/" + buildType + ".hxml"); var context = project.templateContext; context.OUTPUT_DIR = targetDirectory; @@ -295,8 +296,8 @@ class EmscriptenPlatform extends PlatformTarget { if (asset.embed && asset.sourcePath == "") { - var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath); - PathHelper.mkdir (Path.directory (path)); + var path = Path.combine (targetDirectory + "/obj/tmp", asset.targetPath); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path); asset.sourcePath = path; @@ -311,7 +312,7 @@ class EmscriptenPlatform extends PlatformTarget { } var destination = targetDirectory + "/bin/"; - PathHelper.mkdir (destination); + System.mkdir (destination); //for (asset in project.assets) { // @@ -339,13 +340,13 @@ class EmscriptenPlatform extends PlatformTarget { for (asset in project.assets) { - var path = PathHelper.combine (targetDirectory + "/obj/assets", asset.targetPath); + var path = Path.combine (targetDirectory + "/obj/assets", asset.targetPath); if (asset.type != AssetType.TEMPLATE) { //if (asset.type != AssetType.FONT) { - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); AssetHelper.copyAssetIfNewer (asset, path); //} @@ -361,11 +362,11 @@ class EmscriptenPlatform extends PlatformTarget { for (asset in project.assets) { - var path = PathHelper.combine (destination, asset.targetPath); + var path = Path.combine (destination, asset.targetPath); if (asset.type == AssetType.TEMPLATE) { - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path, context); } diff --git a/tools/platforms/FlashPlatform.hx b/tools/platforms/FlashPlatform.hx index 770492781..5ef6212f8 100644 --- a/tools/platforms/FlashPlatform.hx +++ b/tools/platforms/FlashPlatform.hx @@ -1,25 +1,25 @@ package; -import haxe.io.Path; +import hxp.Path; import haxe.Json; import haxe.Template; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.DeploymentHelper; import lime.tools.ProjectHelper; -import hxp.FileHelper; +import hxp.System; import lime.tools.FlashHelper; import hxp.Haxelib; import lime.tools.HTML5Helper; import hxp.Log; -import hxp.PathHelper; +import hxp.Path; import lime.tools.Platform; -import hxp.PlatformHelper; +import hxp.System; import lime.tools.PlatformTarget; -import hxp.ProcessHelper; +import hxp.System; import lime.tools.Project; -import hxp.WatchHelper; +import hxp.System; import sys.io.File; import sys.FileSystem; @@ -39,14 +39,14 @@ class FlashPlatform extends PlatformTarget { super (command, _project, targetFlags); - targetDirectory = PathHelper.combine (project.app.path, project.config.getString ("flash.output-directory", "flash")); + targetDirectory = Path.combine (project.app.path, project.config.getString ("flash.output-directory", "flash")); } public override function build ():Void { - ProcessHelper.runCommand ("", "haxe", [ targetDirectory + "/haxe/" + buildType + ".hxml" ]); + System.runCommand ("", "haxe", [ targetDirectory + "/haxe/" + buildType + ".hxml" ]); } @@ -57,7 +57,7 @@ class FlashPlatform extends PlatformTarget { if (FileSystem.exists (targetPath)) { - PathHelper.removeDirectory (targetPath); + System.removeDirectory (targetPath); } @@ -121,7 +121,7 @@ class FlashPlatform extends PlatformTarget { private function getDisplayHXML ():String { - var hxml = PathHelper.findTemplate (project.templatePaths, "flash/hxml/" + buildType + ".hxml"); + var hxml = System.findTemplate (project.templatePaths, "flash/hxml/" + buildType + ".hxml"); var context = project.templateContext; context.WIN_FLASHBACKGROUND = StringTools.hex (project.window.background, 6); @@ -145,7 +145,7 @@ class FlashPlatform extends PlatformTarget { if (project.app.url != null && project.app.url != "") { - ProcessHelper.openURL (project.app.url); + System.openURL (project.app.url); } else { @@ -195,7 +195,7 @@ class FlashPlatform extends PlatformTarget { AssetHelper.processLibraries (project, targetDirectory); var destination = targetDirectory + "/bin/"; - PathHelper.mkdir (destination); + System.mkdir (destination); // project = project.clone (); @@ -210,7 +210,7 @@ class FlashPlatform extends PlatformTarget { if (project.targetFlags.exists ("web") || project.app.url != "") { - PathHelper.mkdir (destination); + System.mkdir (destination); ProjectHelper.recursiveSmartCopyTemplate (project, "flash/templates/web", destination, generateContext ()); } @@ -253,9 +253,9 @@ class FlashPlatform extends PlatformTarget { if (asset.type == AssetType.TEMPLATE || asset.embed == false /*|| !usesLime*/) { - var path = PathHelper.combine (destination, asset.targetPath); + var path = Path.combine (destination, asset.targetPath); - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path, context); } @@ -271,7 +271,7 @@ class FlashPlatform extends PlatformTarget { if (icon != "") { - FileHelper.copyIfNewer (icon, targetPath); + System.copyIfNewer (icon, targetPath); } else { @@ -284,9 +284,9 @@ class FlashPlatform extends PlatformTarget { public override function watch ():Void { - var dirs = WatchHelper.processHXML (getDisplayHXML (), project.app.path); + var dirs = []; // WatchHelper.processHXML (getDisplayHXML (), project.app.path); var command = ProjectHelper.getCurrentCommand (); - WatchHelper.watch (command, dirs); + System.watch (command, dirs); } diff --git a/tools/platforms/HTML5Platform.hx b/tools/platforms/HTML5Platform.hx index 30ae39fed..d6336c60f 100644 --- a/tools/platforms/HTML5Platform.hx +++ b/tools/platforms/HTML5Platform.hx @@ -1,7 +1,7 @@ package; -import haxe.io.Path; +import hxp.Path; import haxe.Template; #if lime import lime.text.Font; @@ -10,18 +10,18 @@ import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.DeploymentHelper; import lime.tools.ElectronHelper; -import hxp.FileHelper; +import hxp.System; import lime.tools.HTML5Helper; import lime.tools.Icon; import lime.tools.IconHelper; import hxp.Log; import lime.tools.ModuleHelper; import lime.tools.ProjectHelper; -import hxp.PathHelper; +import hxp.Path; import lime.tools.PlatformTarget; -import hxp.ProcessHelper; +import hxp.System; import lime.tools.Project; -import hxp.WatchHelper; +import hxp.System; import sys.io.File; import sys.FileSystem; @@ -61,7 +61,7 @@ class HTML5Platform extends PlatformTarget { } var hxml = targetDirectory + "/haxe/" + type + ".hxml"; - ProcessHelper.runCommand ("", "haxe", [ hxml ] ); + System.runCommand ("", "haxe", [ hxml ] ); if (noOutput) return; @@ -69,7 +69,7 @@ class HTML5Platform extends PlatformTarget { if (project.targetFlags.exists ("webgl")) { - FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain.js", outputFile); + System.copyFile (targetDirectory + "/obj/ApplicationMain.js", outputFile); } @@ -94,7 +94,7 @@ class HTML5Platform extends PlatformTarget { if (FileSystem.exists (targetDirectory)) { - PathHelper.removeDirectory (targetDirectory); + System.removeDirectory (targetDirectory); } @@ -133,7 +133,7 @@ class HTML5Platform extends PlatformTarget { } - var hxml = PathHelper.findTemplate (project.templatePaths, type + "/hxml/" + buildType + ".hxml"); + var hxml = System.findTemplate (project.templatePaths, type + "/hxml/" + buildType + ".hxml"); var context = project.templateContext; context.OUTPUT_DIR = targetDirectory; @@ -150,11 +150,11 @@ class HTML5Platform extends PlatformTarget { if (targetFlags.exists ("electron")) { - targetDirectory = PathHelper.combine (project.app.path, project.config.getString ("electron.output-directory", "electron")); + targetDirectory = Path.combine (project.app.path, project.config.getString ("electron.output-directory", "electron")); } else { - targetDirectory = PathHelper.combine (project.app.path, project.config.getString ("html5.output-directory", "html5")); + targetDirectory = Path.combine (project.app.path, project.config.getString ("html5.output-directory", "html5")); } @@ -193,7 +193,7 @@ class HTML5Platform extends PlatformTarget { // project = project.clone (); var destination = targetDirectory + "/bin/"; - PathHelper.mkdir (destination); + System.mkdir (destination); var webfontDirectory = targetDirectory + "/obj/webfont"; var useWebfonts = true; @@ -216,12 +216,12 @@ class HTML5Platform extends PlatformTarget { if (useWebfonts) { - fontPath = PathHelper.combine (webfontDirectory, Path.withoutDirectory (asset.targetPath)); + fontPath = Path.combine (webfontDirectory, Path.withoutDirectory (asset.targetPath)); if (!FileSystem.exists (fontPath)) { - PathHelper.mkdir (webfontDirectory); - FileHelper.copyFile (asset.sourcePath, fontPath); + System.mkdir (webfontDirectory); + System.copyFile (asset.sourcePath, fontPath); var originalPath = asset.sourcePath; asset.sourcePath = fontPath; @@ -313,17 +313,17 @@ class HTML5Platform extends PlatformTarget { if (icons.length == 0) { - icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ]; + icons = [ new Icon (System.findTemplate (project.templatePaths, "default/icon.svg")) ]; } - //if (IconHelper.createWindowsIcon (icons, PathHelper.combine (destination, "favicon.ico"))) { + //if (IconHelper.createWindowsIcon (icons, Path.combine (destination, "favicon.ico"))) { // //context.favicons.push ({ rel: "icon", type: "image/x-icon", href: "./favicon.ico" }); // //} - if (IconHelper.createIcon (icons, 192, 192, PathHelper.combine (destination, "favicon.png"))) { + if (IconHelper.createIcon (icons, 192, 192, Path.combine (destination, "favicon.png"))) { context.favicons.push ({ rel: "shortcut icon", type: "image/png", href: "./favicon.png" }); @@ -342,7 +342,7 @@ class HTML5Platform extends PlatformTarget { var name = Path.withoutDirectory (dependency.path); context.linkedLibraries.push ("./" + dependencyPath + "/" + name); - FileHelper.copyIfNewer (dependency.path, PathHelper.combine (destination, PathHelper.combine (dependencyPath, name))); + System.copyIfNewer (dependency.path, Path.combine (destination, Path.combine (dependencyPath, name))); } @@ -350,18 +350,18 @@ class HTML5Platform extends PlatformTarget { for (asset in project.assets) { - var path = PathHelper.combine (destination, asset.targetPath); + var path = Path.combine (destination, asset.targetPath); if (asset.type != AssetType.TEMPLATE) { if (/*asset.embed != true &&*/ asset.type != AssetType.FONT) { - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); AssetHelper.copyAssetIfNewer (asset, path); } else if (asset.type == AssetType.FONT && useWebfonts) { - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); var ext = "." + Path.extension (asset.sourcePath); var source = Path.withoutExtension (asset.sourcePath); @@ -375,7 +375,7 @@ class HTML5Platform extends PlatformTarget { if (FileSystem.exists (source + extension)) { - FileHelper.copyIfNewer (source + extension, path + extension); + System.copyIfNewer (source + extension, path + extension); hasFormat[i] = true; } @@ -461,11 +461,11 @@ class HTML5Platform extends PlatformTarget { for (asset in project.assets) { - var path = PathHelper.combine (destination, asset.targetPath); + var path = Path.combine (destination, asset.targetPath); if (asset.type == AssetType.TEMPLATE) { - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path, context); } @@ -479,9 +479,9 @@ class HTML5Platform extends PlatformTarget { // TODO: Use a custom live reload HTTP server for test/run instead - var dirs = WatchHelper.processHXML (getDisplayHXML (), project.app.path); + var dirs = []; // WatchHelper.processHXML (getDisplayHXML (), project.app.path); var command = ProjectHelper.getCurrentCommand (); - WatchHelper.watch (command, dirs); + System.watch (command, dirs); } diff --git a/tools/platforms/IOSPlatform.hx b/tools/platforms/IOSPlatform.hx index e4cea8c28..35b4ff368 100644 --- a/tools/platforms/IOSPlatform.hx +++ b/tools/platforms/IOSPlatform.hx @@ -2,17 +2,17 @@ package; //import openfl.display.BitmapData; -import haxe.io.Path; +import hxp.Path; import haxe.Json; import haxe.Template; import lime.tools.Architecture; -import hxp.ArrayHelper; +import hxp.ArrayTools; import lime.tools.Asset; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.DeploymentHelper; -import hxp.FileHelper; +import hxp.System; import hxp.Haxelib; import lime.tools.Icon; import lime.tools.IconHelper; @@ -20,15 +20,15 @@ import lime.tools.IOSHelper; import lime.tools.Keystore; import hxp.Log; import hxp.NDLL; -import hxp.PathHelper; +import hxp.Path; import lime.tools.Platform; -import hxp.PlatformHelper; +import hxp.System; import lime.tools.PlatformTarget; -import hxp.ProcessHelper; +import hxp.System; import lime.tools.Project; import lime.tools.ProjectHelper; -import hxp.StringHelper; -import hxp.WatchHelper; +import hxp.StringTools; +import hxp.System; #if lime import lime.graphics.Image; #end @@ -43,16 +43,16 @@ class IOSPlatform extends PlatformTarget { super (command, _project, targetFlags); - targetDirectory = PathHelper.combine (project.app.path, project.config.getString ("ios.output-directory", "ios")); + targetDirectory = Path.combine (project.app.path, project.config.getString ("ios.output-directory", "ios")); } public override function build ():Void { - if (project.targetFlags.exists ("xcode") && PlatformHelper.hostPlatform == MAC) { + if (project.targetFlags.exists ("xcode") && System.hostPlatform == MAC) { - ProcessHelper.runCommand ("", "open", [ targetDirectory + "/" + project.app.file + ".xcodeproj" ] ); + System.runCommand ("", "open", [ targetDirectory + "/" + project.app.file + ".xcodeproj" ] ); } else { @@ -75,7 +75,7 @@ class IOSPlatform extends PlatformTarget { if (FileSystem.exists (targetDirectory)) { - PathHelper.removeDirectory (targetDirectory); + System.removeDirectory (targetDirectory); } @@ -101,7 +101,7 @@ class IOSPlatform extends PlatformTarget { //project = project.clone (); project.sources.unshift (""); - project.sources = PathHelper.relocatePaths (project.sources, PathHelper.combine (targetDirectory, project.app.file + "/haxe")); + project.sources = Path.relocatePaths (project.sources, Path.combine (targetDirectory, project.app.file + "/haxe")); //project.dependencies.push ("stdc++"); if (project.targetFlags.exists ("xml")) { @@ -143,7 +143,7 @@ class IOSPlatform extends PlatformTarget { if (project.config.exists ("ios.provisioning-profile")) { - context.IOS_PROVISIONING_PROFILE = PathHelper.tryFullPath (project.config.getString ("ios.provisioning-profile")); + context.IOS_PROVISIONING_PROFILE = Path.tryFullPath (project.config.getString ("ios.provisioning-profile")); } @@ -204,7 +204,7 @@ class IOSPlatform extends PlatformTarget { if (project.config.getFloat ("ios.deployment", 8) < 5) { - ArrayHelper.addUnique (architectures, Architecture.ARMV6); + ArrayTools.addUnique (architectures, Architecture.ARMV6); } @@ -267,7 +267,7 @@ class IOSPlatform extends PlatformTarget { context.IOS_COMPILER = project.config.getString ("ios.compiler", "clang"); context.CPP_BUILD_LIBRARY = project.config.getString ("cpp.buildLibrary", "hxcpp"); - var json = Json.parse (File.getContent (PathHelper.getHaxelib (new Haxelib ("hxcpp"), true) + "/haxelib.json")); + var json = Json.parse (File.getContent (Haxelib.getPath (new Haxelib ("hxcpp"), true) + "/haxelib.json")); var version = Std.string (json.version); var versionSplit = version.split ("."); @@ -330,17 +330,17 @@ class IOSPlatform extends PlatformTarget { } else if (Path.extension (dependency.path) == "framework") { name = Path.withoutDirectory (dependency.path); - path = PathHelper.tryFullPath (dependency.path); + path = Path.tryFullPath (dependency.path); fileType = "wrapper.framework"; } if (name != null) { - var frameworkID = "11C0000000000018" + StringHelper.getUniqueID (); - var fileID = "11C0000000000018" + StringHelper.getUniqueID (); + var frameworkID = "11C0000000000018" + StringTools.getUniqueID (); + var fileID = "11C0000000000018" + StringTools.getUniqueID (); - ArrayHelper.addUnique (context.frameworkSearchPaths, Path.directory (path)); + ArrayTools.addUnique (context.frameworkSearchPaths, Path.directory (path)); context.ADDL_PBX_BUILD_FILE += " " + frameworkID + " /* " + name + " in Frameworks */ = {isa = PBXBuildFile; fileRef = " + fileID + " /* " + name + " */; };\n"; context.ADDL_PBX_FILE_REFERENCE += " " + fileID + " /* " + name + " */ = {isa = PBXFileReference; lastKnownFileType = \"" + fileType + "\"; name = \"" + name + "\"; path = \"" + path + "\"; sourceTree = SDKROOT; };\n"; @@ -351,8 +351,8 @@ class IOSPlatform extends PlatformTarget { } - context.HXML_PATH = PathHelper.findTemplate (project.templatePaths, "iphone/PROJ/haxe/Build.hxml", false); - if (context.HXML_PATH == null) context.HXML_PATH = PathHelper.findTemplate (project.templatePaths, "ios/template/{{app.file}}/haxe/Build.hxml"); + context.HXML_PATH = System.findTemplate (project.templatePaths, "iphone/PROJ/haxe/Build.hxml", false); + if (context.HXML_PATH == null) context.HXML_PATH = System.findTemplate (project.templatePaths, "ios/template/{{app.file}}/haxe/Build.hxml"); context.PRERENDERED_ICON = project.config.getBool ("ios.prerenderedIcon", false); var allowInsecureHTTP = project.config.getString ("ios.allow-insecure-http", "*"); @@ -396,8 +396,8 @@ class IOSPlatform extends PlatformTarget { private function getDisplayHXML ():String { - var hxml = PathHelper.findTemplate (project.templatePaths, "iphone/PROJ/haxe/Build.hxml", false); - if (hxml == null) hxml = PathHelper.findTemplate (project.templatePaths, "iphone/template/{{app.file}}/Build.hxml", true); + var hxml = System.findTemplate (project.templatePaths, "iphone/PROJ/haxe/Build.hxml", false); + if (hxml == null) hxml = System.findTemplate (project.templatePaths, "iphone/template/{{app.file}}/Build.hxml", true); var template = new Template (File.getContent (hxml)); // project = project.clone (); @@ -472,8 +472,8 @@ class IOSPlatform extends PlatformTarget { if (asset.embed && asset.sourcePath == "") { - var path = PathHelper.combine (targetDirectory + "/" + project.app.file + "/obj/tmp", asset.targetPath); - PathHelper.mkdir (Path.directory (path)); + var path = Path.combine (targetDirectory + "/" + project.app.file + "/obj/tmp", asset.targetPath); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path); asset.sourcePath = path; @@ -493,10 +493,10 @@ class IOSPlatform extends PlatformTarget { var projectDirectory = targetDirectory + "/" + project.app.file + "/"; - PathHelper.mkdir (targetDirectory); - PathHelper.mkdir (projectDirectory); - PathHelper.mkdir (projectDirectory + "/haxe"); - PathHelper.mkdir (projectDirectory + "/haxe/lime/installer"); + System.mkdir (targetDirectory); + System.mkdir (projectDirectory); + System.mkdir (projectDirectory + "/haxe"); + System.mkdir (projectDirectory + "/haxe/lime/installer"); var iconSizes:Array = [ { name: "Icon-20.png", size: 20 }, @@ -524,20 +524,20 @@ class IOSPlatform extends PlatformTarget { context.HAS_ICON = true; - var iconPath = PathHelper.combine (projectDirectory, "Images.xcassets/AppIcon.appiconset"); - PathHelper.mkdir (iconPath); + var iconPath = Path.combine (projectDirectory, "Images.xcassets/AppIcon.appiconset"); + System.mkdir (iconPath); var icons = project.icons; if (icons.length == 0) { - icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ]; + icons = [ new Icon (System.findTemplate (project.templatePaths, "default/icon.svg")) ]; } for (iconSize in iconSizes) { - if (!IconHelper.createIcon (icons, iconSize.size, iconSize.size, PathHelper.combine (iconPath, iconSize.name))) { + if (!IconHelper.createIcon (icons, iconSize.size, iconSize.size, Path.combine (iconPath, iconSize.name))) { context.HAS_ICON = false; @@ -560,8 +560,8 @@ class IOSPlatform extends PlatformTarget { { name: "Default-Landscape-812h@3x.png", w: 2436, h: 1125 } // iPhone X, landscape ]; - var splashScreenPath = PathHelper.combine (projectDirectory, "Images.xcassets/LaunchImage.launchimage"); - PathHelper.mkdir (splashScreenPath); + var splashScreenPath = Path.combine (projectDirectory, "Images.xcassets/LaunchImage.launchimage"); + System.mkdir (splashScreenPath); for (size in splashSizes) { @@ -571,7 +571,7 @@ class IOSPlatform extends PlatformTarget { if (splashScreen.width == size.w && splashScreen.height == size.h && Path.extension (splashScreen.path) == "png") { - FileHelper.copyFile (splashScreen.path, PathHelper.combine (splashScreenPath, size.name)); + System.copyFile (splashScreen.path, Path.combine (splashScreenPath, size.name)); match = true; } @@ -580,7 +580,7 @@ class IOSPlatform extends PlatformTarget { if (!match) { - var imagePath = PathHelper.combine (splashScreenPath, size.name); + var imagePath = Path.combine (splashScreenPath, size.name); if (!FileSystem.exists (imagePath)) { @@ -601,8 +601,8 @@ class IOSPlatform extends PlatformTarget { context.HAS_LAUNCH_IMAGE = true; - PathHelper.mkdir (projectDirectory + "/resources"); - PathHelper.mkdir (projectDirectory + "/haxe/build"); + System.mkdir (projectDirectory + "/resources"); + System.mkdir (projectDirectory + "/haxe/build"); // Long deprecated template path @@ -618,11 +618,11 @@ class IOSPlatform extends PlatformTarget { ProjectHelper.recursiveSmartCopyTemplate (project, "haxe", projectDirectory + "/haxe", context, true, false); ProjectHelper.recursiveSmartCopyTemplate (project, "iphone/PROJ/Classes", projectDirectory + "/Classes", context, true, false); ProjectHelper.recursiveSmartCopyTemplate (project, "iphone/PROJ/Images.xcassets", projectDirectory + "/Images.xcassets", context, true, false); - FileHelper.copyFileTemplate (project.templatePaths, "iphone/PROJ/PROJ-Info.plist", projectDirectory + "/" + project.app.file + "-Info.plist", context, true, false); - FileHelper.copyFileTemplate (project.templatePaths, "iphone/PROJ/PROJ-Prefix.pch", projectDirectory + "/" + project.app.file + "-Prefix.pch", context, true, false); + System.copyFileTemplate (project.templatePaths, "iphone/PROJ/PROJ-Info.plist", projectDirectory + "/" + project.app.file + "-Info.plist", context, true, false); + System.copyFileTemplate (project.templatePaths, "iphone/PROJ/PROJ-Prefix.pch", projectDirectory + "/" + project.app.file + "-Prefix.pch", context, true, false); ProjectHelper.recursiveSmartCopyTemplate (project, "iphone/PROJ.xcodeproj", targetDirectory + "/" + project.app.file + ".xcodeproj", context, true, false); - PathHelper.mkdir (projectDirectory + "/lib"); + System.mkdir (projectDirectory + "/lib"); for (archID in 0...6) { @@ -642,30 +642,30 @@ class IOSPlatform extends PlatformTarget { var libExt = [ ".iphoneos.a", ".iphoneos-v7.a", ".iphoneos-v7s.a", ".iphoneos-64.a", ".iphonesim.a", ".iphonesim-64.a" ][archID]; - PathHelper.mkdir (projectDirectory + "/lib/" + arch); - PathHelper.mkdir (projectDirectory + "/lib/" + arch + "-debug"); + System.mkdir (projectDirectory + "/lib/" + arch); + System.mkdir (projectDirectory + "/lib/" + arch + "-debug"); for (ndll in project.ndlls) { //if (ndll.haxelib != null) { - var releaseLib = PathHelper.getLibraryPath (ndll, "iPhone", "lib", libExt); - var debugLib = PathHelper.getLibraryPath (ndll, "iPhone", "lib", libExt, true); + var releaseLib = NDLL.getLibraryPath (ndll, "iPhone", "lib", libExt); + var debugLib = NDLL.getLibraryPath (ndll, "iPhone", "lib", libExt, true); var releaseDest = projectDirectory + "/lib/" + arch + "/lib" + ndll.name + ".a"; var debugDest = projectDirectory + "/lib/" + arch + "-debug/lib" + ndll.name + ".a"; if (!FileSystem.exists (releaseLib)) { - releaseLib = PathHelper.getLibraryPath (ndll, "iPhone", "lib", ".iphoneos.a"); - debugLib = PathHelper.getLibraryPath (ndll, "iPhone", "lib", ".iphoneos.a", true); + releaseLib = NDLL.getLibraryPath (ndll, "iPhone", "lib", ".iphoneos.a"); + debugLib = NDLL.getLibraryPath (ndll, "iPhone", "lib", ".iphoneos.a", true); } - FileHelper.copyIfNewer (releaseLib, releaseDest); + System.copyIfNewer (releaseLib, releaseDest); if (FileSystem.exists (debugLib) && debugLib != releaseLib) { - FileHelper.copyIfNewer (debugLib, debugDest); + System.copyIfNewer (debugLib, debugDest); } else if (FileSystem.exists (debugDest)) { @@ -689,7 +689,7 @@ class IOSPlatform extends PlatformTarget { } - FileHelper.copyIfNewer (dependency.path, projectDirectory + "/lib/" + arch + "/" + fileName); + System.copyIfNewer (dependency.path, projectDirectory + "/lib/" + arch + "/" + fileName); } @@ -697,36 +697,36 @@ class IOSPlatform extends PlatformTarget { } - PathHelper.mkdir (projectDirectory + "/assets"); + System.mkdir (projectDirectory + "/assets"); for (asset in project.assets) { if (asset.type != AssetType.TEMPLATE) { - var targetPath = PathHelper.combine (projectDirectory + "/assets/", asset.resourceName); + var targetPath = Path.combine (projectDirectory + "/assets/", asset.resourceName); //var sourceAssetPath:String = projectDirectory + "haxe/" + asset.sourcePath; - PathHelper.mkdir (Path.directory (targetPath)); + System.mkdir (Path.directory (targetPath)); AssetHelper.copyAssetIfNewer (asset, targetPath); - //PathHelper.mkdir (Path.directory (sourceAssetPath)); - //FileHelper.linkFile (flatAssetPath, sourceAssetPath, true, true); + //System.mkdir (Path.directory (sourceAssetPath)); + //System.linkFile (flatAssetPath, sourceAssetPath, true, true); } else { - var targetPath = PathHelper.combine (projectDirectory, asset.targetPath); + var targetPath = Path.combine (projectDirectory, asset.targetPath); - PathHelper.mkdir (Path.directory (targetPath)); + System.mkdir (Path.directory (targetPath)); AssetHelper.copyAsset (asset, targetPath, context); } } - if (project.targetFlags.exists ("xcode") && PlatformHelper.hostPlatform == MAC && command == "update") { + if (project.targetFlags.exists ("xcode") && System.hostPlatform == MAC && command == "update") { - ProcessHelper.runCommand ("", "open", [ targetDirectory + "/" + project.app.file + ".xcodeproj" ] ); + System.runCommand ("", "open", [ targetDirectory + "/" + project.app.file + ".xcodeproj" ] ); } @@ -736,7 +736,7 @@ class IOSPlatform extends PlatformTarget { /*private function updateLaunchImage () { var destination = buildDirectory + "/ios"; - PathHelper.mkdir (destination); + System.mkdir (destination); var has_launch_image = false; if (launchImages.length > 0) has_launch_image = true; @@ -745,7 +745,7 @@ class IOSPlatform extends PlatformTarget { var splitPath = launchImage.name.split ("/"); var path = destination + "/" + splitPath[splitPath.length - 1]; - FileHelper.copyFile (launchImage.name, path, context, false); + System.copyFile (launchImage.name, path, context, false); } @@ -756,9 +756,9 @@ class IOSPlatform extends PlatformTarget { public override function watch ():Void { - var dirs = WatchHelper.processHXML (getDisplayHXML (), project.app.path); + var dirs = []; // WatchHelper.processHXML (getDisplayHXML (), project.app.path); var command = ProjectHelper.getCurrentCommand (); - WatchHelper.watch (command, dirs); + System.watch (command, dirs); } diff --git a/tools/platforms/LinuxPlatform.hx b/tools/platforms/LinuxPlatform.hx index f1b487cd5..5a8d8a352 100644 --- a/tools/platforms/LinuxPlatform.hx +++ b/tools/platforms/LinuxPlatform.hx @@ -1,27 +1,28 @@ package; -import haxe.io.Path; +import hxp.Path; +import hxp.NDLL; import haxe.Template; import lime.tools.Architecture; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.DeploymentHelper; -import hxp.FileHelper; +import hxp.System; import hxp.Haxelib; import lime.tools.JavaHelper; import hxp.Log; import lime.tools.NekoHelper; import lime.tools.NodeJSHelper; -import hxp.PathHelper; +import hxp.Path; import lime.tools.Platform; -import hxp.PlatformHelper; +import hxp.System; import lime.tools.PlatformTarget; -import hxp.ProcessHelper; +import hxp.System; import lime.tools.Project; import lime.tools.ProjectHelper; -import hxp.WatchHelper; +import hxp.System; import sys.io.File; import sys.io.Process; import sys.FileSystem; @@ -62,7 +63,7 @@ class LinuxPlatform extends PlatformTarget { } - if (project.targetFlags.exists ("neko") || project.target != cast PlatformHelper.hostPlatform) { + if (project.targetFlags.exists ("neko") || project.target != cast System.hostPlatform) { targetType = "neko"; @@ -84,10 +85,10 @@ class LinuxPlatform extends PlatformTarget { } - targetDirectory = PathHelper.combine (project.app.path, project.config.getString ("linux.output-directory", targetType == "cpp" ? "linux" : targetType)); + targetDirectory = Path.combine (project.app.path, project.config.getString ("linux.output-directory", targetType == "cpp" ? "linux" : targetType)); targetDirectory = StringTools.replace (targetDirectory, "arch64", is64 ? "64" : ""); applicationDirectory = targetDirectory + "/bin/"; - executablePath = PathHelper.combine (applicationDirectory, project.app.file); + executablePath = Path.combine (applicationDirectory, project.app.file); } @@ -96,7 +97,7 @@ class LinuxPlatform extends PlatformTarget { var hxml = targetDirectory + "/haxe/" + buildType + ".hxml"; - PathHelper.mkdir (targetDirectory); + System.mkdir (targetDirectory); if (!project.targetFlags.exists ("static") || targetType != "cpp") { @@ -120,7 +121,7 @@ class LinuxPlatform extends PlatformTarget { if (targetType == "neko") { - ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; @@ -138,24 +139,24 @@ class LinuxPlatform extends PlatformTarget { } else if (targetType == "hl") { - ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; - FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".hl", PathHelper.combine (applicationDirectory, project.app.file + ".hl")); + System.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".hl", Path.combine (applicationDirectory, project.app.file + ".hl")); } else if (targetType == "nodejs") { - ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml ]); //NekoHelper.createExecutable (project.templatePaths, "linux" + (is64 ? "64" : ""), targetDirectory + "/obj/ApplicationMain.n", executablePath); //NekoHelper.copyLibraries (project.templatePaths, "linux" + (is64 ? "64" : ""), applicationDirectory); } else if (targetType == "java") { - var libPath = PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("lime")), "templates/java/lib/"); + var libPath = Path.combine (Haxelib.getPath (new Haxelib ("lime")), "templates/java/lib/"); - ProcessHelper.runCommand ("", "haxe", [ hxml, "-java-lib", libPath + "disruptor.jar", "-java-lib", libPath + "lwjgl.jar" ]); - //ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml, "-java-lib", libPath + "disruptor.jar", "-java-lib", libPath + "lwjgl.jar" ]); + //System.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; @@ -168,9 +169,9 @@ class LinuxPlatform extends PlatformTarget { } - ProcessHelper.runCommand (targetDirectory + "/obj", "haxelib", [ "run", "hxjava", "hxjava_build.txt", "--haxe-version", haxeVersionString ]); - FileHelper.recursiveCopy (targetDirectory + "/obj/lib", PathHelper.combine (applicationDirectory, "lib")); - FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".jar", PathHelper.combine (applicationDirectory, project.app.file + ".jar")); + System.runCommand (targetDirectory + "/obj", "haxelib", [ "run", "hxjava", "hxjava_build.txt", "--haxe-version", haxeVersionString ]); + System.recursiveCopy (targetDirectory + "/obj/lib", Path.combine (applicationDirectory, "lib")); + System.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".jar", Path.combine (applicationDirectory, project.app.file + ".jar")); JavaHelper.copyLibraries (project.templatePaths, "Linux" + (is64 ? "64" : ""), applicationDirectory); } else { @@ -194,32 +195,32 @@ class LinuxPlatform extends PlatformTarget { if (!project.targetFlags.exists ("static")) { - ProcessHelper.runCommand ("", "haxe", haxeArgs); + System.runCommand ("", "haxe", haxeArgs); if (noOutput) return; CPPHelper.compile (project, targetDirectory + "/obj", flags); - FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : ""), executablePath); + System.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : ""), executablePath); } else { - ProcessHelper.runCommand ("", "haxe", haxeArgs.concat ([ "-D", "static_link" ])); + System.runCommand ("", "haxe", haxeArgs.concat ([ "-D", "static_link" ])); if (noOutput) return; CPPHelper.compile (project, targetDirectory + "/obj", flags.concat ([ "-Dstatic_link" ])); CPPHelper.compile (project, targetDirectory + "/obj", flags, "BuildMain.xml"); - FileHelper.copyFile (targetDirectory + "/obj/Main" + (project.debug ? "-debug" : ""), executablePath); + System.copyFile (targetDirectory + "/obj/Main" + (project.debug ? "-debug" : ""), executablePath); } } - if (PlatformHelper.hostPlatform != WINDOWS && (targetType != "nodejs" && targetType != "java")) { + if (System.hostPlatform != WINDOWS && (targetType != "nodejs" && targetType != "java")) { - ProcessHelper.runCommand ("", "chmod", [ "755", executablePath ]); + System.runCommand ("", "chmod", [ "755", executablePath ]); } @@ -230,7 +231,7 @@ class LinuxPlatform extends PlatformTarget { if (FileSystem.exists (targetDirectory)) { - PathHelper.removeDirectory (targetDirectory); + System.removeDirectory (targetDirectory); } @@ -277,7 +278,7 @@ class LinuxPlatform extends PlatformTarget { private function getDisplayHXML ():String { - var hxml = PathHelper.findTemplate (project.templatePaths, targetType + "/hxml/" + buildType + ".hxml"); + var hxml = System.findTemplate (project.templatePaths, targetType + "/hxml/" + buildType + ".hxml"); var template = new Template (File.getContent (hxml)); var context = generateContext (); @@ -298,13 +299,13 @@ class LinuxPlatform extends PlatformTarget { } else { - if (!targetFlags.exists ("32") && PlatformHelper.hostArchitecture == X64) { + if (!targetFlags.exists ("32") && System.hostArchitecture == X64) { commands.push ([ "-Dlinux", "-DHXCPP_M64" ]); } - if (!targetFlags.exists ("64") && (command == "rebuild" || PlatformHelper.hostArchitecture == X86)) { + if (!targetFlags.exists ("64") && (command == "rebuild" || System.hostArchitecture == X86)) { commands.push ([ "-Dlinux", "-DHXCPP_M32" ]); @@ -329,7 +330,7 @@ class LinuxPlatform extends PlatformTarget { if (targetType == "hl") { - ProcessHelper.runCommand (applicationDirectory, "hl", [ project.app.file + ".hl" ].concat (arguments)); + System.runCommand (applicationDirectory, "hl", [ project.app.file + ".hl" ].concat (arguments)); } else if (targetType == "nodejs") { @@ -337,12 +338,12 @@ class LinuxPlatform extends PlatformTarget { } else if (targetType == "java") { - ProcessHelper.runCommand (applicationDirectory, "java", [ "-jar", project.app.file + ".jar" ].concat (arguments)); + System.runCommand (applicationDirectory, "java", [ "-jar", project.app.file + ".jar" ].concat (arguments)); - } else if (project.target == cast PlatformHelper.hostPlatform) { + } else if (project.target == cast System.hostPlatform) { arguments = arguments.concat ([ "-livereload" ]); - ProcessHelper.runCommand (applicationDirectory, "./" + Path.withoutDirectory (executablePath), arguments); + System.runCommand (applicationDirectory, "./" + Path.withoutDirectory (executablePath), arguments); } @@ -360,8 +361,8 @@ class LinuxPlatform extends PlatformTarget { if (asset.embed && asset.sourcePath == "") { - var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath); - PathHelper.mkdir (Path.directory (path)); + var path = Path.combine (targetDirectory + "/obj/tmp", asset.targetPath); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path); asset.sourcePath = path; @@ -388,11 +389,11 @@ class LinuxPlatform extends PlatformTarget { if (isRaspberryPi) { - context.ndlls[i].path = PathHelper.getLibraryPath (ndll, "RPi", "lib", ".a", project.debug); + context.ndlls[i].path = NDLL.getLibraryPath (ndll, "RPi", "lib", ".a", project.debug); } else { - context.ndlls[i].path = PathHelper.getLibraryPath (ndll, "Linux" + (is64 ? "64" : ""), "lib", ".a", project.debug); + context.ndlls[i].path = NDLL.getLibraryPath (ndll, "Linux" + (is64 ? "64" : ""), "lib", ".a", project.debug); } @@ -402,10 +403,10 @@ class LinuxPlatform extends PlatformTarget { } - PathHelper.mkdir (targetDirectory); - PathHelper.mkdir (targetDirectory + "/obj"); - PathHelper.mkdir (targetDirectory + "/haxe"); - PathHelper.mkdir (applicationDirectory); + System.mkdir (targetDirectory); + System.mkdir (targetDirectory + "/obj"); + System.mkdir (targetDirectory + "/haxe"); + System.mkdir (applicationDirectory); //SWFHelper.generateSWFClasses (project, targetDirectory + "/haxe"); @@ -418,21 +419,21 @@ class LinuxPlatform extends PlatformTarget { } - //context.HAS_ICON = IconHelper.createIcon (project.icons, 256, 256, PathHelper.combine (applicationDirectory, "icon.png")); + //context.HAS_ICON = IconHelper.createIcon (project.icons, 256, 256, Path.combine (applicationDirectory, "icon.png")); for (asset in project.assets) { - var path = PathHelper.combine (applicationDirectory, asset.targetPath); + var path = Path.combine (applicationDirectory, asset.targetPath); if (asset.embed != true) { if (asset.type != AssetType.TEMPLATE) { - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); AssetHelper.copyAssetIfNewer (asset, path); } else { - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path, context); } @@ -446,9 +447,9 @@ class LinuxPlatform extends PlatformTarget { public override function watch ():Void { - var dirs = WatchHelper.processHXML (getDisplayHXML (), project.app.path); + var dirs = []; // WatchHelper.processHXML (getDisplayHXML (), project.app.path); var command = ProjectHelper.getCurrentCommand (); - WatchHelper.watch (command, dirs); + System.watch (command, dirs); } diff --git a/tools/platforms/MacPlatform.hx b/tools/platforms/MacPlatform.hx index d1017f6b9..8c87a6976 100644 --- a/tools/platforms/MacPlatform.hx +++ b/tools/platforms/MacPlatform.hx @@ -1,7 +1,8 @@ package; -import haxe.io.Path; +import hxp.Path; +import hxp.NDLL; import haxe.Template; import lime.tools.Architecture; import lime.tools.AssetHelper; @@ -9,24 +10,24 @@ import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.CSHelper; import lime.tools.DeploymentHelper; -import hxp.FileHelper; -import hxp.GUID; +import hxp.System; +import lime.tools.GUID; +import hxp.Haxelib; import hxp.Haxelib; -import hxp.HaxelibHelper; import lime.tools.Icon; import lime.tools.IconHelper; import lime.tools.JavaHelper; import hxp.Log; import lime.tools.NekoHelper; import lime.tools.NodeJSHelper; -import hxp.PathHelper; +import hxp.Path; import lime.tools.Platform; -import hxp.PlatformHelper; +import hxp.System; import lime.tools.PlatformTarget; -import hxp.ProcessHelper; +import hxp.System; import lime.tools.Project; import lime.tools.ProjectHelper; -import hxp.WatchHelper; +import hxp.System; import sys.io.File; import sys.FileSystem; @@ -56,7 +57,7 @@ class MacPlatform extends PlatformTarget { } - if (project.targetFlags.exists ("neko") || project.target != cast PlatformHelper.hostPlatform) { + if (project.targetFlags.exists ("neko") || project.target != cast System.hostPlatform) { targetType = "neko"; @@ -82,7 +83,7 @@ class MacPlatform extends PlatformTarget { } - targetDirectory = PathHelper.combine (project.app.path, project.config.getString ("mac.output-directory", targetType == "cpp" ? "macos" : targetType)); + targetDirectory = Path.combine (project.app.path, project.config.getString ("mac.output-directory", targetType == "cpp" ? "macos" : targetType)); targetDirectory = StringTools.replace (targetDirectory, "arch64", is64 ? "64" : ""); applicationDirectory = targetDirectory + "/bin/" + project.app.file + ".app"; contentDirectory = applicationDirectory + "/Contents/Resources"; @@ -96,7 +97,7 @@ class MacPlatform extends PlatformTarget { var hxml = targetDirectory + "/haxe/" + buildType + ".hxml"; - PathHelper.mkdir (targetDirectory); + System.mkdir (targetDirectory); if (!project.targetFlags.exists ("static") || targetType != "cpp") { @@ -112,7 +113,7 @@ class MacPlatform extends PlatformTarget { if (targetType == "neko") { - ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; @@ -121,28 +122,28 @@ class MacPlatform extends PlatformTarget { } else if (targetType == "hl") { - ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; - FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".hl", PathHelper.combine (executableDirectory, project.app.file + ".hl")); + System.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".hl", Path.combine (executableDirectory, project.app.file + ".hl")); } else if (targetType == "java") { - var libPath = PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("lime")), "templates/java/lib/"); + var libPath = Path.combine (Haxelib.getPath (new Haxelib ("lime")), "templates/java/lib/"); - ProcessHelper.runCommand ("", "haxe", [ hxml, "-java-lib", libPath + "disruptor.jar", "-java-lib", libPath + "lwjgl.jar" ]); + System.runCommand ("", "haxe", [ hxml, "-java-lib", libPath + "disruptor.jar", "-java-lib", libPath + "lwjgl.jar" ]); if (noOutput) return; - HaxelibHelper.runCommand (targetDirectory + "/obj", [ "run", "hxjava", "hxjava_build.txt", "--haxe-version", "3103" ]); - FileHelper.recursiveCopy (targetDirectory + "/obj/lib", PathHelper.combine (executableDirectory, "lib")); - FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".jar", PathHelper.combine (executableDirectory, project.app.file + ".jar")); + Haxelib.runCommand (targetDirectory + "/obj", [ "run", "hxjava", "hxjava_build.txt", "--haxe-version", "3103" ]); + System.recursiveCopy (targetDirectory + "/obj/lib", Path.combine (executableDirectory, "lib")); + System.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".jar", Path.combine (executableDirectory, project.app.file + ".jar")); JavaHelper.copyLibraries (project.templatePaths, "Mac" + (is64 ? "64" : ""), executableDirectory); } else if (targetType == "nodejs") { - ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; @@ -151,7 +152,7 @@ class MacPlatform extends PlatformTarget { } else if (targetType == "cs") { - ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; @@ -160,7 +161,7 @@ class MacPlatform extends PlatformTarget { CSHelper.addSourceFiles (txtPath, CSHelper.ndllSourceFiles); CSHelper.addGUID (txtPath, GUID.uuid ()); CSHelper.compile (project, targetDirectory + "/obj", targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : ""), "x64", "desktop"); - FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : "") + ".exe", executablePath + ".exe"); + System.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : "") + ".exe", executablePath + ".exe"); File.saveContent (executablePath, "#!/bin/sh\nmono ${PWD}/" + project.app.file + ".exe"); } else { @@ -178,32 +179,32 @@ class MacPlatform extends PlatformTarget { if (!project.targetFlags.exists ("static")) { - ProcessHelper.runCommand ("", "haxe", haxeArgs); + System.runCommand ("", "haxe", haxeArgs); if (noOutput) return; CPPHelper.compile (project, targetDirectory + "/obj", flags); - FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : ""), executablePath); + System.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : ""), executablePath); } else { - ProcessHelper.runCommand ("", "haxe", haxeArgs.concat ([ "-D", "static_link" ])); + System.runCommand ("", "haxe", haxeArgs.concat ([ "-D", "static_link" ])); if (noOutput) return; CPPHelper.compile (project, targetDirectory + "/obj", flags.concat ([ "-Dstatic_link" ])); CPPHelper.compile (project, targetDirectory + "/obj", flags, "BuildMain.xml"); - FileHelper.copyFile (targetDirectory + "/obj/Main" + (project.debug ? "-debug" : ""), executablePath); + System.copyFile (targetDirectory + "/obj/Main" + (project.debug ? "-debug" : ""), executablePath); } } - if (PlatformHelper.hostPlatform != WINDOWS && targetType != "nodejs" && targetType != "java") { + if (System.hostPlatform != WINDOWS && targetType != "nodejs" && targetType != "java") { - ProcessHelper.runCommand ("", "chmod", [ "755", executablePath ]); + System.runCommand ("", "chmod", [ "755", executablePath ]); } @@ -214,7 +215,7 @@ class MacPlatform extends PlatformTarget { if (FileSystem.exists (targetDirectory)) { - PathHelper.removeDirectory (targetDirectory); + System.removeDirectory (targetDirectory); } @@ -251,7 +252,7 @@ class MacPlatform extends PlatformTarget { private function getDisplayHXML ():String { - var hxml = PathHelper.findTemplate (project.templatePaths, targetType + "/hxml/" + buildType + ".hxml"); + var hxml = System.findTemplate (project.templatePaths, targetType + "/hxml/" + buildType + ".hxml"); var template = new Template (File.getContent (hxml)); var context = generateContext (); @@ -266,13 +267,13 @@ class MacPlatform extends PlatformTarget { var commands = []; - if (!targetFlags.exists ("32") && (command == "rebuild" || PlatformHelper.hostArchitecture == X64)) { + if (!targetFlags.exists ("32") && (command == "rebuild" || System.hostArchitecture == X64)) { commands.push ([ "-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M64" ]); } - if (!targetFlags.exists ("64") && (command == "rebuild" || PlatformHelper.hostArchitecture == X86)) { + if (!targetFlags.exists ("64") && (command == "rebuild" || System.hostArchitecture == X86)) { commands.push ([ "-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M32" ]); @@ -295,7 +296,7 @@ class MacPlatform extends PlatformTarget { if (targetType == "hl") { - ProcessHelper.runCommand (applicationDirectory, "hl", [ project.app.file + ".hl" ].concat (arguments)); + System.runCommand (applicationDirectory, "hl", [ project.app.file + ".hl" ].concat (arguments)); } else if (targetType == "nodejs") { @@ -303,12 +304,12 @@ class MacPlatform extends PlatformTarget { } else if (targetType == "java") { - ProcessHelper.runCommand (executableDirectory, "java", [ "-jar", project.app.file + ".jar" ].concat (arguments)); + System.runCommand (executableDirectory, "java", [ "-jar", project.app.file + ".jar" ].concat (arguments)); - } else if (project.target == cast PlatformHelper.hostPlatform) { + } else if (project.target == cast System.hostPlatform) { arguments = arguments.concat ([ "-livereload" ]); - ProcessHelper.runCommand (executableDirectory, "./" + Path.withoutDirectory (executablePath), arguments); + System.runCommand (executableDirectory, "./" + Path.withoutDirectory (executablePath), arguments); } @@ -331,8 +332,8 @@ class MacPlatform extends PlatformTarget { if (asset.embed && asset.sourcePath == "") { - var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath); - PathHelper.mkdir (Path.directory (path)); + var path = Path.combine (targetDirectory + "/obj/tmp", asset.targetPath); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path); asset.sourcePath = path; @@ -351,7 +352,7 @@ class MacPlatform extends PlatformTarget { if (ndll.path == null || ndll.path == "") { - context.ndlls[i].path = PathHelper.getLibraryPath (ndll, "Mac" + (is64 ? "64" : ""), "lib", ".a", project.debug); + context.ndlls[i].path = NDLL.getLibraryPath (ndll, "Mac" + (is64 ? "64" : ""), "lib", ".a", project.debug); } @@ -359,11 +360,11 @@ class MacPlatform extends PlatformTarget { } - PathHelper.mkdir (targetDirectory); - PathHelper.mkdir (targetDirectory + "/obj"); - PathHelper.mkdir (targetDirectory + "/haxe"); - PathHelper.mkdir (applicationDirectory); - PathHelper.mkdir (contentDirectory); + System.mkdir (targetDirectory); + System.mkdir (targetDirectory + "/obj"); + System.mkdir (targetDirectory + "/haxe"); + System.mkdir (applicationDirectory); + System.mkdir (contentDirectory); //SWFHelper.generateSWFClasses (project, targetDirectory + "/haxe"); @@ -376,18 +377,18 @@ class MacPlatform extends PlatformTarget { } - FileHelper.copyFileTemplate (project.templatePaths, "mac/Info.plist", targetDirectory + "/bin/" + project.app.file + ".app/Contents/Info.plist", context); - FileHelper.copyFileTemplate (project.templatePaths, "mac/Entitlements.plist", targetDirectory + "/bin/" + project.app.file + ".app/Contents/Entitlements.plist", context); + System.copyFileTemplate (project.templatePaths, "mac/Info.plist", targetDirectory + "/bin/" + project.app.file + ".app/Contents/Info.plist", context); + System.copyFileTemplate (project.templatePaths, "mac/Entitlements.plist", targetDirectory + "/bin/" + project.app.file + ".app/Contents/Entitlements.plist", context); var icons = project.icons; if (icons.length == 0) { - icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ]; + icons = [ new Icon (System.findTemplate (project.templatePaths, "default/icon.svg")) ]; } - context.HAS_ICON = IconHelper.createMacIcon (icons, PathHelper.combine (contentDirectory, "icon.icns")); + context.HAS_ICON = IconHelper.createMacIcon (icons, Path.combine (contentDirectory, "icon.icns")); for (asset in project.assets) { @@ -395,13 +396,13 @@ class MacPlatform extends PlatformTarget { if (asset.type != AssetType.TEMPLATE) { - PathHelper.mkdir (Path.directory (PathHelper.combine (contentDirectory, asset.targetPath))); - AssetHelper.copyAssetIfNewer (asset, PathHelper.combine (contentDirectory, asset.targetPath)); + System.mkdir (Path.directory (Path.combine (contentDirectory, asset.targetPath))); + AssetHelper.copyAssetIfNewer (asset, Path.combine (contentDirectory, asset.targetPath)); } else { - PathHelper.mkdir (Path.directory (PathHelper.combine (targetDirectory, asset.targetPath))); - AssetHelper.copyAsset (asset, PathHelper.combine (targetDirectory, asset.targetPath), context); + System.mkdir (Path.directory (Path.combine (targetDirectory, asset.targetPath))); + AssetHelper.copyAsset (asset, Path.combine (targetDirectory, asset.targetPath), context); } @@ -414,9 +415,9 @@ class MacPlatform extends PlatformTarget { public override function watch ():Void { - var dirs = WatchHelper.processHXML (getDisplayHXML (), project.app.path); + var dirs = []; // WatchHelper.processHXML (getDisplayHXML (), project.app.path); var command = ProjectHelper.getCurrentCommand (); - WatchHelper.watch (command, dirs); + System.watch (command, dirs); } diff --git a/tools/platforms/TVOSPlatform.hx b/tools/platforms/TVOSPlatform.hx index 52184674f..57051069e 100644 --- a/tools/platforms/TVOSPlatform.hx +++ b/tools/platforms/TVOSPlatform.hx @@ -2,33 +2,33 @@ package; //import openfl.display.BitmapData; -import haxe.io.Path; +import hxp.Path; import haxe.Json; import haxe.Template; import lime.tools.Architecture; -import hxp.ArrayHelper; +import hxp.ArrayTools; import lime.tools.Asset; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.DeploymentHelper; -import hxp.FileHelper; +import hxp.System; import hxp.Haxelib; import lime.tools.Icon; import lime.tools.IconHelper; import lime.tools.Keystore; import hxp.Log; import hxp.NDLL; -import hxp.PathHelper; +import hxp.Path; import lime.tools.Platform; -import hxp.PlatformHelper; +import hxp.System; import lime.tools.PlatformTarget; -import hxp.ProcessHelper; +import hxp.System; import lime.tools.Project; import lime.tools.ProjectHelper; -import hxp.StringHelper; +import hxp.StringTools; import lime.tools.TVOSHelper; -import hxp.WatchHelper; +import hxp.System; #if lime import lime.graphics.Image; #end @@ -43,16 +43,16 @@ class TVOSPlatform extends PlatformTarget { super (command, _project, targetFlags); - targetDirectory = PathHelper.combine (project.app.path, project.config.getString ("tvos.output-directory", "tvos")); + targetDirectory = Path.combine (project.app.path, project.config.getString ("tvos.output-directory", "tvos")); } public override function build ():Void { - if (project.targetFlags.exists ("xcode") && PlatformHelper.hostPlatform == MAC) { + if (project.targetFlags.exists ("xcode") && System.hostPlatform == MAC) { - ProcessHelper.runCommand ("", "open", [ targetDirectory + "/" + project.app.file + ".xcodeproj" ] ); + System.runCommand ("", "open", [ targetDirectory + "/" + project.app.file + ".xcodeproj" ] ); } else { @@ -75,7 +75,7 @@ class TVOSPlatform extends PlatformTarget { if (FileSystem.exists (targetDirectory)) { - PathHelper.removeDirectory (targetDirectory); + System.removeDirectory (targetDirectory); } @@ -101,7 +101,7 @@ class TVOSPlatform extends PlatformTarget { // project = project.clone (); project.sources.unshift (""); - project.sources = PathHelper.relocatePaths (project.sources, PathHelper.combine (targetDirectory, project.app.file + "/haxe")); + project.sources = Path.relocatePaths (project.sources, Path.combine (targetDirectory, project.app.file + "/haxe")); //project.dependencies.push ("stdc++"); if (project.targetFlags.exists ("xml")) { @@ -173,7 +173,7 @@ class TVOSPlatform extends PlatformTarget { if (project.config.getFloat ("ios.deployment", 5.1) < 5) { - ArrayHelper.addUnique (architectures, Architecture.ARMV6); + ArrayTools.addUnique (architectures, Architecture.ARMV6); } @@ -215,7 +215,7 @@ class TVOSPlatform extends PlatformTarget { context.IOS_COMPILER = project.config.getString ("tvos.compiler", "clang"); context.CPP_BUILD_LIBRARY = project.config.getString ("cpp.buildLibrary", "hxcpp"); - var json = Json.parse (File.getContent (PathHelper.getHaxelib (new Haxelib ("hxcpp"), true) + "/haxelib.json")); + var json = Json.parse (File.getContent (Haxelib.getPath (new Haxelib ("hxcpp"), true) + "/haxelib.json")); var version = Std.string (json.version); var versionSplit = version.split ("."); @@ -278,17 +278,17 @@ class TVOSPlatform extends PlatformTarget { } else if (Path.extension (dependency.path) == "framework") { name = Path.withoutDirectory (dependency.path); - path = PathHelper.tryFullPath (dependency.path); + path = Path.tryFullPath (dependency.path); fileType = "wrapper.framework"; } if (name != null) { - var frameworkID = "11C0000000000018" + StringHelper.getUniqueID (); - var fileID = "11C0000000000018" + StringHelper.getUniqueID (); + var frameworkID = "11C0000000000018" + StringTools.getUniqueID (); + var fileID = "11C0000000000018" + StringTools.getUniqueID (); - ArrayHelper.addUnique (context.frameworkSearchPaths, Path.directory (path)); + ArrayTools.addUnique (context.frameworkSearchPaths, Path.directory (path)); context.ADDL_PBX_BUILD_FILE += " " + frameworkID + " /* " + name + " in Frameworks */ = {isa = PBXBuildFile; fileRef = " + fileID + " /* " + name + " */; };\n"; context.ADDL_PBX_FILE_REFERENCE += " " + fileID + " /* " + name + " */ = {isa = PBXFileReference; lastKnownFileType = \"" + fileType + "\"; name = \"" + name + "\"; path = \"" + path + "\"; sourceTree = SDKROOT; };\n"; @@ -299,7 +299,7 @@ class TVOSPlatform extends PlatformTarget { } - context.HXML_PATH = PathHelper.findTemplate (project.templatePaths, "tvos/PROJ/haxe/Build.hxml"); + context.HXML_PATH = System.findTemplate (project.templatePaths, "tvos/PROJ/haxe/Build.hxml"); context.PRERENDERED_ICON = project.config.getBool ("tvos.prerenderedIcon", false); var haxelibPath = project.environment.get ("HAXELIB_PATH"); @@ -321,7 +321,7 @@ class TVOSPlatform extends PlatformTarget { private function getDisplayHXML ():String { - var hxml = PathHelper.findTemplate (project.templatePaths, "tvos/PROJ/haxe/Build.hxml"); + var hxml = System.findTemplate (project.templatePaths, "tvos/PROJ/haxe/Build.hxml"); var template = new Template (File.getContent (hxml)); var context = generateContext (); @@ -368,8 +368,8 @@ class TVOSPlatform extends PlatformTarget { if (asset.embed && asset.sourcePath == "") { - var path = PathHelper.combine (targetDirectory + "/" + project.app.file + "/obj/tmp", asset.targetPath); - PathHelper.mkdir (Path.directory (path)); + var path = Path.combine (targetDirectory + "/" + project.app.file + "/obj/tmp", asset.targetPath); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path); asset.sourcePath = path; @@ -389,10 +389,10 @@ class TVOSPlatform extends PlatformTarget { var projectDirectory = targetDirectory + "/" + project.app.file + "/"; - PathHelper.mkdir (targetDirectory); - PathHelper.mkdir (projectDirectory); - PathHelper.mkdir (projectDirectory + "/haxe"); - PathHelper.mkdir (projectDirectory + "/haxe/lime/installer"); + System.mkdir (targetDirectory); + System.mkdir (projectDirectory); + System.mkdir (projectDirectory + "/haxe"); + System.mkdir (projectDirectory + "/haxe/lime/installer"); var iconSizes:Array = [ { name : "Icon-Small.png", size : 29 }, @@ -413,20 +413,20 @@ class TVOSPlatform extends PlatformTarget { context.HAS_ICON = true; - var iconPath = PathHelper.combine (projectDirectory, "Images.xcassets/AppIcon.appiconset"); - PathHelper.mkdir (iconPath); + var iconPath = Path.combine (projectDirectory, "Images.xcassets/AppIcon.appiconset"); + System.mkdir (iconPath); var icons = project.icons; if (icons.length == 0) { - icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ]; + icons = [ new Icon (System.findTemplate (project.templatePaths, "default/icon.svg")) ]; } for (iconSize in iconSizes) { - if (!IconHelper.createIcon (icons, iconSize.size, iconSize.size, PathHelper.combine (iconPath, iconSize.name))) { + if (!IconHelper.createIcon (icons, iconSize.size, iconSize.size, Path.combine (iconPath, iconSize.name))) { context.HAS_ICON = false; @@ -447,8 +447,8 @@ class TVOSPlatform extends PlatformTarget { { name: "Default-736h-Landscape@3x.png", w: 2208, h: 1242 }, // iPhone 6 Plus, landscape ]; - var splashScreenPath = PathHelper.combine (projectDirectory, "Images.xcassets/LaunchImage.launchimage"); - PathHelper.mkdir (splashScreenPath); + var splashScreenPath = Path.combine (projectDirectory, "Images.xcassets/LaunchImage.launchimage"); + System.mkdir (splashScreenPath); for (size in splashSizes) { @@ -458,7 +458,7 @@ class TVOSPlatform extends PlatformTarget { if (splashScreen.width == size.w && splashScreen.height == size.h && Path.extension (splashScreen.path) == "png") { - FileHelper.copyFile (splashScreen.path, PathHelper.combine (splashScreenPath, size.name)); + System.copyFile (splashScreen.path, Path.combine (splashScreenPath, size.name)); match = true; } @@ -467,7 +467,7 @@ class TVOSPlatform extends PlatformTarget { if (!match) { - var imagePath = PathHelper.combine (splashScreenPath, size.name); + var imagePath = Path.combine (splashScreenPath, size.name); if (!FileSystem.exists (imagePath)) { @@ -488,22 +488,22 @@ class TVOSPlatform extends PlatformTarget { context.HAS_LAUNCH_IMAGE = true; - PathHelper.mkdir (projectDirectory + "/resources"); - PathHelper.mkdir (projectDirectory + "/haxe/build"); + System.mkdir (projectDirectory + "/resources"); + System.mkdir (projectDirectory + "/haxe/build"); ProjectHelper.recursiveSmartCopyTemplate (project, "tvos/resources", projectDirectory + "/resources", context, true, false); ProjectHelper.recursiveSmartCopyTemplate (project, "tvos/PROJ/haxe", projectDirectory + "/haxe", context); ProjectHelper.recursiveSmartCopyTemplate (project, "haxe", projectDirectory + "/haxe", context); ProjectHelper.recursiveSmartCopyTemplate (project, "tvos/PROJ/Classes", projectDirectory + "/Classes", context); ProjectHelper.recursiveSmartCopyTemplate (project, "tvos/PROJ/Images.xcassets", projectDirectory + "/Images.xcassets", context); - FileHelper.copyFileTemplate (project.templatePaths, "tvos/PROJ/PROJ-Entitlements.plist", projectDirectory + "/" + project.app.file + "-Entitlements.plist", context); - FileHelper.copyFileTemplate (project.templatePaths, "tvos/PROJ/PROJ-Info.plist", projectDirectory + "/" + project.app.file + "-Info.plist", context); - FileHelper.copyFileTemplate (project.templatePaths, "tvos/PROJ/PROJ-Prefix.pch", projectDirectory + "/" + project.app.file + "-Prefix.pch", context); + System.copyFileTemplate (project.templatePaths, "tvos/PROJ/PROJ-Entitlements.plist", projectDirectory + "/" + project.app.file + "-Entitlements.plist", context); + System.copyFileTemplate (project.templatePaths, "tvos/PROJ/PROJ-Info.plist", projectDirectory + "/" + project.app.file + "-Info.plist", context); + System.copyFileTemplate (project.templatePaths, "tvos/PROJ/PROJ-Prefix.pch", projectDirectory + "/" + project.app.file + "-Prefix.pch", context); ProjectHelper.recursiveSmartCopyTemplate (project, "tvos/PROJ.xcodeproj", targetDirectory + "/" + project.app.file + ".xcodeproj", context); //SWFHelper.generateSWFClasses (project, projectDirectory + "/haxe"); - PathHelper.mkdir (projectDirectory + "/lib"); + System.mkdir (projectDirectory + "/lib"); for (archID in 0...3) { @@ -514,33 +514,33 @@ class TVOSPlatform extends PlatformTarget { var libExt = [ ".appletvos-64.a", ".appletvsim.a", ".appletvsim-64.a" ][archID]; - PathHelper.mkdir (projectDirectory + "/lib/" + arch); - PathHelper.mkdir (projectDirectory + "/lib/" + arch + "-debug"); + System.mkdir (projectDirectory + "/lib/" + arch); + System.mkdir (projectDirectory + "/lib/" + arch + "-debug"); for (ndll in project.ndlls) { //if (ndll.haxelib != null) { - var releaseLib = PathHelper.getLibraryPath (ndll, "AppleTV", "lib", libExt); + var releaseLib = NDLL.getLibraryPath (ndll, "AppleTV", "lib", libExt); Log.info("releaseLib: " + releaseLib); - var debugLib = PathHelper.getLibraryPath (ndll, "AppleTV", "lib", libExt, true); + var debugLib = NDLL.getLibraryPath (ndll, "AppleTV", "lib", libExt, true); var releaseDest = projectDirectory + "/lib/" + arch + "/lib" + ndll.name + ".a"; Log.info("releaseDest: " + releaseDest); var debugDest = projectDirectory + "/lib/" + arch + "-debug/lib" + ndll.name + ".a"; if (!FileSystem.exists (releaseLib)) { - releaseLib = PathHelper.getLibraryPath (ndll, "AppleTV", "lib", ".appletvos-64.a"); + releaseLib = NDLL.getLibraryPath (ndll, "AppleTV", "lib", ".appletvos-64.a"); Log.info("alternative releaseLib: " + releaseLib); - debugLib = PathHelper.getLibraryPath (ndll, "AppleTV", "lib", ".appletvos-64.a", true); + debugLib = NDLL.getLibraryPath (ndll, "AppleTV", "lib", ".appletvos-64.a", true); } - FileHelper.copyIfNewer (releaseLib, releaseDest); + System.copyIfNewer (releaseLib, releaseDest); if (FileSystem.exists (debugLib) && debugLib != releaseLib) { - FileHelper.copyIfNewer (debugLib, debugDest); + System.copyIfNewer (debugLib, debugDest); } else if (FileSystem.exists (debugDest)) { @@ -564,7 +564,7 @@ class TVOSPlatform extends PlatformTarget { } - FileHelper.copyIfNewer (dependency.path, projectDirectory + "/lib/" + arch + "/" + fileName); + System.copyIfNewer (dependency.path, projectDirectory + "/lib/" + arch + "/" + fileName); } @@ -572,36 +572,36 @@ class TVOSPlatform extends PlatformTarget { } - PathHelper.mkdir (projectDirectory + "/assets"); + System.mkdir (projectDirectory + "/assets"); for (asset in project.assets) { if (asset.type != AssetType.TEMPLATE) { - var targetPath = PathHelper.combine (projectDirectory + "/assets/", asset.resourceName); + var targetPath = Path.combine (projectDirectory + "/assets/", asset.resourceName); //var sourceAssetPath:String = projectDirectory + "haxe/" + asset.sourcePath; - PathHelper.mkdir (Path.directory (targetPath)); + System.mkdir (Path.directory (targetPath)); AssetHelper.copyAssetIfNewer (asset, targetPath); - //PathHelper.mkdir (Path.directory (sourceAssetPath)); - //FileHelper.linkFile (flatAssetPath, sourceAssetPath, true, true); + //System.mkdir (Path.directory (sourceAssetPath)); + //System.linkFile (flatAssetPath, sourceAssetPath, true, true); } else { - var targetPath = PathHelper.combine (projectDirectory, asset.targetPath); + var targetPath = Path.combine (projectDirectory, asset.targetPath); - PathHelper.mkdir (Path.directory (targetPath)); + System.mkdir (Path.directory (targetPath)); AssetHelper.copyAsset (asset, targetPath, context); } } - if (project.targetFlags.exists ("xcode") && PlatformHelper.hostPlatform == MAC && command == "update") { + if (project.targetFlags.exists ("xcode") && System.hostPlatform == MAC && command == "update") { - ProcessHelper.runCommand ("", "open", [ targetDirectory + "/" + project.app.file + ".xcodeproj" ] ); + System.runCommand ("", "open", [ targetDirectory + "/" + project.app.file + ".xcodeproj" ] ); } @@ -611,7 +611,7 @@ class TVOSPlatform extends PlatformTarget { /*private function updateLaunchImage () { var destination = buildDirectory + "/ios"; - PathHelper.mkdir (destination); + System.mkdir (destination); var has_launch_image = false; if (launchImages.length > 0) has_launch_image = true; @@ -620,7 +620,7 @@ class TVOSPlatform extends PlatformTarget { var splitPath = launchImage.name.split ("/"); var path = destination + "/" + splitPath[splitPath.length - 1]; - FileHelper.copyFile (launchImage.name, path, context, false); + System.copyFile (launchImage.name, path, context, false); } @@ -631,9 +631,9 @@ class TVOSPlatform extends PlatformTarget { public override function watch ():Void { - var dirs = WatchHelper.processHXML (getDisplayHXML (), project.app.path); + var dirs = []; // WatchHelper.processHXML (getDisplayHXML (), project.app.path); var command = ProjectHelper.getCurrentCommand (); - WatchHelper.watch (command, dirs); + System.watch (command, dirs); } diff --git a/tools/platforms/TizenPlatform.hx b/tools/platforms/TizenPlatform.hx index 1d9c208ed..08fd321d4 100644 --- a/tools/platforms/TizenPlatform.hx +++ b/tools/platforms/TizenPlatform.hx @@ -1,18 +1,18 @@ package; -import haxe.io.Path; +import hxp.Path; import haxe.Template; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.DeploymentHelper; -import hxp.FileHelper; +import hxp.System; import lime.tools.Icon; import lime.tools.IconHelper; -import hxp.PathHelper; +import hxp.Path; import lime.tools.PlatformTarget; -import hxp.ProcessHelper; +import hxp.System; import lime.tools.Project; import lime.tools.ProjectHelper; import hxp.TizenHelper; @@ -30,7 +30,7 @@ class TizenPlatform extends PlatformTarget { super (command, _project, targetFlags); - targetDirectory = PathHelper.combine (project.app.path, project.config.getString ("tizen.output-directory", "tizen")); + targetDirectory = Path.combine (project.app.path, project.config.getString ("tizen.output-directory", "tizen")); } @@ -55,7 +55,7 @@ class TizenPlatform extends PlatformTarget { var hxml = targetDirectory + "/haxe/" + buildType + ".hxml"; - ProcessHelper.runCommand ("", "haxe", [ hxml, "-D", "tizen" ] ); + System.runCommand ("", "haxe", [ hxml, "-D", "tizen" ] ); if (noOutput) return; @@ -68,7 +68,7 @@ class TizenPlatform extends PlatformTarget { } CPPHelper.compile (project, targetDirectory + "/obj", args); - FileHelper.copyIfNewer (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : "") + ".exe", targetDirectory + "/bin/CommandLineBuild/" + project.app.file + ".exe"); + System.copyIfNewer (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : "") + ".exe", targetDirectory + "/bin/CommandLineBuild/" + project.app.file + ".exe"); TizenHelper.createPackage (project, targetDirectory + "/bin/CommandLineBuild", ""); } @@ -78,7 +78,7 @@ class TizenPlatform extends PlatformTarget { if (FileSystem.exists (targetDirectory)) { - PathHelper.removeDirectory (targetDirectory); + System.removeDirectory (targetDirectory); } @@ -94,7 +94,7 @@ class TizenPlatform extends PlatformTarget { public override function display ():Void { - var hxml = PathHelper.findTemplate (project.templatePaths, "tizen/hxml/" + buildType + ".hxml"); + var hxml = System.findTemplate (project.templatePaths, "tizen/hxml/" + buildType + ".hxml"); var context = project.templateContext; context.CPP_DIR = targetDirectory + "/obj"; @@ -148,8 +148,8 @@ class TizenPlatform extends PlatformTarget { if (asset.embed && asset.sourcePath == "") { - var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath); - PathHelper.mkdir (Path.directory (path)); + var path = Path.combine (targetDirectory + "/obj/tmp", asset.targetPath); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path); asset.sourcePath = path; @@ -158,7 +158,7 @@ class TizenPlatform extends PlatformTarget { } var destination = targetDirectory + "/bin/"; - PathHelper.mkdir (destination); + System.mkdir (destination); for (asset in project.assets) { @@ -178,17 +178,17 @@ class TizenPlatform extends PlatformTarget { context.APP_PACKAGE = TizenHelper.getUUID (project); context.SIMULATOR = project.targetFlags.exists ("simulator"); - PathHelper.mkdir (destination + "shared/res/screen-density-xhigh"); + System.mkdir (destination + "shared/res/screen-density-xhigh"); var icons = project.icons; if (icons.length == 0) { - icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ]; + icons = [ new Icon (System.findTemplate (project.templatePaths, "default/icon.svg")) ]; } - if (IconHelper.createIcon (icons, 117, 117, PathHelper.combine (destination + "shared/res/screen-density-xhigh", "mainmenu.png"))) { + if (IconHelper.createIcon (icons, 117, 117, Path.combine (destination + "shared/res/screen-density-xhigh", "mainmenu.png"))) { context.APP_ICON = "mainmenu.png"; @@ -200,9 +200,9 @@ class TizenPlatform extends PlatformTarget { for (asset in project.assets) { - var path = PathHelper.combine (destination + "res/", asset.targetPath); + var path = Path.combine (destination + "res/", asset.targetPath); - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); if (asset.type != AssetType.TEMPLATE) { diff --git a/tools/platforms/WindowsPlatform.hx b/tools/platforms/WindowsPlatform.hx index 0b8a83a98..830fbb7fe 100644 --- a/tools/platforms/WindowsPlatform.hx +++ b/tools/platforms/WindowsPlatform.hx @@ -1,7 +1,8 @@ package; -import haxe.io.Path; +import hxp.Path; +import hxp.NDLL; import haxe.Template; import lime.tools.Architecture; import lime.tools.Asset; @@ -10,8 +11,8 @@ import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.CSHelper; import lime.tools.DeploymentHelper; -import hxp.FileHelper; -import hxp.GUID; +import hxp.System; +import lime.tools.GUID; import hxp.Haxelib; import lime.tools.HTML5Helper; import lime.tools.Icon; @@ -21,14 +22,14 @@ import hxp.Log; import lime.tools.ModuleHelper; import lime.tools.NekoHelper; import lime.tools.NodeJSHelper; -import hxp.PathHelper; +import hxp.Path; import lime.tools.Platform; -import hxp.PlatformHelper; +import hxp.System; import lime.tools.PlatformTarget; -import hxp.ProcessHelper; +import hxp.System; import lime.tools.Project; import lime.tools.ProjectHelper; -import hxp.WatchHelper; +import hxp.System; import sys.io.File; import sys.FileSystem; @@ -51,7 +52,7 @@ class WindowsPlatform extends PlatformTarget { targetType = "winjs"; - } else if (project.targetFlags.exists ("neko") || project.target != cast PlatformHelper.hostPlatform) { + } else if (project.targetFlags.exists ("neko") || project.target != cast System.hostPlatform) { targetType = "neko"; @@ -87,7 +88,7 @@ class WindowsPlatform extends PlatformTarget { } - targetDirectory = PathHelper.combine (project.app.path, project.config.getString ("windows.output-directory", targetType == "cpp" ? "windows" : targetType)); + targetDirectory = Path.combine (project.app.path, project.config.getString ("windows.output-directory", targetType == "cpp" ? "windows" : targetType)); targetDirectory = StringTools.replace (targetDirectory, "arch64", is64 ? "64" : ""); if (targetType == "winjs") { @@ -108,13 +109,13 @@ class WindowsPlatform extends PlatformTarget { var hxml = targetDirectory + "/haxe/" + buildType + ".hxml"; - PathHelper.mkdir (targetDirectory); + System.mkdir (targetDirectory); var icons = project.icons; if (icons.length == 0) { - icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ]; + icons = [ new Icon (System.findTemplate (project.templatePaths, "default/icon.svg")) ]; } @@ -124,17 +125,17 @@ class WindowsPlatform extends PlatformTarget { if (project.app.main != null) { - ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml ]); var msBuildPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\MSBuild.exe"; - var args = [ PathHelper.tryFullPath (targetDirectory + "/source/" + project.app.file + ".jsproj"), "/p:Configuration=Release" ]; + var args = [ Path.tryFullPath (targetDirectory + "/source/" + project.app.file + ".jsproj"), "/p:Configuration=Release" ]; - ProcessHelper.runCommand ("", msBuildPath, args); + System.runCommand ("", msBuildPath, args); if (noOutput) return; if (project.targetFlags.exists ("webgl")) { - FileHelper.copyFile (targetDirectory + "/source/ApplicationMain.js", outputFile); + System.copyFile (targetDirectory + "/source/ApplicationMain.js", outputFile); } @@ -159,7 +160,7 @@ class WindowsPlatform extends PlatformTarget { if (StringTools.endsWith (dependency.path, ".dll")) { var fileName = Path.withoutDirectory (dependency.path); - FileHelper.copyIfNewer (dependency.path, applicationDirectory + "/" + fileName); + System.copyIfNewer (dependency.path, applicationDirectory + "/" + fileName); } @@ -177,15 +178,15 @@ class WindowsPlatform extends PlatformTarget { } - //IconHelper.createIcon (project.icons, 32, 32, PathHelper.combine (applicationDirectory, "icon.png")); + //IconHelper.createIcon (project.icons, 32, 32, Path.combine (applicationDirectory, "icon.png")); if (targetType == "neko") { - ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; - var iconPath = PathHelper.combine (applicationDirectory, "icon.ico"); + var iconPath = Path.combine (applicationDirectory, "icon.ico"); if (!IconHelper.createWindowsIcon (icons, iconPath)) { @@ -198,15 +199,15 @@ class WindowsPlatform extends PlatformTarget { } else if (targetType == "hl") { - ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; - FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain.hl", PathHelper.combine (applicationDirectory, project.app.file + ".hl")); + System.copyFile (targetDirectory + "/obj/ApplicationMain.hl", Path.combine (applicationDirectory, project.app.file + ".hl")); } else if (targetType == "nodejs") { - ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; @@ -215,7 +216,7 @@ class WindowsPlatform extends PlatformTarget { } else if (targetType == "cs") { - ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; @@ -227,10 +228,10 @@ class WindowsPlatform extends PlatformTarget { } else if (targetType == "java") { - var libPath = PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("lime")), "templates/java/lib/"); + var libPath = Path.combine (Haxelib.getPath (new Haxelib ("lime")), "templates/java/lib/"); - ProcessHelper.runCommand ("", "haxe", [ hxml, "-java-lib", libPath + "disruptor.jar", "-java-lib", libPath + "lwjgl.jar" ]); - //ProcessHelper.runCommand ("", "haxe", [ hxml ]); + System.runCommand ("", "haxe", [ hxml, "-java-lib", libPath + "disruptor.jar", "-java-lib", libPath + "lwjgl.jar" ]); + //System.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; @@ -243,9 +244,9 @@ class WindowsPlatform extends PlatformTarget { } - ProcessHelper.runCommand (targetDirectory + "/obj", "haxelib", [ "run", "hxjava", "hxjava_build.txt", "--haxe-version", haxeVersionString ]); - FileHelper.recursiveCopy (targetDirectory + "/obj/lib", PathHelper.combine (applicationDirectory, "lib")); - FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".jar", PathHelper.combine (applicationDirectory, project.app.file + ".jar")); + System.runCommand (targetDirectory + "/obj", "haxelib", [ "run", "hxjava", "hxjava_build.txt", "--haxe-version", haxeVersionString ]); + System.recursiveCopy (targetDirectory + "/obj/lib", Path.combine (applicationDirectory, "lib")); + System.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".jar", Path.combine (applicationDirectory, project.app.file + ".jar")); JavaHelper.copyLibraries (project.templatePaths, "Windows" + (is64 ? "64" : ""), applicationDirectory); } else { @@ -275,33 +276,33 @@ class WindowsPlatform extends PlatformTarget { if (!project.targetFlags.exists ("static")) { - ProcessHelper.runCommand ("", "haxe", haxeArgs); + System.runCommand ("", "haxe", haxeArgs); if (noOutput) return; CPPHelper.compile (project, targetDirectory + "/obj", flags); - FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : "") + ".exe", executablePath); + System.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : "") + ".exe", executablePath); } else { - ProcessHelper.runCommand ("", "haxe", haxeArgs.concat ([ "-D", "static_link" ])); + System.runCommand ("", "haxe", haxeArgs.concat ([ "-D", "static_link" ])); if (noOutput) return; CPPHelper.compile (project, targetDirectory + "/obj", flags.concat ([ "-Dstatic_link" ])); CPPHelper.compile (project, targetDirectory + "/obj", flags, "BuildMain.xml"); - FileHelper.copyFile (targetDirectory + "/obj/Main" + (project.debug ? "-debug" : "") + ".exe", executablePath); + System.copyFile (targetDirectory + "/obj/Main" + (project.debug ? "-debug" : "") + ".exe", executablePath); } - var iconPath = PathHelper.combine (applicationDirectory, "icon.ico"); + var iconPath = Path.combine (applicationDirectory, "icon.ico"); - if (IconHelper.createWindowsIcon (icons, iconPath) && PlatformHelper.hostPlatform == WINDOWS) { + if (IconHelper.createWindowsIcon (icons, iconPath) && System.hostPlatform == WINDOWS) { - var templates = [ PathHelper.getHaxelib (new Haxelib (#if lime "lime" #else "hxp" #end)) + "/templates" ].concat (project.templatePaths); - ProcessHelper.runCommand ("", PathHelper.findTemplate (templates, "bin/ReplaceVistaIcon.exe"), [ executablePath, iconPath, "1" ], true, true); + var templates = [ Haxelib.getPath (new Haxelib (#if lime "lime" #else "hxp" #end)) + "/templates" ].concat (project.templatePaths); + System.runCommand ("", System.findTemplate (templates, "bin/ReplaceVistaIcon.exe"), [ executablePath, iconPath, "1" ], true, true); } @@ -316,7 +317,7 @@ class WindowsPlatform extends PlatformTarget { if (FileSystem.exists (targetDirectory)) { - PathHelper.removeDirectory (targetDirectory); + System.removeDirectory (targetDirectory); } @@ -381,7 +382,7 @@ class WindowsPlatform extends PlatformTarget { private function getDisplayHXML ():String { - var hxml = PathHelper.findTemplate (project.templatePaths, targetType + "/hxml/" + buildType + ".hxml"); + var hxml = System.findTemplate (project.templatePaths, targetType + "/hxml/" + buildType + ".hxml"); var template = new Template (File.getContent (hxml)); var context = generateContext (); @@ -405,7 +406,7 @@ class WindowsPlatform extends PlatformTarget { var commands = []; - if (!targetFlags.exists ("32") && PlatformHelper.hostArchitecture == X64) { + if (!targetFlags.exists ("32") && System.hostArchitecture == X64) { if (targetFlags.exists ("winrt")) { @@ -419,7 +420,7 @@ class WindowsPlatform extends PlatformTarget { } - if (!targetFlags.exists ("64") && (command == "rebuild" || PlatformHelper.hostArchitecture == X86)) { + if (!targetFlags.exists ("64") && (command == "rebuild" || System.hostArchitecture == X86)) { if (targetFlags.exists ("winrt")) { @@ -452,7 +453,7 @@ class WindowsPlatform extends PlatformTarget { if (targetType == "hl") { - ProcessHelper.runCommand (applicationDirectory, "hl", [ project.app.file + ".hl" ].concat (arguments)); + System.runCommand (applicationDirectory, "hl", [ project.app.file + ".hl" ].concat (arguments)); } else if (targetType == "nodejs") { @@ -513,11 +514,11 @@ class WindowsPlatform extends PlatformTarget { */ // Using option B because obtaining the device pin programatically does not seem possible. - //ProcessHelper.runCommand ("", "regedit", [ '/s', '"' + targetDirectory + '/bin/PowerShell_Set_Unrestricted.reg"' ]); + //System.runCommand ("", "regedit", [ '/s', '"' + targetDirectory + '/bin/PowerShell_Set_Unrestricted.reg"' ]); //var test = '"& ""' + targetDirectory + '/bin/PowerShell_Set_Unrestricted.reg"""'; //Sys.command ('powershell & ""' + targetDirectory + '/bin/source/AppPackages/' + project.app.file + '_1.0.0.0_AnyCPU_Test/Add-AppDevPackage.ps1""'); var version = project.meta.version + "." + project.meta.buildNumber; - ProcessHelper.openFile (targetDirectory + "/source/AppPackages/" + project.app.file + "_" + version + "_AnyCPU_Test", project.app.file + "_" + version + "_AnyCPU.appx"); + System.openFile (targetDirectory + "/source/AppPackages/" + project.app.file + "_" + version + "_AnyCPU_Test", project.app.file + "_" + version + "_AnyCPU.appx"); //source/AppPackages/uwp-project_1.0.0.0_AnyCPU_Test/Add-AppDevPackage.ps1 @@ -525,12 +526,12 @@ class WindowsPlatform extends PlatformTarget { } else if (targetType == "java") { - ProcessHelper.runCommand (applicationDirectory, "java", [ "-jar", project.app.file + ".jar" ].concat (arguments)); + System.runCommand (applicationDirectory, "java", [ "-jar", project.app.file + ".jar" ].concat (arguments)); - } else if (project.target == cast PlatformHelper.hostPlatform) { + } else if (project.target == cast System.hostPlatform) { arguments = arguments.concat ([ "-livereload" ]); - ProcessHelper.runCommand (applicationDirectory, Path.withoutDirectory (executablePath), arguments); + System.runCommand (applicationDirectory, Path.withoutDirectory (executablePath), arguments); } @@ -560,8 +561,8 @@ class WindowsPlatform extends PlatformTarget { if (asset.embed && asset.sourcePath == "") { - var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath); - PathHelper.mkdir (Path.directory (path)); + var path = Path.combine (targetDirectory + "/obj/tmp", asset.targetPath); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path); asset.sourcePath = path; @@ -575,7 +576,7 @@ class WindowsPlatform extends PlatformTarget { if (targetType == "cpp" && project.targetFlags.exists ("static")) { var programFiles = project.environment.get ("ProgramFiles(x86)"); - var hasVSCommunity = (programFiles != null && FileSystem.exists (PathHelper.combine (programFiles, "Microsoft Visual Studio/Installer/vswhere.exe"))); + var hasVSCommunity = (programFiles != null && FileSystem.exists (Path.combine (programFiles, "Microsoft Visual Studio/Installer/vswhere.exe"))); var hxcppMSVC = project.environment.get ("HXCPP_MSVC"); var vs140 = project.environment.get ("VS140COMNTOOLS"); @@ -595,7 +596,7 @@ class WindowsPlatform extends PlatformTarget { if (ndll.path == null || ndll.path == "") { - context.ndlls[i].path = PathHelper.getLibraryPath (ndll, "Windows" + (is64 ? "64" : ""), "lib", suffix, project.debug); + context.ndlls[i].path = NDLL.getLibraryPath (ndll, "Windows" + (is64 ? "64" : ""), "lib", suffix, project.debug); } @@ -603,10 +604,10 @@ class WindowsPlatform extends PlatformTarget { } - PathHelper.mkdir (targetDirectory); - PathHelper.mkdir (targetDirectory + "/obj"); - PathHelper.mkdir (targetDirectory + "/haxe"); - PathHelper.mkdir (applicationDirectory); + System.mkdir (targetDirectory); + System.mkdir (targetDirectory + "/obj"); + System.mkdir (targetDirectory + "/haxe"); + System.mkdir (applicationDirectory); //SWFHelper.generateSWFClasses (project, targetDirectory + "/haxe"); @@ -619,7 +620,7 @@ class WindowsPlatform extends PlatformTarget { } - /*if (IconHelper.createIcon (project.icons, 32, 32, PathHelper.combine (applicationDirectory, "icon.png"))) { + /*if (IconHelper.createIcon (project.icons, 32, 32, Path.combine (applicationDirectory, "icon.png"))) { context.HAS_ICON = true; context.WIN_ICON = "icon.png"; @@ -630,16 +631,16 @@ class WindowsPlatform extends PlatformTarget { if (asset.embed != true) { - var path = PathHelper.combine (applicationDirectory, asset.targetPath); + var path = Path.combine (applicationDirectory, asset.targetPath); if (asset.type != AssetType.TEMPLATE) { - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); AssetHelper.copyAssetIfNewer (asset, path); } else { - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path, context); } @@ -656,7 +657,7 @@ class WindowsPlatform extends PlatformTarget { project = project.clone (); var destination = targetDirectory + "/source/"; - PathHelper.mkdir (destination); + System.mkdir (destination); var webfontDirectory = targetDirectory + "/obj/webfont"; var useWebfonts = true; @@ -679,12 +680,12 @@ class WindowsPlatform extends PlatformTarget { if (useWebfonts) { - fontPath = PathHelper.combine (webfontDirectory, Path.withoutDirectory (asset.targetPath)); + fontPath = Path.combine (webfontDirectory, Path.withoutDirectory (asset.targetPath)); if (!FileSystem.exists (fontPath)) { - PathHelper.mkdir (webfontDirectory); - FileHelper.copyFile (asset.sourcePath, fontPath); + System.mkdir (webfontDirectory); + System.copyFile (asset.sourcePath, fontPath); asset.sourcePath = fontPath; @@ -748,17 +749,17 @@ class WindowsPlatform extends PlatformTarget { if (icons.length == 0) { - icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ]; + icons = [ new Icon (System.findTemplate (project.templatePaths, "default/icon.svg")) ]; } - //if (IconHelper.createWindowsIcon (icons, PathHelper.combine (destination, "favicon.ico"))) { + //if (IconHelper.createWindowsIcon (icons, Path.combine (destination, "favicon.ico"))) { // //context.favicons.push ({ rel: "icon", type: "image/x-icon", href: "./favicon.ico" }); // //} - if (IconHelper.createIcon (icons, 192, 192, PathHelper.combine (destination, "favicon.png"))) { + if (IconHelper.createIcon (icons, 192, 192, Path.combine (destination, "favicon.png"))) { context.favicons.push ({ rel: "shortcut icon", type: "image/png", href: "./favicon.png" }); @@ -777,7 +778,7 @@ class WindowsPlatform extends PlatformTarget { var name = Path.withoutDirectory (dependency.path); context.linkedLibraries.push ("./js/lib/" + name); - FileHelper.copyIfNewer (dependency.path, PathHelper.combine (destination, PathHelper.combine ("js/lib", name))); + System.copyIfNewer (dependency.path, Path.combine (destination, Path.combine ("js/lib", name))); } @@ -785,18 +786,18 @@ class WindowsPlatform extends PlatformTarget { for (asset in project.assets) { - var path = PathHelper.combine (destination, asset.targetPath); + var path = Path.combine (destination, asset.targetPath); if (asset.type != AssetType.TEMPLATE) { if (asset.type != AssetType.FONT) { - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); AssetHelper.copyAssetIfNewer (asset, path); } else if (useWebfonts) { - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); var ext = "." + Path.extension (asset.sourcePath); var source = Path.withoutExtension (asset.sourcePath); @@ -804,7 +805,7 @@ class WindowsPlatform extends PlatformTarget { if (FileSystem.exists (source + extension)) { - FileHelper.copyIfNewer (source + extension, path + extension); + System.copyIfNewer (source + extension, path + extension); } else { @@ -858,11 +859,11 @@ class WindowsPlatform extends PlatformTarget { for (asset in project.assets) { - var path = PathHelper.combine (destination, asset.targetPath); + var path = Path.combine (destination, asset.targetPath); if (asset.type == AssetType.TEMPLATE) { - PathHelper.mkdir (Path.directory (path)); + System.mkdir (Path.directory (path)); AssetHelper.copyAsset (asset, path, context); } @@ -874,9 +875,9 @@ class WindowsPlatform extends PlatformTarget { public override function watch ():Void { - var dirs = WatchHelper.processHXML (getDisplayHXML (), project.app.path); + var dirs = []; // WatchHelper.processHXML (getDisplayHXML (), project.app.path); var command = ProjectHelper.getCurrentCommand (); - WatchHelper.watch (command, dirs); + System.watch (command, dirs); } diff --git a/tools/utils/CreateTemplate.hx b/tools/utils/CreateTemplate.hx index 5fcd58198..e379b6d86 100644 --- a/tools/utils/CreateTemplate.hx +++ b/tools/utils/CreateTemplate.hx @@ -1,11 +1,11 @@ package utils; -import hxp.FileHelper; +import hxp.System; +import hxp.Haxelib; import hxp.Haxelib; -import hxp.HaxelibHelper; import hxp.Log; -import hxp.PathHelper; +import hxp.Path; import lime.tools.Project; import lime.tools.ProjectHelper; import sys.FileSystem; @@ -43,8 +43,8 @@ class CreateTemplate { context.META_VERSION = "::META_VERSION::"; context.ANDROID_GRADLE_PLUGIN = "::ANDROID_GRADLE_PLUGIN::"; - PathHelper.mkdir (title); - FileHelper.recursiveCopyTemplate ([ HaxelibHelper.getPath (new Haxelib ("lime"), true) + "/templates" ], "extension", title, context); + System.mkdir (title); + System.recursiveCopyTemplate ([ Haxelib.getPath (new Haxelib ("lime"), true) + "/templates" ], "extension", title, context); if (FileSystem.exists (title + "/Extension.hx")) { @@ -72,12 +72,12 @@ class CreateTemplate { if (FileSystem.exists (title)) { - PathHelper.mkdir (title + "/ndll"); - PathHelper.mkdir (title + "/ndll/Linux"); - PathHelper.mkdir (title + "/ndll/Linux64"); - PathHelper.mkdir (title + "/ndll/Mac"); - PathHelper.mkdir (title + "/ndll/Mac64"); - PathHelper.mkdir (title + "/ndll/Windows"); + System.mkdir (title + "/ndll"); + System.mkdir (title + "/ndll/Linux"); + System.mkdir (title + "/ndll/Linux64"); + System.mkdir (title + "/ndll/Mac"); + System.mkdir (title + "/ndll/Mac64"); + System.mkdir (title + "/ndll/Windows"); } @@ -266,7 +266,7 @@ class CreateTemplate { if (words.length > 1) { - folder = PathHelper.tryFullPath (words[1]); + folder = Path.tryFullPath (words[1]); } @@ -274,7 +274,7 @@ class CreateTemplate { if (words.length > 2) { - folder = PathHelper.tryFullPath (words[2]); + folder = Path.tryFullPath (words[2]); } @@ -282,11 +282,11 @@ class CreateTemplate { /*if (words.length > 2) { - folder = PathHelper.tryFullPath (words[2]); + folder = Path.tryFullPath (words[2]); }*/ - PathHelper.mkdir (folder); + System.mkdir (folder); ProjectHelper.recursiveSmartCopyTemplate (project, "project", folder, context); try { @@ -387,12 +387,12 @@ class CreateTemplate { for (samplePath in samplePaths) { - var sourcePath = PathHelper.combine (samplePath, sampleName); + var sourcePath = Path.combine (samplePath, sampleName); if (FileSystem.exists (sourcePath)) { - PathHelper.mkdir (outputPath); - FileHelper.recursiveCopy (sourcePath, PathHelper.tryFullPath (outputPath)); + System.mkdir (outputPath); + System.recursiveCopy (sourcePath, Path.tryFullPath (outputPath)); return; } @@ -426,7 +426,7 @@ class CreateTemplate { for (samplePath in samplePaths) { - var path = PathHelper.tryFullPath (samplePath); + var path = Path.tryFullPath (samplePath); if (!FileSystem.exists (path)) continue; for (name in FileSystem.readDirectory (path)) { @@ -445,7 +445,7 @@ class CreateTemplate { /*templates.push ("extension"); - var projectTemplate = PathHelper.findTemplate (project.templatePaths, "project", false); + var projectTemplate = System.findTemplate (project.templatePaths, "project", false); if (projectTemplate != null) { diff --git a/tools/utils/JavaExternGenerator.hx b/tools/utils/JavaExternGenerator.hx index 7453fa088..a0f686e9b 100644 --- a/tools/utils/JavaExternGenerator.hx +++ b/tools/utils/JavaExternGenerator.hx @@ -5,11 +5,11 @@ import haxe.crypto.BaseCode; import haxe.io.Bytes; import haxe.io.Input; import haxe.io.Output; -import haxe.io.Path; +import hxp.Path; import haxe.zip.Reader; #if (hxp > "1.0.0") -import hxp.PathHelper; -import hxp.ProcessHelper; +import hxp.Path; +import hxp.System; import lime.tools.Project; #else import hxp.helpers.PathHelper; @@ -78,8 +78,8 @@ class JavaExternGenerator if (Path.extension (javaPath) == "jar") { this.javaPath = path + "/"; - PathHelper.mkdir (path); - ProcessHelper.runCommand (path, "jar", [ "-xvf", FileSystem.fullPath (javaPath) ], false); + System.mkdir (path); + System.runCommand (path, "jar", [ "-xvf", FileSystem.fullPath (javaPath) ], false); getPaths(path, "", paths); } else { @@ -149,9 +149,9 @@ class JavaExternGenerator if (FileSystem.exists(androidJAR)) { - PathHelper.mkdir (path); + System.mkdir (path); extractedAndroidPaths.push (path); - ProcessHelper.runCommand (path, "jar", [ "-xvf", androidJAR ], false); + System.runCommand (path, "jar", [ "-xvf", androidJAR ], false); } } @@ -179,12 +179,12 @@ class JavaExternGenerator var dir_parts = parts.slice(0,parts.length-1); var outputBase = externPath; var dir = outputBase; - PathHelper.mkdir(dir); + System.mkdir(dir); for(d in dir_parts) { dir += "/" + d; - PathHelper.mkdir(dir); + System.mkdir(dir); } var filename = javaPath + inClass + ".class"; @@ -525,12 +525,12 @@ class JavaExternGenerator var dir = "stubs"; var parts = mCurrentType.split("."); var dir_parts = parts.slice(0, parts.length - 1); - PathHelper.mkdir(dir); + System.mkdir(dir); for(d in dir_parts) { dir += "/" + d; - PathHelper.mkdir(dir); + System.mkdir(dir); } var interface_name = parts[parts.length - 1]; @@ -771,16 +771,16 @@ class JavaExternGenerator java_out.writeString("}\n"); java_out.close(); - PathHelper.mkdir("compiled"); + System.mkdir("compiled"); var nme_path = getHaxelib("openfl") + "/__backends/native/templates/android/template/src"; - ProcessHelper.runCommand ("", "javac", [ "-classpath", "\"classes/android.jar\";\"" + javaPath.substr (0, javaPath.length -1) + "\"", "-sourcepath", nme_path, "-d", "compiled", "stubs/" + java_name ], true, true, true); + System.runCommand ("", "javac", [ "-classpath", "\"classes/android.jar\";\"" + javaPath.substr (0, javaPath.length -1) + "\"", "-sourcepath", nme_path, "-d", "compiled", "stubs/" + java_name ], true, true, true); //Sys.setCwd("compiled"); var class_name = java_name.substr(0, java_name.length - 4) + "class"; var dx = Sys.getEnv("ANDROID_SDK") + "/platforms/" + extractedAndroidPaths[0] + "/tools/dx"; - ProcessHelper.runCommand ("compiled", dx, [ "--dex", "--output=classes.jar", class_name ], true, true, true); + System.runCommand ("compiled", dx, [ "--dex", "--output=classes.jar", class_name ], true, true, true); if (FileSystem.exists ("classes.jar")) { diff --git a/tools/utils/PlatformSetup.hx b/tools/utils/PlatformSetup.hx index fa3650d86..bd8d89b60 100644 --- a/tools/utils/PlatformSetup.hx +++ b/tools/utils/PlatformSetup.hx @@ -3,19 +3,19 @@ package utils; import haxe.Http; import haxe.io.Eof; -import haxe.io.Path; +import hxp.Path; import haxe.zip.Reader; #if (hxp > "1.0.0") import lime.tools.CLIHelper; import lime.tools.ConfigHelper; -import hxp.FileHelper; +import hxp.System; +import hxp.Haxelib; import hxp.Haxelib; -import hxp.HaxelibHelper; import hxp.Log; -import hxp.PathHelper; +import hxp.Path; import lime.tools.Platform; -import hxp.PlatformHelper; -import hxp.ProcessHelper; +import hxp.System; +import hxp.System; import lime.tools.Project; import hxp.Version; #else @@ -63,12 +63,12 @@ class PlatformSetup { if (path == "") { - PathHelper.mkdir (defaultPath); + System.mkdir (defaultPath); return defaultPath; } else { - PathHelper.mkdir (path); + System.mkdir (path); return path; } @@ -168,13 +168,13 @@ class PlatformSetup { } - ProcessHelper.runCommand ("", "tar", [ arguments, sourceZIP ], false); - ProcessHelper.runCommand ("", "cp", [ "-R", ignoreRootFolder + "/.", targetPath ], false); + System.runCommand ("", "tar", [ arguments, sourceZIP ], false); + System.runCommand ("", "cp", [ "-R", ignoreRootFolder + "/.", targetPath ], false); Sys.command ("rm", [ "-r", ignoreRootFolder ]); } else { - ProcessHelper.runCommand ("", "tar", [ arguments, sourceZIP, "-C", targetPath ], false); + System.runCommand ("", "tar", [ arguments, sourceZIP, "-C", targetPath ], false); //InstallTool.runCommand (targetPath, "tar", [ arguments, FileSystem.fullPath (sourceZIP) ]); @@ -210,7 +210,7 @@ class PlatformSetup { for (d in dirs) { path += d; - PathHelper.mkdir (targetPath + "/" + path); + System.mkdir (targetPath + "/" + path); path += "/"; } @@ -380,7 +380,7 @@ class PlatformSetup { if (version != null && version.indexOf ("*") > -1) { var regexp = new EReg ("^.+[0-9]+-[0-9]+-[0-9]+ +[0-9]+:[0-9]+:[0-9]+ +([a-z0-9.-]+) +", "gi"); - var output = HaxelibHelper.runProcess ("", [ "info", haxelib.name ]); + var output = Haxelib.runProcess ("", [ "info", haxelib.name ]); var lines = output.split ("\n"); var versions = new Array (); @@ -401,7 +401,7 @@ class PlatformSetup { } - var match = HaxelibHelper.findMatch (haxelib, versions); + var match = Haxelib.findMatch (haxelib, versions); if (match != null) { @@ -423,7 +423,7 @@ class PlatformSetup { } - HaxelibHelper.runCommand ("", args); + Haxelib.runCommand ("", args); } @@ -438,17 +438,17 @@ class PlatformSetup { private static function openURL (url:String):Void { - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { Sys.command ("explorer", [ url ]); - } else if (PlatformHelper.hostPlatform == LINUX) { + } else if (System.hostPlatform == LINUX) { - ProcessHelper.runCommand ("", "xdg-open", [ url ], false); + System.runCommand ("", "xdg-open", [ url ], false); } else { - ProcessHelper.runCommand ("", "open", [ url ], false); + System.runCommand ("", "open", [ url ], false); } @@ -464,7 +464,7 @@ class PlatformSetup { if (target == "cpp") { - switch (PlatformHelper.hostPlatform) { + switch (System.hostPlatform) { case WINDOWS: target = "windows"; case MAC: target = "mac"; @@ -500,7 +500,7 @@ class PlatformSetup { case "ios", "iphoneos", "iphonesim": - if (PlatformHelper.hostPlatform == MAC) { + if (System.hostPlatform == MAC) { setupIOS (); @@ -508,7 +508,7 @@ class PlatformSetup { case "linux": - if (PlatformHelper.hostPlatform == LINUX) { + if (System.hostPlatform == LINUX) { setupLinux (); @@ -516,7 +516,7 @@ class PlatformSetup { case "mac", "macos": - if (PlatformHelper.hostPlatform == MAC) { + if (System.hostPlatform == MAC) { setupMac (); @@ -536,7 +536,7 @@ class PlatformSetup { case "windows", "winrt": - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { setupWindows (); @@ -556,7 +556,7 @@ class PlatformSetup { case "tvos", "tvsim": - if (PlatformHelper.hostPlatform == MAC) { + if (System.hostPlatform == MAC) { setupIOS (); @@ -589,21 +589,21 @@ class PlatformSetup { private static function runInstaller (path:String, message:String = "Waiting for process to complete..."):Void { - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { try { Log.println (message); - ProcessHelper.runCommand ("", "call", [ path ], false); + System.runCommand ("", "call", [ path ], false); Log.println ("Done"); } catch (e:Dynamic) {} - } else if (PlatformHelper.hostPlatform == LINUX) { + } else if (System.hostPlatform == LINUX) { if (Path.extension (path) == "deb") { - ProcessHelper.runCommand ("", "sudo", [ "dpkg", "-i", "--force-architecture", path ], false); + System.runCommand ("", "sudo", [ "dpkg", "-i", "--force-architecture", path ], false); } else { @@ -612,11 +612,11 @@ class PlatformSetup { if (path.substr (0, 1) == "/") { - ProcessHelper.runCommand ("", path, [], false); + System.runCommand ("", path, [], false); } else { - ProcessHelper.runCommand ("", "./" + path, [], false); + System.runCommand ("", "./" + path, [], false); } @@ -630,7 +630,7 @@ class PlatformSetup { Log.println (message); Sys.command ("chmod", [ "755", path ]); - ProcessHelper.runCommand ("", path, [], false); + System.runCommand ("", path, [], false); Log.println ("Done"); } else if (Path.extension (path) == "dmg") { @@ -695,7 +695,7 @@ class PlatformSetup { if (file != "") { Log.println (message); - ProcessHelper.runCommand ("", "open", [ "-W", volumePath + "/" + file ], false); + System.runCommand ("", "open", [ "-W", volumePath + "/" + file ], false); Log.println ("Done"); } @@ -712,19 +712,19 @@ class PlatformSetup { if (file == "") { - ProcessHelper.runCommand ("", "open", [ path ], false); + System.runCommand ("", "open", [ path ], false); } } else { - ProcessHelper.runCommand ("", "open", [ path ], false); + System.runCommand ("", "open", [ path ], false); } } else { - ProcessHelper.runCommand ("", "open", [ path ], false); + System.runCommand ("", "open", [ path ], false); } @@ -759,7 +759,7 @@ class PlatformSetup { getDefineValue ("ANDROID_SDK", "Path to Android SDK"); getDefineValue ("ANDROID_NDK_ROOT", "Path to Android NDK"); - if (PlatformHelper.hostPlatform != MAC) { + if (System.hostPlatform != MAC) { getDefineValue ("JAVA_HOME", "Path to Java JDK"); @@ -786,7 +786,7 @@ class PlatformSetup { getDefineValue ("ELECTRON_PATH", "Path to Electron runtime"); Log.println (""); - HaxelibHelper.runCommand ("", [ "install", "electron" ], true, true); + Haxelib.runCommand ("", [ "install", "electron" ], true, true); Log.println (""); Log.println ("Setup complete."); @@ -815,14 +815,14 @@ class PlatformSetup { var defines = new Map (); defines.set ("setup", 1); - var basePath = HaxelibHelper.runProcess ("", [ "config" ]); + var basePath = Haxelib.runProcess ("", [ "config" ]); if (basePath != null) { basePath = StringTools.trim (basePath.split ("\n")[0]); } - var lib = HaxelibHelper.getPath (haxelib, false, true); - if (lib != null && !StringTools.startsWith (PathHelper.standardize (lib), PathHelper.standardize (basePath))) { + var lib = Haxelib.getPath (haxelib, false, true); + if (lib != null && !StringTools.startsWith (Path.standardize (lib), Path.standardize (basePath))) { defines.set ("dev", 1); @@ -836,7 +836,7 @@ class PlatformSetup { if (setupHaxelibs.exists (lib.name)) continue; - var path = HaxelibHelper.getPath (lib, false, true); + var path = Haxelib.getPath (lib, false, true); if (path == null || path == "" || (lib.version != null && lib.version != "")) { @@ -879,7 +879,7 @@ class PlatformSetup { // var downloadPath = ""; // var defaultInstallPath = ""; - // if (PlatformHelper.hostPlatform == WINDOWS) { + // if (System.hostPlatform == WINDOWS) { // defaultInstallPath = "C:\\Development\\Apache Cordova"; @@ -939,9 +939,9 @@ class PlatformSetup { // } - // if (PlatformHelper.hostPlatform != WINDOWS) { + // if (System.hostPlatform != WINDOWS) { - // ProcessHelper.runCommand ("", "chmod", [ "-R", "777", path ], false); + // System.runCommand ("", "chmod", [ "-R", "777", path ], false); // } @@ -975,12 +975,12 @@ class PlatformSetup { // /*Sys.println (""); // Sys.println ("Setting Apache Cordova install path..."); - // ProcessHelper.runCommand (defines.get ("CORDOVA_PATH") + "/lib/ios", "make", [ "install" ], true, true); + // System.runCommand (defines.get ("CORDOVA_PATH") + "/lib/ios", "make", [ "install" ], true, true); // Sys.println ("Done.");*/ // writeConfig (defines.get ("LIME_CONFIG"), defines); - // HaxelibHelper.runCommand ("", [ "install", "cordova" ], true, true); + // Haxelib.runCommand ("", [ "install", "cordova" ], true, true); } @@ -997,7 +997,7 @@ class PlatformSetup { if (answer == YES || answer == ALWAYS) { - ProcessHelper.openURL (appleXcodeURL); + System.openURL (appleXcodeURL); } @@ -1014,7 +1014,7 @@ class PlatformSetup { var haxePath = Sys.getEnv ("HAXEPATH"); - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { if (haxePath == null || haxePath == "") { @@ -1022,8 +1022,8 @@ class PlatformSetup { } - 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 (Haxelib.getPath (new Haxelib ("lime")) + "\\templates\\\\bin\\lime.exe", haxePath + "\\lime.exe"); } catch (e:Dynamic) {} + try { File.copy (Haxelib.getPath (new Haxelib ("lime")) + "\\templates\\\\bin\\lime.sh", haxePath + "\\lime"); } catch (e:Dynamic) {} } else { @@ -1050,8 +1050,8 @@ class PlatformSetup { try { - 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); + System.runCommand ("", "sudo", [ "cp", "-f", Haxelib.getPath (new Haxelib ("lime")) + "/templates/bin/lime.sh", "/usr/local/bin/lime" ], false); + System.runCommand ("", "sudo", [ "chmod", "755", "/usr/local/bin/lime" ], false); installedCommand = true; } catch (e:Dynamic) {} @@ -1066,7 +1066,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 (HaxelibHelper.getPath (new Haxelib ("lime")), "templates/bin/lime.sh") + "\" /usr/local/bin/lime"); + Sys.println ("sudo cp \"" + Path.combine (Haxelib.getPath (new Haxelib ("lime")), "templates/bin/lime.sh") + "\" /usr/local/bin/lime"); Sys.println ("sudo chmod 755 /usr/local/bin/lime"); Sys.println (""); @@ -1074,7 +1074,7 @@ class PlatformSetup { } - if (PlatformHelper.hostPlatform == MAC) { + if (System.hostPlatform == MAC) { ConfigHelper.writeConfigValue ("MAC_USE_CURRENT_SDK", "1"); @@ -1085,21 +1085,21 @@ class PlatformSetup { public static function setupLinux ():Void { - var whichAptGet = ProcessHelper.runProcess ("", "which", ["apt-get"], true, true, true); + var whichAptGet = System.runProcess ("", "which", ["apt-get"], true, true, true); var hasApt = whichAptGet != null && whichAptGet != ""; if (hasApt) { // check if this is ubuntu saucy 64bit, which uses different packages. - var lsbId = ProcessHelper.runProcess ("", "lsb_release", ["-si"], true, true, true); - var lsbRelease = ProcessHelper.runProcess ("", "lsb_release", ["-sr"], true, true, true); - var arch = ProcessHelper.runProcess ("", "uname", ["-m"], true, true, true); + var lsbId = System.runProcess ("", "lsb_release", ["-si"], true, true, true); + var lsbRelease = System.runProcess ("", "lsb_release", ["-sr"], true, true, true); + var arch = System.runProcess ("", "uname", ["-m"], true, true, true); var isSaucy = lsbId == "Ubuntu\n" && lsbRelease >= "13.10\n" && arch == "x86_64\n"; var packages = isSaucy ? linuxUbuntuSaucyPackages : linuxAptPackages; var parameters = [ "apt-get", "install" ].concat (packages.split (" ")); - ProcessHelper.runCommand ("", "sudo", parameters, false); + System.runCommand ("", "sudo", parameters, false); Log.println (""); Log.println ("Setup complete."); @@ -1107,13 +1107,13 @@ class PlatformSetup { } - var whichYum = ProcessHelper.runProcess ("", "which", ["yum"], true, true, true); + var whichYum = System.runProcess ("", "which", ["yum"], true, true, true); var hasYum = whichYum != null && whichYum != ""; if (hasYum) { var parameters = [ "yum", "install" ].concat (linuxYumPackages.split (" ")); - ProcessHelper.runCommand ("", "sudo", parameters, false); + System.runCommand ("", "sudo", parameters, false); Log.println (""); Log.println ("Setup complete."); @@ -1121,13 +1121,13 @@ class PlatformSetup { } - var whichDnf = ProcessHelper.runProcess ("", "which", ["dnf"], true, true, true); + var whichDnf = System.runProcess ("", "which", ["dnf"], true, true, true); var hasDnf = whichDnf != null && whichDnf != ""; if (hasDnf) { var parameters = [ "dnf", "install" ].concat (linuxDnfPackages.split (" ")); - ProcessHelper.runCommand ("", "sudo", parameters, false); + System.runCommand ("", "sudo", parameters, false); Log.println (""); Log.println ("Setup complete."); @@ -1135,14 +1135,14 @@ class PlatformSetup { } - var whichEquo = ProcessHelper.runProcess ("", "which", ["equo"], true,true, true); + var whichEquo = System.runProcess ("", "which", ["equo"], true,true, true); var hasEquo = whichEquo != null && whichEquo != ""; if (hasEquo) { // Sabayon docs recommend not using sudo with equo, and instead using a root login shell var parameters = [ "-l", "-c", "equo", "i", "-av" ].concat (linuxEquoPackages.split (" ")); - ProcessHelper.runCommand ("", "su", parameters, false); + System.runCommand ("", "su", parameters, false); Log.println (""); Log.println ("Setup complete."); @@ -1150,13 +1150,13 @@ class PlatformSetup { } - var whichEmerge = ProcessHelper.runProcess ("", "which", ["emerge"], true,true, true); + var whichEmerge = System.runProcess ("", "which", ["emerge"], true,true, true); var hasEmerge = whichEmerge != null && whichEmerge != ""; if (hasEmerge) { var parameters = [ "emerge", "-av" ].concat (linuxEmergePackages.split (" ")); - ProcessHelper.runCommand ("", "sudo", parameters, false); + System.runCommand ("", "sudo", parameters, false); Log.println (""); Log.println ("Setup complete."); @@ -1164,14 +1164,14 @@ class PlatformSetup { } - var whichPacman = ProcessHelper.runProcess ("", "which", ["pacman"], true, true, true); + var whichPacman = System.runProcess ("", "which", ["pacman"], true, true, true); var hasPacman = whichPacman != null && whichPacman != ""; if (hasPacman) { var parameters = [ "pacman", "-S", "--needed" ]; - if (PlatformHelper.hostArchitecture == X64) { + if (System.hostArchitecture == X64) { parameters = parameters.concat (linuxPacman64Packages.split (" ")); @@ -1181,7 +1181,7 @@ class PlatformSetup { } - ProcessHelper.runCommand ("", "sudo", parameters, false); + System.runCommand ("", "sudo", parameters, false); Log.println (""); Log.println ("Setup complete."); @@ -1209,7 +1209,7 @@ class PlatformSetup { if (answer == YES || answer == ALWAYS) { - ProcessHelper.openURL (appleXcodeURL); + System.openURL (appleXcodeURL); } @@ -1233,7 +1233,7 @@ class PlatformSetup { } catch (e:Dynamic) {} - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { if (haxePath == null || haxePath == "") { @@ -1241,13 +1241,13 @@ class PlatformSetup { } - 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 (Haxelib.getPath (new Haxelib ("lime")) + "\\templates\\\\bin\\lime.exe", haxePath + "\\lime.exe"); } catch (e:Dynamic) {} + try { File.copy (Haxelib.getPath (new Haxelib ("lime")) + "\\templates\\\\bin\\lime.sh", haxePath + "\\lime"); } catch (e:Dynamic) {} try { - FileHelper.copyFileTemplate (project.templatePaths, "bin/openfl.exe", haxePath + "\\openfl.exe"); - FileHelper.copyFileTemplate (project.templatePaths, "bin/openfl.sh", haxePath + "\\openfl"); + System.copyFileTemplate (project.templatePaths, "bin/openfl.exe", haxePath + "\\openfl.exe"); + System.copyFileTemplate (project.templatePaths, "bin/openfl.sh", haxePath + "\\openfl"); } catch (e:Dynamic) {} @@ -1276,10 +1276,10 @@ class PlatformSetup { try { - 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.findTemplate (project.templatePaths, "bin/openfl.sh"), "/usr/local/bin/openfl" ], false); - ProcessHelper.runCommand ("", "sudo", [ "chmod", "755", "/usr/local/bin/openfl" ], false); + System.runCommand ("", "sudo", [ "cp", "-f", Haxelib.getPath (new Haxelib ("lime")) + "/templates/bin/lime.sh", "/usr/local/bin/lime" ], false); + System.runCommand ("", "sudo", [ "chmod", "755", "/usr/local/bin/lime" ], false); + System.runCommand ("", "sudo", [ "cp", "-f", System.findTemplate (project.templatePaths, "bin/openfl.sh"), "/usr/local/bin/openfl" ], false); + System.runCommand ("", "sudo", [ "chmod", "755", "/usr/local/bin/openfl" ], false); installedCommand = true; } catch (e:Dynamic) {} @@ -1294,9 +1294,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 (HaxelibHelper.getPath (new Haxelib ("lime")), "templates/bin/lime.sh") + "\" /usr/local/bin/lime"); + Sys.println ("sudo cp \"" + Path.combine (Haxelib.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.findTemplate (project.templatePaths, "bin/openfl.sh") + "\" /usr/local/bin/openfl"); + Sys.println ("sudo cp \"" + System.findTemplate (project.templatePaths, "bin/openfl.sh") + "\" /usr/local/bin/openfl"); Sys.println ("sudo chmod 755 /usr/local/bin/openfl"); Sys.println (""); @@ -1304,7 +1304,7 @@ class PlatformSetup { } - if (PlatformHelper.hostPlatform == MAC) { + if (System.hostPlatform == MAC) { ConfigHelper.writeConfigValue ("MAC_USE_CURRENT_SDK", "1"); @@ -1327,7 +1327,7 @@ class PlatformSetup { if (answer == YES || answer == ALWAYS) { - ProcessHelper.openURL (visualStudioURL); + System.openURL (visualStudioURL); } @@ -1336,7 +1336,7 @@ class PlatformSetup { private static function throwPermissionsError () { - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { Log.println ("Unable to access directory. Perhaps you need to run \"setup\" with administrative privileges?"); @@ -1361,7 +1361,7 @@ class PlatformSetup { path = StringTools.replace (path, "\\ ", " "); - if (PlatformHelper.hostPlatform != WINDOWS && StringTools.startsWith (path, "~/")) { + if (System.hostPlatform != WINDOWS && StringTools.startsWith (path, "~/")) { path = Sys.getEnv ("HOME") + "/" + path.substr (2); @@ -1374,7 +1374,7 @@ class PlatformSetup { public static function updateHaxelib (haxelib:Haxelib):Void { - var basePath = HaxelibHelper.runProcess ("", [ "config" ]); + var basePath = Haxelib.runProcess ("", [ "config" ]); if (basePath != null) { @@ -1382,21 +1382,21 @@ class PlatformSetup { } - var lib = HaxelibHelper.getPath (haxelib, false, true); + var lib = Haxelib.getPath (haxelib, false, true); - if (StringTools.startsWith (PathHelper.standardize (lib), PathHelper.standardize (basePath))) { + if (StringTools.startsWith (Path.standardize (lib), Path.standardize (basePath))) { - HaxelibHelper.runCommand ("", [ "update", haxelib.name ]); + Haxelib.runCommand ("", [ "update", haxelib.name ]); } else { - var git = PathHelper.combine (lib, ".git"); + var git = Path.combine (lib, ".git"); if (FileSystem.exists (git)) { Log.info (Log.accentColor + "Updating \"" + haxelib.name + "\"" + Log.resetColor); - if (PlatformHelper.hostPlatform == WINDOWS) { + if (System.hostPlatform == WINDOWS) { var path = Sys.getEnv ("PATH"); @@ -1408,9 +1408,9 @@ class PlatformSetup { } - ProcessHelper.runCommand (lib, "git", [ "pull" ]); - ProcessHelper.runCommand (lib, "git", [ "submodule", "init" ]); - ProcessHelper.runCommand (lib, "git", [ "submodule", "update" ]); + System.runCommand (lib, "git", [ "pull" ]); + System.runCommand (lib, "git", [ "submodule", "init" ]); + System.runCommand (lib, "git", [ "submodule", "update" ]); } diff --git a/tools/utils/publish/FirefoxMarketplace.hx b/tools/utils/publish/FirefoxMarketplace.hx index cc58c2f3c..908e564c7 100644 --- a/tools/utils/publish/FirefoxMarketplace.hx +++ b/tools/utils/publish/FirefoxMarketplace.hx @@ -2,7 +2,7 @@ package utils.publish; import haxe.crypto.Base64; -import haxe.io.Path; +import hxp.Path; import haxe.Json; import lime.tools.helpers.CLIHelper; import lime.tools.helpers.Log; @@ -27,7 +27,7 @@ class FirefoxMarketplace { var packagedFile = project.app.file + ".zip"; var destination = outputDirectory + "/dist/" + packagedFile; - ZipHelper.compress (source, destination); + System.compress (source, destination); return destination; @@ -150,7 +150,7 @@ class FirefoxMarketplace { if (answer == YES) { - ProcessHelper.openURL (baseUrl + '/developers/app/${app.slug}/edit'); + System.openURL (baseUrl + '/developers/app/${app.slug}/edit'); } @@ -249,7 +249,7 @@ class FirefoxMarketplace { if (answer == YES || answer == ALWAYS) { if (Log.verbose) Log.println (""); - ProcessHelper.openURL (urlContentRatings); + System.openURL (urlContentRatings); } else { @@ -279,9 +279,9 @@ class FirefoxMarketplace { switch (x) { - case "1": ProcessHelper.openURL (urlContentRatings); - case "2": ProcessHelper.openURL (devUrlApp); - case "3": ProcessHelper.openURL (urlApp); + case "1": System.openURL (urlContentRatings); + case "2": System.openURL (devUrlApp); + case "3": System.openURL (urlApp); case _: } @@ -398,7 +398,7 @@ class FirefoxMarketplace { Sys.sleep (3); if (Log.verbose) Log.println (""); - ProcessHelper.openURL (server + "/developers/api"); + System.openURL (server + "/developers/api"); Sys.sleep (2); Log.println ("");