Add lime.tools.* and keep Project-based tool code

This commit is contained in:
Joshua Granick
2018-08-03 16:38:50 -07:00
parent 6d9f3c4bd8
commit 4ec83c3638
65 changed files with 15641 additions and 1501 deletions

View File

@@ -3,55 +3,30 @@ package;
import haxe.io.Path;
import haxe.Template;
#if (hxp > "1.0.0")
import hxp.Architecture;
import hxp.AssetHelper;
import hxp.AssetType;
import hxp.CPPHelper;
import hxp.CSHelper;
import hxp.DeploymentHelper;
import lime.tools.Architecture;
import lime.tools.AssetHelper;
import lime.tools.AssetType;
import lime.tools.CPPHelper;
import lime.tools.CSHelper;
import lime.tools.DeploymentHelper;
import hxp.FileHelper;
import hxp.GUID;
import hxp.Haxelib;
import hxp.HaxelibHelper;
import hxp.Icon;
import hxp.IconHelper;
import hxp.JavaHelper;
import hxp.LogHelper;
import hxp.NekoHelper;
import hxp.NodeJSHelper;
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.Platform;
import lime.tools.Platform;
import hxp.PlatformHelper;
import hxp.PlatformTarget;
import lime.tools.PlatformTarget;
import hxp.ProcessHelper;
import hxp.Project;
import lime.tools.Project;
import lime.tools.ProjectHelper;
import hxp.WatchHelper;
#else
import hxp.helpers.AssetHelper;
import hxp.helpers.CPPHelper;
import hxp.helpers.CSHelper;
import hxp.helpers.DeploymentHelper;
import hxp.helpers.GUID;
import hxp.helpers.FileHelper;
import hxp.helpers.HaxelibHelper;
import hxp.helpers.IconHelper;
import hxp.helpers.JavaHelper;
import hxp.helpers.LogHelper;
import hxp.helpers.NekoHelper;
import hxp.helpers.NodeJSHelper;
import hxp.helpers.PathHelper;
import hxp.helpers.PlatformHelper;
import hxp.helpers.ProcessHelper;
import hxp.helpers.WatchHelper;
import hxp.project.AssetType;
import hxp.project.Architecture;
import hxp.project.Haxelib;
import hxp.project.HXProject in Project;
import hxp.project.Icon;
import hxp.project.Platform;
import hxp.project.PlatformTarget;
#end
import sys.io.File;
import sys.FileSystem;
@@ -81,7 +56,7 @@ class MacPlatform extends PlatformTarget {
}
if (project.targetFlags.exists ("neko") || project.target != PlatformHelper.hostPlatform) {
if (project.targetFlags.exists ("neko") || project.target != cast PlatformHelper.hostPlatform) {
targetType = "neko";
@@ -129,7 +104,7 @@ class MacPlatform extends PlatformTarget {
for (ndll in project.ndlls) {
FileHelper.copyLibrary (project, ndll, "Mac" + (is64 ? "64" : ""), "", (ndll.haxelib != null && (ndll.haxelib.name == "hxcpp" || ndll.haxelib.name == "hxlibc")) ? ".dylib" : ".ndll", executableDirectory, project.debug, targetSuffix);
ProjectHelper.copyLibrary (project, ndll, "Mac" + (is64 ? "64" : ""), "", (ndll.haxelib != null && (ndll.haxelib.name == "hxcpp" || ndll.haxelib.name == "hxlibc")) ? ".dylib" : ".ndll", executableDirectory, project.debug, targetSuffix);
}
@@ -226,7 +201,7 @@ class MacPlatform extends PlatformTarget {
}
if (PlatformHelper.hostPlatform != Platform.WINDOWS && targetType != "nodejs" && targetType != "java") {
if (PlatformHelper.hostPlatform != WINDOWS && targetType != "nodejs" && targetType != "java") {
ProcessHelper.runCommand ("", "chmod", [ "755", executablePath ]);
@@ -291,13 +266,13 @@ class MacPlatform extends PlatformTarget {
var commands = [];
if (!targetFlags.exists ("32") && (command == "rebuild" || PlatformHelper.hostArchitecture == Architecture.X64)) {
if (!targetFlags.exists ("32") && (command == "rebuild" || PlatformHelper.hostArchitecture == X64)) {
commands.push ([ "-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M64" ]);
}
if (!targetFlags.exists ("64") && (command == "rebuild" || PlatformHelper.hostArchitecture == Architecture.X86)) {
if (!targetFlags.exists ("64") && (command == "rebuild" || PlatformHelper.hostArchitecture == X86)) {
commands.push ([ "-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M32" ]);
@@ -312,7 +287,7 @@ class MacPlatform extends PlatformTarget {
var arguments = additionalArguments.copy ();
if (LogHelper.verbose) {
if (Log.verbose) {
arguments.push ("-verbose");
@@ -330,7 +305,7 @@ class MacPlatform extends PlatformTarget {
ProcessHelper.runCommand (executableDirectory, "java", [ "-jar", project.app.file + ".jar" ].concat (arguments));
} else if (project.target == PlatformHelper.hostPlatform) {
} else if (project.target == cast PlatformHelper.hostPlatform) {
arguments = arguments.concat ([ "-livereload" ]);
ProcessHelper.runCommand (executableDirectory, "./" + Path.withoutDirectory (executablePath), arguments);
@@ -358,7 +333,7 @@ class MacPlatform extends PlatformTarget {
var path = PathHelper.combine (targetDirectory + "/obj/tmp", asset.targetPath);
PathHelper.mkdir (Path.directory (path));
FileHelper.copyAsset (asset, path);
AssetHelper.copyAsset (asset, path);
asset.sourcePath = path;
}
@@ -392,12 +367,12 @@ class MacPlatform extends PlatformTarget {
//SWFHelper.generateSWFClasses (project, targetDirectory + "/haxe");
FileHelper.recursiveSmartCopyTemplate (project, "haxe", targetDirectory + "/haxe", context);
FileHelper.recursiveSmartCopyTemplate (project, targetType + "/hxml", targetDirectory + "/haxe", context);
ProjectHelper.recursiveSmartCopyTemplate (project, "haxe", targetDirectory + "/haxe", context);
ProjectHelper.recursiveSmartCopyTemplate (project, targetType + "/hxml", targetDirectory + "/haxe", context);
if (targetType == "cpp" && project.targetFlags.exists ("static")) {
FileHelper.recursiveSmartCopyTemplate (project, "cpp/static", targetDirectory + "/obj", context);
ProjectHelper.recursiveSmartCopyTemplate (project, "cpp/static", targetDirectory + "/obj", context);
}
@@ -421,12 +396,12 @@ class MacPlatform extends PlatformTarget {
if (asset.type != AssetType.TEMPLATE) {
PathHelper.mkdir (Path.directory (PathHelper.combine (contentDirectory, asset.targetPath)));
FileHelper.copyAssetIfNewer (asset, PathHelper.combine (contentDirectory, asset.targetPath));
AssetHelper.copyAssetIfNewer (asset, PathHelper.combine (contentDirectory, asset.targetPath));
} else {
PathHelper.mkdir (Path.directory (PathHelper.combine (targetDirectory, asset.targetPath)));
FileHelper.copyAsset (asset, PathHelper.combine (targetDirectory, asset.targetPath), context);
AssetHelper.copyAsset (asset, PathHelper.combine (targetDirectory, asset.targetPath), context);
}
@@ -439,9 +414,9 @@ class MacPlatform extends PlatformTarget {
public override function watch ():Void {
var dirs = WatchHelper.processHXML (project, getDisplayHXML ());
var command = WatchHelper.getCurrentCommand ();
WatchHelper.watch (project, command, dirs);
var dirs = WatchHelper.processHXML (getDisplayHXML (), project.app.path);
var command = ProjectHelper.getCurrentCommand ();
WatchHelper.watch (command, dirs);
}