Add support for --no-output (resolve #525)

This commit is contained in:
Joshua Granick
2017-01-14 17:00:59 -08:00
parent feec323117
commit 8c97a5c676
12 changed files with 72 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ class PlatformTarget {
public var additionalArguments:Array<String>;
public var buildType:String;
public var command:String;
public var noOutput:Bool;
public var project:HXProject;
public var targetDirectory:String;
public var targetFlags:Map<String, String>;
@@ -41,6 +42,16 @@ class PlatformTarget {
}
for (haxeflag in project.haxeflags) {
if (haxeflag == "--no-output") {
noOutput = true;
}
}
}

View File

@@ -112,6 +112,9 @@ class AndroidPlatform extends PlatformTarget {
}
ProcessHelper.runCommand ("", "haxe", haxeParams);
if (noOutput) return;
CPPHelper.compile (project, targetDirectory + "/obj", cppParams);
FileHelper.copyIfNewer (targetDirectory + "/obj/libApplicationMain" + (project.debug ? "-debug" : "") + suffix, path + "/libApplicationMain.so");
@@ -138,6 +141,8 @@ class AndroidPlatform extends PlatformTarget {
}
if (noOutput) return;
AndroidHelper.build (project, destination);
}

View File

@@ -71,6 +71,8 @@ class BlackBerryPlatform extends PlatformTarget {
}
if (project.targetFlags.exists ("no-output")) return;
if (!project.targetFlags.exists ("html5")) {
var destination = targetDirectory + "/bin/";

View File

@@ -41,6 +41,9 @@ class EmscriptenPlatform extends PlatformTarget {
var hxml = targetDirectory + "/haxe/" + buildType + ".hxml";
ProcessHelper.runCommand ("", "haxe", [ hxml, "-D", "emscripten", "-D", "webgl", "-D", "static_link" ] );
if (project.targetFlags.exists ("no-output")) return;
CPPHelper.compile (project, targetDirectory + "/obj", [ "-Demscripten", "-Dwebgl", "-Dstatic_link" ]);
if (project.environment.exists ("EMSCRIPTEN_SDK")) {

View File

@@ -56,6 +56,8 @@ class HTML5Platform extends PlatformTarget {
var hxml = targetDirectory + "/haxe/" + type + ".hxml";
ProcessHelper.runCommand ("", "haxe", [ hxml ] );
if (project.targetFlags.exists ("no-output")) return;
if (project.targetFlags.exists ("webgl")) {
FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain.js", outputFile);

View File

@@ -54,6 +54,8 @@ class IOSPlatform extends PlatformTarget {
IOSHelper.build (project, targetDirectory);
if (project.targetFlags.exists ("no-output")) return;
if (!project.targetFlags.exists ("simulator")) {
var entitlements = targetDirectory + "/" + project.app.file + "/" + project.app.file + "-Entitlements.plist";

View File

@@ -107,6 +107,8 @@ class LinuxPlatform extends PlatformTarget {
ProcessHelper.runCommand ("", "haxe", [ hxml ]);
if (project.targetFlags.exists ("no-output")) return;
if (isRaspberryPi) {
NekoHelper.createExecutable (project.templatePaths, "rpi", targetDirectory + "/obj/ApplicationMain.n", executablePath);
@@ -141,6 +143,9 @@ class LinuxPlatform extends PlatformTarget {
if (!project.targetFlags.exists ("static")) {
ProcessHelper.runCommand ("", "haxe", haxeArgs);
if (project.targetFlags.exists ("no-output")) return;
CPPHelper.compile (project, targetDirectory + "/obj", flags);
FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : ""), executablePath);
@@ -148,6 +153,9 @@ class LinuxPlatform extends PlatformTarget {
} else {
ProcessHelper.runCommand ("", "haxe", haxeArgs.concat ([ "-D", "static_link" ]));
if (project.targetFlags.exists ("no-output")) return;
CPPHelper.compile (project, targetDirectory + "/obj", flags.concat ([ "-Dstatic_link" ]));
CPPHelper.compile (project, targetDirectory + "/obj", flags, "BuildMain.xml");

View File

@@ -103,6 +103,9 @@ class MacPlatform extends PlatformTarget {
if (targetType == "neko") {
ProcessHelper.runCommand ("", "haxe", [ hxml ]);
if (project.targetFlags.exists ("no-output")) return;
NekoHelper.createExecutable (project.templatePaths, "mac" + (is64 ? "64" : ""), targetDirectory + "/obj/ApplicationMain.n", executablePath);
NekoHelper.copyLibraries (project.templatePaths, "mac" + (is64 ? "64" : ""), executableDirectory);
@@ -111,6 +114,9 @@ class MacPlatform extends PlatformTarget {
var libPath = PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("lime")), "templates/java/lib/");
ProcessHelper.runCommand ("", "haxe", [ hxml, "-java-lib", libPath + "disruptor.jar", "-java-lib", libPath + "lwjgl.jar" ]);
if (project.targetFlags.exists ("no-output")) return;
ProcessHelper.runCommand (targetDirectory + "/obj", "haxelib", [ "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"));
@@ -119,12 +125,18 @@ class MacPlatform extends PlatformTarget {
} else if (targetType == "nodejs") {
ProcessHelper.runCommand ("", "haxe", [ hxml ]);
if (project.targetFlags.exists ("no-output")) return;
//NekoHelper.createExecutable (project.templatePaths, "Mac" + (is64 ? "64" : ""), targetDirectory + "/obj/ApplicationMain.n", executablePath);
NekoHelper.copyLibraries (project.templatePaths, "Mac" + (is64 ? "64" : ""), executableDirectory);
} else if (targetType == "cs") {
ProcessHelper.runCommand ("", "haxe", [ hxml ]);
if (project.targetFlags.exists ("no-output")) return;
CSHelper.copySourceFiles (project.templatePaths, targetDirectory + "/obj/src");
var txtPath = targetDirectory + "/obj/hxcs_build.txt";
CSHelper.addSourceFiles (txtPath, CSHelper.ndllSourceFiles);
@@ -149,6 +161,9 @@ class MacPlatform extends PlatformTarget {
if (!project.targetFlags.exists ("static")) {
ProcessHelper.runCommand ("", "haxe", haxeArgs);
if (project.targetFlags.exists ("no-output")) return;
CPPHelper.compile (project, targetDirectory + "/obj", flags);
FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : ""), executablePath);
@@ -156,6 +171,9 @@ class MacPlatform extends PlatformTarget {
} else {
ProcessHelper.runCommand ("", "haxe", haxeArgs.concat ([ "-D", "static_link" ]));
if (project.targetFlags.exists ("no-output")) return;
CPPHelper.compile (project, targetDirectory + "/obj", flags.concat ([ "-Dstatic_link" ]));
CPPHelper.compile (project, targetDirectory + "/obj", flags, "BuildMain.xml");

View File

@@ -54,6 +54,8 @@ class TVOSPlatform extends PlatformTarget {
TVOSHelper.build (project, targetDirectory);
if (project.targetFlags.exists ("no-output")) return;
if (!project.targetFlags.exists ("simulator")) {
var entitlements = targetDirectory + "/" + project.app.file + "/" + project.app.file + "-Entitlements.plist";

View File

@@ -56,6 +56,8 @@ class TizenPlatform extends PlatformTarget {
ProcessHelper.runCommand ("", "haxe", [ hxml, "-D", "tizen" ] );
if (project.targetFlags.exists ("no-output")) return;
var args = [ "-Dtizen", "-DAPP_ID=" + TizenHelper.getUUID (project) ];
if (project.targetFlags.exists ("simulator")) {

View File

@@ -43,6 +43,9 @@ class WebOSPlatform extends PlatformTarget {
}
ProcessHelper.runCommand ("", "haxe", [ hxml, "-D", "webos", "-D", "HXCPP_LOAD_DEBUG", "-D", "HXCPP_RTLD_LAZY" ] );
if (project.targetFlags.exists ("no-output")) return;
CPPHelper.compile (project, targetDirectory + "/obj", [ "-Dwebos", "-DHXCPP_LOAD_DEBUG", "-DHXCPP_RTLD_LAZY" ]);
FileHelper.copyIfNewer (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : ""), targetDirectory + "/bin/" + project.app.file);

View File

@@ -105,6 +105,8 @@ class WindowsPlatform extends PlatformTarget {
ProcessHelper.runCommand ("", "haxe", [ hxml ]);
if (noOutput) return;
var iconPath = PathHelper.combine (applicationDirectory, "icon.ico");
if (!IconHelper.createWindowsIcon (icons, iconPath)) {
@@ -119,12 +121,18 @@ class WindowsPlatform extends PlatformTarget {
} else if (targetType == "nodejs") {
ProcessHelper.runCommand ("", "haxe", [ hxml ]);
if (noOutput) return;
//NekoHelper.createExecutable (project.templatePaths, "windows", targetDirectory + "/obj/ApplicationMain.n", executablePath);
NekoHelper.copyLibraries (project.templatePaths, "windows", applicationDirectory);
} else if (targetType == "cs") {
ProcessHelper.runCommand ("", "haxe", [ hxml ]);
if (noOutput) return;
CSHelper.copySourceFiles (project.templatePaths, targetDirectory + "/obj/src");
var txtPath = targetDirectory + "/obj/hxcs_build.txt";
CSHelper.addSourceFiles (txtPath, CSHelper.ndllSourceFiles);
@@ -149,6 +157,9 @@ class WindowsPlatform extends PlatformTarget {
if (!project.targetFlags.exists ("static")) {
ProcessHelper.runCommand ("", "haxe", haxeArgs);
if (noOutput) return;
CPPHelper.compile (project, targetDirectory + "/obj", flags);
FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : "") + ".exe", executablePath);
@@ -156,6 +167,9 @@ class WindowsPlatform extends PlatformTarget {
} else {
ProcessHelper.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");