diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx index 028301e23..913abefb6 100644 --- a/tools/platforms/AndroidPlatform.hx +++ b/tools/platforms/AndroidPlatform.hx @@ -182,10 +182,11 @@ class AndroidPlatform extends PlatformTarget else { var context = project.templateContext; - var hxml = new HXML(); - hxml.noOutput = true; + var hxml = HXML.fromString(context.HAXE_FLAGS); + hxml.addClassName(context.APP_MAIN); hxml.cpp = "_"; - return context.HAXE_FLAGS + "\n" + hxml.toString(); + hxml.noOutput = true; + return hxml; } } diff --git a/tools/platforms/EmscriptenPlatform.hx b/tools/platforms/EmscriptenPlatform.hx index b2a114fe0..3f063fca4 100644 --- a/tools/platforms/EmscriptenPlatform.hx +++ b/tools/platforms/EmscriptenPlatform.hx @@ -247,11 +247,12 @@ class EmscriptenPlatform extends PlatformTarget else { var context = project.templateContext; - var hxml = new HXML(); - hxml.noOutput = true; + var hxml = HXML.fromString(context.HAXE_FLAGS); + hxml.addClassName(context.APP_MAIN); hxml.cpp = "_"; hxml.define("webgl"); - return context.HAXE_FLAGS + "\n" + hxml.toString(); + hxml.noOutput = true; + return hxml; } } diff --git a/tools/platforms/FlashPlatform.hx b/tools/platforms/FlashPlatform.hx index 7aa4b91ff..5966ca909 100644 --- a/tools/platforms/FlashPlatform.hx +++ b/tools/platforms/FlashPlatform.hx @@ -109,11 +109,12 @@ class FlashPlatform extends PlatformTarget else { var context = project.templateContext; - var hxml = new HXML(); - hxml.noOutput = true; - hxml.swfVersion = context.SWF_VERSION; + var hxml = HXML.fromString(context.HAXE_FLAGS); + hxml.addClassName(context.APP_MAIN); hxml.swf = "_.swf"; - return context.HAXE_FLAGS + "\n" + hxml.toString(); + hxml.swfVersion = context.SWF_VERSION; + hxml.noOutput = true; + return hxml; } } diff --git a/tools/platforms/HTML5Platform.hx b/tools/platforms/HTML5Platform.hx index 2c16e5eca..e2faf6df0 100644 --- a/tools/platforms/HTML5Platform.hx +++ b/tools/platforms/HTML5Platform.hx @@ -131,15 +131,16 @@ class HTML5Platform extends PlatformTarget else { var context = project.templateContext; - var hxml = new HXML(); - hxml.noOutput = true; + var hxml = HXML.fromString(context.HAXE_FLAGS); + hxml.addClassName(context.APP_MAIN); hxml.js = "_"; hxml.define("html"); if (targetFlags.exists("electron")) { hxml.define("electron"); } - return context.HAXE_FLAGS + "\n" + hxml.toString(); + hxml.noOutput = true; + return hxml; } } diff --git a/tools/platforms/IOSPlatform.hx b/tools/platforms/IOSPlatform.hx index f5feeed33..7a398a9d2 100644 --- a/tools/platforms/IOSPlatform.hx +++ b/tools/platforms/IOSPlatform.hx @@ -378,11 +378,12 @@ class IOSPlatform extends PlatformTarget else { var context = project.templateContext; - var hxml = new HXML(); - hxml.noOutput = true; + var hxml = HXML.fromString(context.HAXE_FLAGS); + hxml.addClassName(context.APP_MAIN); hxml.cpp = "_"; hxml.define("iphone"); - return context.HAXE_FLAGS + "\n" + hxml.toString(); + hxml.noOutput = true; + return hxml; } } diff --git a/tools/platforms/LinuxPlatform.hx b/tools/platforms/LinuxPlatform.hx index 2374033c4..a838c7a56 100644 --- a/tools/platforms/LinuxPlatform.hx +++ b/tools/platforms/LinuxPlatform.hx @@ -260,8 +260,8 @@ class LinuxPlatform extends PlatformTarget else { var context = project.templateContext; - var hxml = new HXML(); - hxml.noOutput = true; + var hxml = HXML.fromString(context.HAXE_FLAGS); + hxml.addClassName(context.APP_MAIN); switch (targetType) { case "hl": hxml.hl = "_.hl"; @@ -270,7 +270,8 @@ class LinuxPlatform extends PlatformTarget case "nodejs": hxml.js = "_.js"; default: hxml.cpp = "_"; } - return context.HAXE_FLAGS + "\n" + hxml.toString(); + hxml.noOutput = true; + return hxml; } } diff --git a/tools/platforms/MacPlatform.hx b/tools/platforms/MacPlatform.hx index ea463806d..075149ee5 100644 --- a/tools/platforms/MacPlatform.hx +++ b/tools/platforms/MacPlatform.hx @@ -235,8 +235,8 @@ class MacPlatform extends PlatformTarget else { var context = project.templateContext; - var hxml = new HXML(); - hxml.noOutput = true; + var hxml = HXML.fromString(context.HAXE_FLAGS); + hxml.addClassName(context.APP_MAIN); switch (targetType) { case "hl": hxml.hl = "_.hl"; @@ -245,7 +245,8 @@ class MacPlatform extends PlatformTarget case "nodejs": hxml.js = "_.js"; default: hxml.cpp = "_"; } - return context.HAXE_FLAGS + "\n" + hxml.toString(); + hxml.noOutput = true; + return hxml; } } diff --git a/tools/platforms/TVOSPlatform.hx b/tools/platforms/TVOSPlatform.hx index cb59b8cba..ba78a402e 100644 --- a/tools/platforms/TVOSPlatform.hx +++ b/tools/platforms/TVOSPlatform.hx @@ -305,12 +305,13 @@ class TVOSPlatform extends PlatformTarget else { var context = project.templateContext; - var hxml = new HXML(); - hxml.noOutput = true; + var hxml = HXML.fromString(context.HAXE_FLAGS); + hxml.addClassName(context.APP_MAIN); hxml.cpp = "_"; hxml.define("tvos"); hxml.define("appletv"); - return context.HAXE_FLAGS + "\n" + hxml.toString(); + hxml.noOutput = true; + return hxml; } } diff --git a/tools/platforms/WindowsPlatform.hx b/tools/platforms/WindowsPlatform.hx index 055a0c2fc..267506ed4 100644 --- a/tools/platforms/WindowsPlatform.hx +++ b/tools/platforms/WindowsPlatform.hx @@ -425,8 +425,8 @@ class WindowsPlatform extends PlatformTarget else { var context = project.templateContext; - var hxml = new HXML(); - hxml.noOutput = true; + var hxml = HXML.fromString(context.HAXE_FLAGS); + hxml.addClassName(context.APP_MAIN); switch (targetType) { case "hl": hxml.hl = "_.hl"; @@ -435,7 +435,8 @@ class WindowsPlatform extends PlatformTarget case "nodejs", "winjs": hxml.js = "_.js"; default: hxml.cpp = "_"; } - return context.HAXE_FLAGS + "\n" + hxml.toString(); + hxml.noOutput = true; + return hxml; } }