Separate build types, use context variable in templates instead of hardcoding. Fix #353
This commit is contained in:
@@ -124,6 +124,32 @@ class PlatformTarget {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getBuildType (?_project:HXProject):String {
|
||||
|
||||
// Optionnal project parameter used in case the function is called before a super call
|
||||
if (_project == null) {
|
||||
|
||||
_project = project;
|
||||
|
||||
}
|
||||
|
||||
var buildType = "release";
|
||||
|
||||
if (_project.debug) {
|
||||
|
||||
buildType = "debug";
|
||||
|
||||
} else if (_project.targetFlags.exists ("final")) {
|
||||
|
||||
buildType = "final";
|
||||
|
||||
}
|
||||
|
||||
return buildType;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ignore public function build ():Void {}
|
||||
@ignore public function clean ():Void {}
|
||||
|
||||
@@ -606,10 +606,10 @@ class FlashHelper {
|
||||
}
|
||||
|
||||
|
||||
private static function compileSWC (project:HXProject, assets:Array<Asset>, id:Int):Void {
|
||||
private static function compileSWC (project:HXProject, assets:Array<Asset>, id:Int, destination:String):Void {
|
||||
|
||||
#if format
|
||||
var destination = project.app.path + "/flash/obj";
|
||||
destination = destination + "/obj";
|
||||
PathHelper.mkdir (destination);
|
||||
|
||||
var label = (id > 0 ? Std.string (id + 1) : "");
|
||||
@@ -751,7 +751,7 @@ class FlashHelper {
|
||||
}*/
|
||||
|
||||
|
||||
public static function embedAssets (project:HXProject):Bool {
|
||||
public static function embedAssets (project:HXProject, targetDirectory:String):Bool {
|
||||
|
||||
var embed = "";
|
||||
var assets = [];
|
||||
@@ -875,7 +875,7 @@ class FlashHelper {
|
||||
if (embed != "") {
|
||||
|
||||
//compileSWC (project, embed, id);
|
||||
compileSWC (project, assets, id);
|
||||
compileSWC (project, assets, id, targetDirectory);
|
||||
|
||||
}
|
||||
|
||||
@@ -891,7 +891,7 @@ class FlashHelper {
|
||||
|
||||
if (assets.length > 0) {
|
||||
|
||||
project.haxeflags.push ("-swf-lib " + project.app.path + "/flash/obj/assets.swf");
|
||||
project.haxeflags.push ("-swf-lib " + targetDirectory + "/obj/assets.swf");
|
||||
project.haxedefs.set ("flash-use-stage", "");
|
||||
|
||||
return true;
|
||||
|
||||
@@ -52,7 +52,7 @@ class AndroidPlatform extends PlatformTarget {
|
||||
|
||||
}
|
||||
|
||||
targetDirectory = project.app.path + "/android";
|
||||
targetDirectory = project.app.path + "/android/" + getBuildType();
|
||||
|
||||
}
|
||||
|
||||
@@ -61,18 +61,7 @@ class AndroidPlatform extends PlatformTarget {
|
||||
|
||||
var destination = targetDirectory + "/bin";
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = targetDirectory + "/haxe/" + type + ".hxml";
|
||||
|
||||
var hasARMV5 = (ArrayHelper.containsValue (project.architectures, Architecture.ARMV5) || ArrayHelper.containsValue (project.architectures, Architecture.ARMV6));
|
||||
@@ -174,22 +163,12 @@ class AndroidPlatform extends PlatformTarget {
|
||||
|
||||
public override function display ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = PathHelper.findTemplate (project.templatePaths, "android/hxml/" + type + ".hxml");
|
||||
|
||||
var context = project.templateContext;
|
||||
context.CPP_DIR = targetDirectory + "/obj";
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
var template = new Template (File.getContent (hxml));
|
||||
|
||||
@@ -320,6 +299,7 @@ class AndroidPlatform extends PlatformTarget {
|
||||
var context = project.templateContext;
|
||||
|
||||
context.CPP_DIR = targetDirectory + "/obj";
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
context.ANDROID_INSTALL_LOCATION = project.config.getString ("android.install-location", "auto");
|
||||
context.ANDROID_MINIMUM_SDK_VERSION = project.config.getInt ("android.minimum-sdk-version", 9);
|
||||
context.ANDROID_TARGET_SDK_VERSION = project.config.getInt ("android.target-sdk-version", 19);
|
||||
|
||||
@@ -35,12 +35,12 @@ class BlackBerryPlatform extends PlatformTarget {
|
||||
|
||||
if (!project.targetFlags.exists ("html5")) {
|
||||
|
||||
targetDirectory = project.app.path + "/blackberry/cpp";
|
||||
targetDirectory = project.app.path + "/blackberry/cpp/" + getBuildType();
|
||||
outputFile = targetDirectory + "/bin/" + PathHelper.safeFileName (project.app.file);
|
||||
|
||||
} else {
|
||||
|
||||
targetDirectory = project.app.path + "/blackberry/html5";
|
||||
targetDirectory = project.app.path + "/blackberry/html5/" + getBuildType();
|
||||
outputFile = targetDirectory + "/src/" + project.app.file + ".js";
|
||||
|
||||
}
|
||||
@@ -66,18 +66,7 @@ class BlackBerryPlatform extends PlatformTarget {
|
||||
|
||||
if (project.app.main != null) {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = targetDirectory + "/haxe/" + type + ".hxml";
|
||||
ProcessHelper.runCommand ("", "haxe", [ hxml, "-D", "blackberry" ] );
|
||||
|
||||
@@ -177,17 +166,7 @@ class BlackBerryPlatform extends PlatformTarget {
|
||||
var hxml = "";
|
||||
var context = project.templateContext;
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
var type = getBuildType ();
|
||||
|
||||
if (!project.targetFlags.exists ("html5")) {
|
||||
|
||||
@@ -199,10 +178,11 @@ class BlackBerryPlatform extends PlatformTarget {
|
||||
|
||||
hxml = PathHelper.findTemplate (project.templatePaths, "html5/hxml/" + type + ".hxml");
|
||||
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
context.OUTPUT_FILE = outputFile;
|
||||
|
||||
}
|
||||
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
var template = new Template (File.getContent (hxml));
|
||||
|
||||
@@ -323,11 +303,11 @@ class BlackBerryPlatform extends PlatformTarget {
|
||||
destination = targetDirectory + "/src/";
|
||||
|
||||
context.WIN_FLASHBACKGROUND = StringTools.hex (project.window.background, 6);
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
context.OUTPUT_FILE = outputFile;
|
||||
|
||||
}
|
||||
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
context.BLACKBERRY_AUTHOR_ID = BlackBerryHelper.processDebugToken (project, targetDirectory).authorID;
|
||||
context.APP_FILE_SAFE = PathHelper.safeFileName (project.app.file);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class EmscriptenPlatform extends PlatformTarget {
|
||||
|
||||
super (command, _project, targetFlags);
|
||||
|
||||
targetDirectory = project.app.path + "/emscripten";
|
||||
targetDirectory = project.app.path + "/emscripten/" + getBuildType();
|
||||
outputFile = targetDirectory + "/bin/" + project.app.file + ".js";
|
||||
|
||||
}
|
||||
@@ -38,18 +38,7 @@ class EmscriptenPlatform extends PlatformTarget {
|
||||
|
||||
public override function build ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = targetDirectory + "/haxe/" + type + ".hxml";
|
||||
|
||||
ProcessHelper.runCommand ("", "haxe", [ hxml, "-D", "emscripten", "-D", "webgl", "-D", "static_link" ] );
|
||||
@@ -198,18 +187,7 @@ class EmscriptenPlatform extends PlatformTarget {
|
||||
|
||||
public override function display ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = PathHelper.findTemplate (project.templatePaths, "emscripten/hxml/" + type + ".hxml");
|
||||
|
||||
var context = project.templateContext;
|
||||
|
||||
@@ -42,7 +42,7 @@ class FirefoxPlatform extends HTML5Platform {
|
||||
|
||||
private override function initialize (command:String, project:HXProject):Void {
|
||||
|
||||
targetDirectory = project.app.path + "/firefox";
|
||||
targetDirectory = project.app.path + "/firefox/" + getBuildType();
|
||||
outputFile = targetDirectory + "/bin/" + project.app.file + ".js";
|
||||
|
||||
}
|
||||
@@ -50,7 +50,7 @@ class FirefoxPlatform extends HTML5Platform {
|
||||
|
||||
public override function run ():Void {
|
||||
|
||||
HTML5Helper.launch (project, project.app.path + "/firefox/bin");
|
||||
HTML5Helper.launch (project, targetDirectory + "/bin");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ class FlashPlatform extends PlatformTarget {
|
||||
|
||||
super (command, _project, targetFlags);
|
||||
|
||||
targetDirectory = project.app.path + "/flash";
|
||||
|
||||
targetDirectory = project.app.path + "/flash/" + getBuildType();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -45,17 +45,7 @@ class FlashPlatform extends PlatformTarget {
|
||||
|
||||
var destination = targetDirectory + "/bin";
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
var type = getBuildType ();
|
||||
|
||||
if (embedded) {
|
||||
|
||||
@@ -87,7 +77,7 @@ class FlashPlatform extends PlatformTarget {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
ProcessHelper.runCommand ("", "haxe", args);
|
||||
|
||||
} else {
|
||||
@@ -140,22 +130,12 @@ class FlashPlatform extends PlatformTarget {
|
||||
|
||||
public override function display ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = PathHelper.findTemplate (project.templatePaths, "flash/hxml/" + type + ".hxml");
|
||||
|
||||
var context = project.templateContext;
|
||||
context.WIN_FLASHBACKGROUND = StringTools.hex (project.window.background, 6);
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
var template = new Template (File.getContent (hxml));
|
||||
|
||||
@@ -257,9 +237,10 @@ class FlashPlatform extends PlatformTarget {
|
||||
var destination = targetDirectory + "/bin/";
|
||||
PathHelper.mkdir (destination);
|
||||
|
||||
embedded = FlashHelper.embedAssets (project);
|
||||
embedded = FlashHelper.embedAssets (project, targetDirectory);
|
||||
|
||||
var context = generateContext ();
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
FileHelper.recursiveCopyTemplate (project.templatePaths, "haxe", targetDirectory + "/haxe", context);
|
||||
FileHelper.recursiveCopyTemplate (project.templatePaths, "flash/hxml", targetDirectory + "/haxe", context);
|
||||
|
||||
@@ -88,18 +88,7 @@ class HTML5Platform extends PlatformTarget {
|
||||
|
||||
public override function display ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = PathHelper.findTemplate (project.templatePaths, "html5/hxml/" + type + ".hxml");
|
||||
|
||||
var context = project.templateContext;
|
||||
@@ -116,7 +105,7 @@ class HTML5Platform extends PlatformTarget {
|
||||
|
||||
private function initialize (command:String, project:HXProject):Void {
|
||||
|
||||
targetDirectory = project.app.path + "/html5";
|
||||
targetDirectory = project.app.path + "/html5/" + getBuildType (project);
|
||||
outputFile = targetDirectory + "/bin/" + project.app.file + ".js";
|
||||
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class IOSPlatform extends PlatformTarget {
|
||||
|
||||
super (command, _project, targetFlags);
|
||||
|
||||
targetDirectory = PathHelper.combine (project.app.path, "ios");
|
||||
targetDirectory = PathHelper.combine (project.app.path, "ios/" + getBuildType());
|
||||
|
||||
}
|
||||
|
||||
@@ -89,7 +89,10 @@ class IOSPlatform extends PlatformTarget {
|
||||
var hxml = PathHelper.findTemplate (project.templatePaths, "iphone/PROJ/haxe/Build.hxml");
|
||||
var template = new Template (File.getContent (hxml));
|
||||
|
||||
Sys.println (template.execute (generateContext ()));
|
||||
var context = generateContext ();
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
Sys.println (template.execute (context));
|
||||
Sys.println ("-D display");
|
||||
|
||||
}
|
||||
@@ -398,6 +401,7 @@ class IOSPlatform extends PlatformTarget {
|
||||
project.assets.push (manifest);
|
||||
|
||||
var context = generateContext ();
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
var projectDirectory = targetDirectory + "/" + project.app.file + "/";
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class LinuxPlatform extends PlatformTarget {
|
||||
|
||||
}
|
||||
|
||||
targetDirectory = project.app.path + "/linux" + (is64 ? "64" : "") + (isRaspberryPi ? "-rpi" : "") + "/" + targetType;
|
||||
targetDirectory = project.app.path + "/linux" + (is64 ? "64" : "") + (isRaspberryPi ? "-rpi" : "") + "/" + targetType + "/" + getBuildType();
|
||||
applicationDirectory = targetDirectory + "/bin/";
|
||||
executablePath = PathHelper.combine (applicationDirectory, project.app.file);
|
||||
|
||||
@@ -81,18 +81,7 @@ class LinuxPlatform extends PlatformTarget {
|
||||
|
||||
public override function build ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = targetDirectory + "/haxe/" + type + ".hxml";
|
||||
|
||||
PathHelper.mkdir (targetDirectory);
|
||||
@@ -198,22 +187,14 @@ class LinuxPlatform extends PlatformTarget {
|
||||
|
||||
public override function display ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = PathHelper.findTemplate (project.templatePaths, targetType + "/hxml/" + type + ".hxml");
|
||||
var template = new Template (File.getContent (hxml));
|
||||
|
||||
Sys.println (template.execute (generateContext ()));
|
||||
var context = generateContext ();
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
Sys.println (template.execute (context));
|
||||
Sys.println ("-D display");
|
||||
|
||||
}
|
||||
@@ -320,6 +301,7 @@ class LinuxPlatform extends PlatformTarget {
|
||||
}
|
||||
|
||||
var context = generateContext ();
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
if (targetType == "cpp" && project.targetFlags.exists ("static")) {
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class MacPlatform extends PlatformTarget {
|
||||
|
||||
}
|
||||
|
||||
targetDirectory = project.app.path + "/mac" + (is64 ? "64" : "") + "/" + targetType;
|
||||
targetDirectory = project.app.path + "/mac" + (is64 ? "64" : "") + "/" + targetType + "/" + getBuildType();
|
||||
applicationDirectory = targetDirectory + "/bin/" + project.app.file + ".app";
|
||||
contentDirectory = applicationDirectory + "/Contents/Resources";
|
||||
executableDirectory = applicationDirectory + "/Contents/MacOS";
|
||||
@@ -80,18 +80,7 @@ class MacPlatform extends PlatformTarget {
|
||||
|
||||
public override function build ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type =getBuildType ();
|
||||
var hxml = targetDirectory + "/haxe/" + type + ".hxml";
|
||||
|
||||
PathHelper.mkdir (targetDirectory);
|
||||
@@ -189,22 +178,14 @@ class MacPlatform extends PlatformTarget {
|
||||
|
||||
public override function display ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType();
|
||||
var hxml = PathHelper.findTemplate (project.templatePaths, targetType + "/hxml/" + type + ".hxml");
|
||||
var template = new Template (File.getContent (hxml));
|
||||
|
||||
Sys.println (template.execute (generateContext ()));
|
||||
var context = generateContext ();
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
Sys.println (template.execute (context));
|
||||
Sys.println ("-D display");
|
||||
|
||||
}
|
||||
@@ -296,6 +277,7 @@ class MacPlatform extends PlatformTarget {
|
||||
}
|
||||
|
||||
var context = generateContext ();
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
if (targetType == "cpp" && project.targetFlags.exists ("static")) {
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class TVOSPlatform extends PlatformTarget {
|
||||
|
||||
super (command, _project, targetFlags);
|
||||
|
||||
targetDirectory = PathHelper.combine (project.app.path, "tvos");
|
||||
targetDirectory = PathHelper.combine (project.app.path, "tvos/" + getBuildType());
|
||||
|
||||
}
|
||||
|
||||
@@ -88,8 +88,11 @@ class TVOSPlatform extends PlatformTarget {
|
||||
|
||||
var hxml = PathHelper.findTemplate (project.templatePaths, "tvos/PROJ/haxe/Build.hxml");
|
||||
var template = new Template (File.getContent (hxml));
|
||||
|
||||
var context = generateContext ();
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
Sys.println (template.execute (generateContext ()));
|
||||
Sys.println (template.execute (context));
|
||||
Sys.println ("-D display");
|
||||
|
||||
}
|
||||
@@ -364,6 +367,7 @@ class TVOSPlatform extends PlatformTarget {
|
||||
project.assets.push (manifest);
|
||||
|
||||
var context = generateContext ();
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
var projectDirectory = targetDirectory + "/" + project.app.file + "/";
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class TizenPlatform extends PlatformTarget {
|
||||
|
||||
super (command, _project, targetFlags);
|
||||
|
||||
targetDirectory = project.app.path + "/tizen";
|
||||
targetDirectory = project.app.path + "/tizen/" + getBuildType();
|
||||
|
||||
}
|
||||
|
||||
@@ -52,18 +52,7 @@ class TizenPlatform extends PlatformTarget {
|
||||
|
||||
}
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = targetDirectory + "/haxe/" + type + ".hxml";
|
||||
|
||||
ProcessHelper.runCommand ("", "haxe", [ hxml, "-D", "tizen" ] );
|
||||
@@ -103,22 +92,12 @@ class TizenPlatform extends PlatformTarget {
|
||||
|
||||
public override function display ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = PathHelper.findTemplate (project.templatePaths, "tizen/hxml/" + type + ".hxml");
|
||||
|
||||
var context = project.templateContext;
|
||||
context.CPP_DIR = targetDirectory + "/obj";
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
var template = new Template (File.getContent (hxml));
|
||||
|
||||
@@ -192,6 +171,7 @@ class TizenPlatform extends PlatformTarget {
|
||||
|
||||
var context = project.templateContext;
|
||||
context.CPP_DIR = targetDirectory + "/obj";
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
context.APP_PACKAGE = TizenHelper.getUUID (project);
|
||||
context.SIMULATOR = project.targetFlags.exists ("simulator");
|
||||
|
||||
|
||||
@@ -26,25 +26,14 @@ class WebOSPlatform extends PlatformTarget {
|
||||
|
||||
super (command, _project, targetFlags);
|
||||
|
||||
targetDirectory = project.app.path + "/webos";
|
||||
targetDirectory = project.app.path + "/webos/" + getBuildType();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override function build ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = targetDirectory + "/haxe/" + type + ".hxml";
|
||||
var destination = targetDirectory + "/bin/";
|
||||
|
||||
@@ -86,22 +75,12 @@ class WebOSPlatform extends PlatformTarget {
|
||||
|
||||
public override function display ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = PathHelper.findTemplate (project.templatePaths, "webos/hxml/" + type + ".hxml");
|
||||
|
||||
var context = project.templateContext;
|
||||
context.CPP_DIR = targetDirectory + "/obj";
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
var template = new Template (File.getContent (hxml));
|
||||
|
||||
@@ -167,6 +146,7 @@ class WebOSPlatform extends PlatformTarget {
|
||||
|
||||
var context = project.templateContext;
|
||||
context.CPP_DIR = targetDirectory + "/obj";
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
var icons = project.icons;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class WindowsPlatform extends PlatformTarget {
|
||||
public function new (command:String, _project:HXProject, targetFlags:Map <String, String> ) {
|
||||
|
||||
super (command, _project, targetFlags);
|
||||
|
||||
|
||||
if (project.targetFlags.exists ("neko") || project.target != PlatformHelper.hostPlatform) {
|
||||
|
||||
targetType = "neko";
|
||||
@@ -51,7 +51,7 @@ class WindowsPlatform extends PlatformTarget {
|
||||
|
||||
}
|
||||
|
||||
targetDirectory = project.app.path + "/windows/" + targetType;
|
||||
targetDirectory = project.app.path + "/windows/" + targetType + "/" + getBuildType();
|
||||
applicationDirectory = targetDirectory + "/bin/";
|
||||
executablePath = applicationDirectory + project.app.file + ".exe";
|
||||
|
||||
@@ -60,18 +60,7 @@ class WindowsPlatform extends PlatformTarget {
|
||||
|
||||
public override function build ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = targetDirectory + "/haxe/" + type + ".hxml";
|
||||
|
||||
PathHelper.mkdir (targetDirectory);
|
||||
@@ -194,22 +183,14 @@ class WindowsPlatform extends PlatformTarget {
|
||||
|
||||
public override function display ():Void {
|
||||
|
||||
var type = "release";
|
||||
|
||||
if (project.debug) {
|
||||
|
||||
type = "debug";
|
||||
|
||||
} else if (project.targetFlags.exists ("final")) {
|
||||
|
||||
type = "final";
|
||||
|
||||
}
|
||||
|
||||
var type = getBuildType ();
|
||||
var hxml = PathHelper.findTemplate (project.templatePaths, targetType + "/hxml/" + type + ".hxml");
|
||||
var template = new Template (File.getContent (hxml));
|
||||
|
||||
Sys.println (template.execute (generateContext ()));
|
||||
var context = generateContext ();
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
Sys.println (template.execute (context));
|
||||
Sys.println ("-D display");
|
||||
|
||||
}
|
||||
@@ -291,6 +272,7 @@ class WindowsPlatform extends PlatformTarget {
|
||||
}
|
||||
|
||||
var context = generateContext ();
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
|
||||
if (targetType == "cpp" && project.targetFlags.exists ("static")) {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/android/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D android
|
||||
-D android-9
|
||||
-debug
|
||||
--macro keep("::APP_MAIN::")
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/android/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D android
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/android/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D android
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/blackberry/cpp/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D blackberry
|
||||
-debug
|
||||
-debug
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/blackberry/cpp/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D blackberry
|
||||
-D final
|
||||
-D final
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/blackberry/cpp/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D blackberry
|
||||
-D blackberry
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cpp ::CPP_DIR::
|
||||
-cp ::BUILD_DIR::/cpp/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
--macro keep("::APP_MAIN::")
|
||||
-debug
|
||||
-debug
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/cpp/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D final
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/cpp/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
--macro keep("::APP_MAIN::")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/emscripten/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D emscripten
|
||||
-D webgl
|
||||
-debug
|
||||
-debug
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/emscripten/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D emscripten
|
||||
-D webgl
|
||||
-D final
|
||||
-D final
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/emscripten/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D emscripten
|
||||
-D webgl
|
||||
-D webgl
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-swf-version ::SWF_VERSION::
|
||||
-swf ::BUILD_DIR::/flash/bin/::APP_FILE::.swf
|
||||
-swf ::OUTPUT_DIR::/bin/::APP_FILE::.swf
|
||||
-swf-header ::if (WIN_WIDTH == "0")::800::else::::WIN_WIDTH::::end:::::if (WIN_HEIGHT == "0")::500::else::::WIN_HEIGHT::::end:::::WIN_FPS:::::WIN_FLASHBACKGROUND::
|
||||
-cp ::BUILD_DIR::/flash/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-debug
|
||||
@@ -1,6 +1,6 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-swf-version ::SWF_VERSION::
|
||||
-swf ::BUILD_DIR::/flash/bin/::APP_FILE::.swf
|
||||
-swf ::OUTPUT_DIR::/bin/::APP_FILE::.swf
|
||||
-swf-header ::if (WIN_WIDTH == "0")::800::else::::WIN_WIDTH::::end:::::if (WIN_HEIGHT == "0")::500::else::::WIN_HEIGHT::::end:::::WIN_FPS:::::WIN_FLASHBACKGROUND::
|
||||
-cp ::BUILD_DIR::/flash/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-D final
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-swf-version ::SWF_VERSION::
|
||||
-swf ::BUILD_DIR::/flash/bin/::APP_FILE::.swf
|
||||
-swf ::OUTPUT_DIR::/bin/::APP_FILE::.swf
|
||||
-swf-header ::if (WIN_WIDTH == "0")::800::else::::WIN_WIDTH::::end:::::if (WIN_HEIGHT == "0")::500::else::::WIN_HEIGHT::::end:::::WIN_FPS:::::WIN_FLASHBACKGROUND::
|
||||
-cp ::BUILD_DIR::/flash/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
@@ -3,4 +3,4 @@
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-D html5
|
||||
-D html
|
||||
-debug
|
||||
-debug
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/java/haxe
|
||||
-java ::BUILD_DIR::/java/obj
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-java ::OUTPUT_DIR::/obj
|
||||
--macro keep("::APP_MAIN::")
|
||||
-debug
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/java/haxe
|
||||
-java ::BUILD_DIR::/java/obj
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-java ::OUTPUT_DIR::/obj
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D final
|
||||
@@ -1,4 +1,4 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/java/haxe
|
||||
-java ::BUILD_DIR::/java/obj
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-java ::OUTPUT_DIR::/obj
|
||||
--macro keep("::APP_MAIN::")
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/neko/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-neko ::NEKO_FILE::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-debug
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/neko/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-neko ::NEKO_FILE::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D final
|
||||
@@ -1,4 +1,4 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/neko/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-neko ::NEKO_FILE::
|
||||
--macro keep("::APP_MAIN::")
|
||||
@@ -1,6 +1,6 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-js ::NODE_FILE::
|
||||
-cp ::BUILD_DIR::/nodejs/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
--macro allowPackage("flash")
|
||||
--macro define("sys")
|
||||
-D nodejs
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-js ::NODE_FILE::
|
||||
-cp ::BUILD_DIR::/nodejs/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
--macro allowPackage("flash")
|
||||
--macro define("sys")
|
||||
-D nodejs
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-js ::NODE_FILE::
|
||||
-cp ::BUILD_DIR::/nodejs/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
--macro allowPackage("flash")
|
||||
--macro define("sys")
|
||||
-D nodejs
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/tizen/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D tizen
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/tizen/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D tizen
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/tizen/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D tizen
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/webos/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D webos
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/webos/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D webos
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-cp ::BUILD_DIR::/webos/haxe
|
||||
-cp ::OUTPUT_DIR::/haxe
|
||||
-cpp ::CPP_DIR::
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D webos
|
||||
|
||||
Reference in New Issue
Block a user