diff --git a/src/ApplicationMain.hx b/src/ApplicationMain.hx deleted file mode 100644 index c5f1e6264..000000000 --- a/src/ApplicationMain.hx +++ /dev/null @@ -1,10 +0,0 @@ -package; - -/** - Help improve code completion for projects that - have not run `lime update` yet -**/ -@:dox(hide) @:noCompletion class ApplicationMain -{ - public static function main() {} -} diff --git a/tools/platforms/AIRPlatform.hx b/tools/platforms/AIRPlatform.hx index 9575797ab..7795eb59c 100644 --- a/tools/platforms/AIRPlatform.hx +++ b/tools/platforms/AIRPlatform.hx @@ -1,23 +1,19 @@ package; +import hxp.Log; import hxp.Path; -import haxe.Template; +import hxp.System; import lime.tools.AIRHelper; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.DeploymentHelper; -import hxp.System; import lime.tools.FlashHelper; +import lime.tools.HXProject; import lime.tools.Icon; import lime.tools.IconHelper; -import hxp.Log; -import hxp.Path; import lime.tools.Platform; -import hxp.System; import lime.tools.PlatformType; -import lime.tools.HXProject; import lime.tools.ProjectHelper; -import hxp.System; import sys.io.File; import sys.FileSystem; @@ -161,27 +157,6 @@ class AIRPlatform extends FlashPlatform } } - private override function getDisplayHXML():String - { - var hxml = System.findTemplate(project.templatePaths, "flash/hxml/" + buildType + ".hxml"); - - var context = project.templateContext; - context.WIN_FLASHBACKGROUND = StringTools.hex(project.window.background, 6); - context.OUTPUT_DIR = targetDirectory; - - for (dependency in project.dependencies) - { - if (StringTools.endsWith(dependency.path, ".ane")) - { - context.HAXE_FLAGS += "\n-swf-lib " + dependency.path; - } - } - - var template = new Template(File.getContent(hxml)); - - return template.execute(context); - } - public override function install():Void { // TODO: Make separate install step diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx index 38fdc9c52..028301e23 100644 --- a/tools/platforms/AndroidPlatform.hx +++ b/tools/platforms/AndroidPlatform.hx @@ -1,25 +1,22 @@ package; +import hxp.ArrayTools; +import hxp.Haxelib; +import hxp.HXML; +import hxp.Log; import hxp.Path; -import haxe.Template; +import hxp.System; import lime.tools.AndroidHelper; import lime.tools.Architecture; -import hxp.ArrayTools; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.DeploymentHelper; -import hxp.System; -import hxp.Haxelib; +import lime.tools.HXProject; import lime.tools.Icon; import lime.tools.IconHelper; -import hxp.Log; -import hxp.Path; import lime.tools.PlatformTarget; -import hxp.System; -import lime.tools.HXProject; import lime.tools.ProjectHelper; -import hxp.System; import sys.io.File; import sys.FileSystem; @@ -176,15 +173,20 @@ class AndroidPlatform extends PlatformTarget private function getDisplayHXML():String { - var hxml = System.findTemplate(project.templatePaths, "android/hxml/" + buildType + ".hxml"); + var path = targetDirectory + "/haxe/" + buildType + ".hxml"; - var context = project.templateContext; - context.CPP_DIR = targetDirectory + "/obj"; - context.OUTPUT_DIR = targetDirectory; - - var template = new Template(File.getContent(hxml)); - - return template.execute(context); + if (FileSystem.exists(path)) + { + return File.getContent(path); + } + else + { + var context = project.templateContext; + var hxml = new HXML(); + hxml.noOutput = true; + hxml.cpp = "_"; + return context.HAXE_FLAGS + "\n" + hxml.toString(); + } } public override function install():Void diff --git a/tools/platforms/EmscriptenPlatform.hx b/tools/platforms/EmscriptenPlatform.hx index 75eea3788..b2a114fe0 100644 --- a/tools/platforms/EmscriptenPlatform.hx +++ b/tools/platforms/EmscriptenPlatform.hx @@ -1,21 +1,19 @@ package; -import hxp.Path; -import hxp.NDLL; import haxe.Json; -import haxe.Template; +import hxp.Haxelib; +import hxp.HXML; +import hxp.Log; +import hxp.NDLL; +import hxp.Path; +import hxp.System; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.DeploymentHelper; -import hxp.System; -import hxp.Haxelib; import lime.tools.HTML5Helper; -import hxp.Log; -import hxp.Path; -import lime.tools.PlatformTarget; -import hxp.System; import lime.tools.HXProject; +import lime.tools.PlatformTarget; import lime.tools.ProjectHelper; import sys.io.File; import sys.FileSystem; @@ -235,15 +233,26 @@ class EmscriptenPlatform extends PlatformTarget public override function display():Void { - var hxml = System.findTemplate(project.templatePaths, "emscripten/hxml/" + buildType + ".hxml"); + Sys.println(getDisplayHXML()); + } - var context = project.templateContext; - context.OUTPUT_DIR = targetDirectory; - context.OUTPUT_FILE = outputFile; + private function getDisplayHXML():String + { + var path = targetDirectory + "/haxe/" + buildType + ".hxml"; - var template = new Template(File.getContent(hxml)); - - Sys.println(template.execute(context)); + if (FileSystem.exists(path)) + { + return File.getContent(path); + } + else + { + var context = project.templateContext; + var hxml = new HXML(); + hxml.noOutput = true; + hxml.cpp = "_"; + hxml.define("webgl"); + return context.HAXE_FLAGS + "\n" + hxml.toString(); + } } public override function rebuild():Void diff --git a/tools/platforms/FlashPlatform.hx b/tools/platforms/FlashPlatform.hx index d717d7d91..7aa4b91ff 100644 --- a/tools/platforms/FlashPlatform.hx +++ b/tools/platforms/FlashPlatform.hx @@ -1,24 +1,20 @@ package; -import hxp.Path; import haxe.Json; -import haxe.Template; +import hxp.Haxelib; +import hxp.HXML; +import hxp.Log; +import hxp.Path; +import hxp.System; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.DeploymentHelper; -import lime.tools.ProjectHelper; -import hxp.System; -import lime.tools.FlashHelper; -import hxp.Haxelib; -import lime.tools.HTML5Helper; -import hxp.Log; -import hxp.Path; -import lime.tools.Platform; -import hxp.System; -import lime.tools.PlatformTarget; -import hxp.System; import lime.tools.HXProject; -import hxp.System; +import lime.tools.ProjectHelper; +import lime.tools.FlashHelper; +import lime.tools.HTML5Helper; +import lime.tools.Platform; +import lime.tools.PlatformTarget; import sys.io.File; import sys.FileSystem; #if neko @@ -104,15 +100,21 @@ class FlashPlatform extends PlatformTarget private function getDisplayHXML():String { - var hxml = System.findTemplate(project.templatePaths, "flash/hxml/" + buildType + ".hxml"); + var path = targetDirectory + "/haxe/" + buildType + ".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)); - - return template.execute(context); + if (FileSystem.exists(path)) + { + return File.getContent(path); + } + else + { + var context = project.templateContext; + var hxml = new HXML(); + hxml.noOutput = true; + hxml.swfVersion = context.SWF_VERSION; + hxml.swf = "_.swf"; + return context.HAXE_FLAGS + "\n" + hxml.toString(); + } } public override function run():Void diff --git a/tools/platforms/HTML5Platform.hx b/tools/platforms/HTML5Platform.hx index e325f2013..2c16e5eca 100644 --- a/tools/platforms/HTML5Platform.hx +++ b/tools/platforms/HTML5Platform.hx @@ -1,6 +1,9 @@ package; +import hxp.HXML; +import hxp.Log; import hxp.Path; +import hxp.System; import haxe.Template; #if lime import lime.text.Font; @@ -9,18 +12,13 @@ import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.DeploymentHelper; import lime.tools.ElectronHelper; -import hxp.System; import lime.tools.HTML5Helper; +import lime.tools.HXProject; import lime.tools.Icon; import lime.tools.IconHelper; -import hxp.Log; import lime.tools.ModuleHelper; import lime.tools.ProjectHelper; -import hxp.Path; import lime.tools.PlatformTarget; -import hxp.System; -import lime.tools.HXProject; -import hxp.System; import sys.io.File; import sys.FileSystem; @@ -124,22 +122,25 @@ class HTML5Platform extends PlatformTarget private function getDisplayHXML():String { - var type = "html5"; + var path = targetDirectory + "/haxe/" + buildType + ".hxml"; - if (targetFlags.exists("electron")) + if (FileSystem.exists(path)) { - type = "electron"; + return File.getContent(path); + } + else + { + var context = project.templateContext; + var hxml = new HXML(); + hxml.noOutput = true; + hxml.js = "_"; + hxml.define("html"); + if (targetFlags.exists("electron")) + { + hxml.define("electron"); + } + return context.HAXE_FLAGS + "\n" + hxml.toString(); } - - var hxml = System.findTemplate(project.templatePaths, type + "/hxml/" + buildType + ".hxml"); - - var context = project.templateContext; - context.OUTPUT_DIR = targetDirectory; - context.OUTPUT_FILE = outputFile; - - var template = new Template(File.getContent(hxml)); - - return template.execute(context); } private function initialize(command:String, project:HXProject):Void diff --git a/tools/platforms/IOSPlatform.hx b/tools/platforms/IOSPlatform.hx index b9778d231..f5feeed33 100644 --- a/tools/platforms/IOSPlatform.hx +++ b/tools/platforms/IOSPlatform.hx @@ -1,36 +1,31 @@ package; -// import openfl.display.BitmapData; -import hxp.Path; import haxe.Json; -import haxe.Template; -import lime.tools.Architecture; 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.System; import hxp.Haxelib; -import lime.tools.Icon; -import lime.tools.IconHelper; -import lime.tools.IOSHelper; -import lime.tools.Keystore; +import hxp.HXML; import hxp.Log; import hxp.NDLL; import hxp.Path; -import lime.tools.Platform; -import hxp.System; -import lime.tools.PlatformTarget; -import hxp.System; -import lime.tools.HXProject; -import lime.tools.ProjectHelper; import hxp.StringTools; import hxp.System; #if lime import lime.graphics.Image; #end +import lime.tools.Architecture; +import lime.tools.Asset; +import lime.tools.AssetHelper; +import lime.tools.AssetType; +import lime.tools.CPPHelper; +import lime.tools.DeploymentHelper; +import lime.tools.HXProject; +import lime.tools.Icon; +import lime.tools.IconHelper; +import lime.tools.IOSHelper; +import lime.tools.Keystore; +import lime.tools.Platform; +import lime.tools.PlatformTarget; +import lime.tools.ProjectHelper; import sys.io.File; import sys.FileSystem; @@ -374,15 +369,21 @@ class IOSPlatform extends PlatformTarget private function getDisplayHXML():String { - 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)); + var path = targetDirectory + "/" + project.app.file + "/haxe/Build.hxml"; - // project = project.clone (); - var context = generateContext(); - context.OUTPUT_DIR = targetDirectory; - - return template.execute(context); + if (FileSystem.exists(path)) + { + return File.getContent(path); + } + else + { + var context = project.templateContext; + var hxml = new HXML(); + hxml.noOutput = true; + hxml.cpp = "_"; + hxml.define("iphone"); + return context.HAXE_FLAGS + "\n" + hxml.toString(); + } } public override function rebuild():Void diff --git a/tools/platforms/LinuxPlatform.hx b/tools/platforms/LinuxPlatform.hx index 9191a3097..2374033c4 100644 --- a/tools/platforms/LinuxPlatform.hx +++ b/tools/platforms/LinuxPlatform.hx @@ -1,27 +1,23 @@ package; +import hxp.Haxelib; +import hxp.HXML; import hxp.Path; +import hxp.Log; import hxp.NDLL; -import haxe.Template; +import hxp.System; import lime.tools.Architecture; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.DeploymentHelper; -import hxp.System; -import hxp.Haxelib; +import lime.tools.HXProject; import lime.tools.JavaHelper; -import hxp.Log; import lime.tools.NekoHelper; import lime.tools.NodeJSHelper; -import hxp.Path; import lime.tools.Platform; -import hxp.System; import lime.tools.PlatformTarget; -import hxp.System; -import lime.tools.HXProject; import lime.tools.ProjectHelper; -import hxp.System; import sys.io.File; import sys.io.Process; import sys.FileSystem; @@ -255,13 +251,27 @@ class LinuxPlatform extends PlatformTarget private function getDisplayHXML():String { - var hxml = System.findTemplate(project.templatePaths, targetType + "/hxml/" + buildType + ".hxml"); - var template = new Template(File.getContent(hxml)); + var path = targetDirectory + "/haxe/" + buildType + ".hxml"; - var context = generateContext(); - context.OUTPUT_DIR = targetDirectory; - - return template.execute(context); + if (FileSystem.exists(path)) + { + return File.getContent(path); + } + else + { + var context = project.templateContext; + var hxml = new HXML(); + hxml.noOutput = true; + switch (targetType) + { + case "hl": hxml.hl = "_.hl"; + case "neko": hxml.neko = "_.n"; + case "java": hxml.java = "_"; + case "nodejs": hxml.js = "_.js"; + default: hxml.cpp = "_"; + } + return context.HAXE_FLAGS + "\n" + hxml.toString(); + } } public override function rebuild():Void diff --git a/tools/platforms/MacPlatform.hx b/tools/platforms/MacPlatform.hx index c6e00e453..ea463806d 100644 --- a/tools/platforms/MacPlatform.hx +++ b/tools/platforms/MacPlatform.hx @@ -1,31 +1,27 @@ package; +import hxp.Haxelib; +import hxp.HXML; +import hxp.Log; import hxp.Path; import hxp.NDLL; -import haxe.Template; +import hxp.System; 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.System; import lime.tools.GUID; -import hxp.Haxelib; +import lime.tools.HXProject; 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.Path; import lime.tools.Platform; -import hxp.System; import lime.tools.PlatformTarget; -import hxp.System; -import lime.tools.HXProject; import lime.tools.ProjectHelper; -import hxp.System; import sys.io.File; import sys.FileSystem; @@ -230,13 +226,27 @@ class MacPlatform extends PlatformTarget private function getDisplayHXML():String { - var hxml = System.findTemplate(project.templatePaths, targetType + "/hxml/" + buildType + ".hxml"); - var template = new Template(File.getContent(hxml)); + var path = targetDirectory + "/haxe/" + buildType + ".hxml"; - var context = generateContext(); - context.OUTPUT_DIR = targetDirectory; - - return template.execute(context); + if (FileSystem.exists(path)) + { + return File.getContent(path); + } + else + { + var context = project.templateContext; + var hxml = new HXML(); + hxml.noOutput = true; + switch (targetType) + { + case "hl": hxml.hl = "_.hl"; + case "neko": hxml.neko = "_.n"; + case "java": hxml.java = "_"; + case "nodejs": hxml.js = "_.js"; + default: hxml.cpp = "_"; + } + return context.HAXE_FLAGS + "\n" + hxml.toString(); + } } public override function rebuild():Void diff --git a/tools/platforms/TVOSPlatform.hx b/tools/platforms/TVOSPlatform.hx index df0ae3bff..cb59b8cba 100644 --- a/tools/platforms/TVOSPlatform.hx +++ b/tools/platforms/TVOSPlatform.hx @@ -1,36 +1,31 @@ package; -// import openfl.display.BitmapData; -import hxp.Path; import haxe.Json; -import haxe.Template; -import lime.tools.Architecture; import hxp.ArrayTools; +import hxp.Haxelib; +import hxp.HXML; +import hxp.Log; +import hxp.NDLL; +import hxp.Path; +import hxp.StringTools; +import hxp.System; +#if lime +import lime.graphics.Image; +#end +import lime.tools.Architecture; import lime.tools.Asset; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.DeploymentHelper; -import hxp.System; -import hxp.Haxelib; +import lime.tools.HXProject; import lime.tools.Icon; import lime.tools.IconHelper; import lime.tools.Keystore; -import hxp.Log; -import hxp.NDLL; -import hxp.Path; import lime.tools.Platform; -import hxp.System; import lime.tools.PlatformTarget; -import hxp.System; -import lime.tools.HXProject; import lime.tools.ProjectHelper; -import hxp.StringTools; import lime.tools.TVOSHelper; -import hxp.System; -#if lime -import lime.graphics.Image; -#end import sys.io.File; import sys.FileSystem; @@ -301,13 +296,22 @@ class TVOSPlatform extends PlatformTarget private function getDisplayHXML():String { - var hxml = System.findTemplate(project.templatePaths, "tvos/PROJ/haxe/Build.hxml"); - var template = new Template(File.getContent(hxml)); + var path = targetDirectory + "/" + project.app.file + "/haxe/Build.hxml"; - var context = generateContext(); - context.OUTPUT_DIR = targetDirectory; - - return template.execute(context); + if (FileSystem.exists(path)) + { + return File.getContent(path); + } + else + { + var context = project.templateContext; + var hxml = new HXML(); + hxml.noOutput = true; + hxml.cpp = "_"; + hxml.define("tvos"); + hxml.define("appletv"); + return context.HAXE_FLAGS + "\n" + hxml.toString(); + } } public override function rebuild():Void diff --git a/tools/platforms/TizenPlatform.hx b/tools/platforms/TizenPlatform.hx index 4892b97df..167ee8c6b 100644 --- a/tools/platforms/TizenPlatform.hx +++ b/tools/platforms/TizenPlatform.hx @@ -1,20 +1,18 @@ package; +import hxp.HXML; import hxp.Path; -import haxe.Template; +import hxp.System; import lime.tools.AssetHelper; import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.DeploymentHelper; -import hxp.System; +import lime.tools.HXProject; import lime.tools.Icon; import lime.tools.IconHelper; -import hxp.Path; import lime.tools.PlatformTarget; -import hxp.System; -import lime.tools.HXProject; import lime.tools.ProjectHelper; -import hxp.TizenHelper; +import lime.tools.TizenHelper; import sys.io.File; import sys.FileSystem; @@ -79,15 +77,20 @@ class TizenPlatform extends PlatformTarget public override function display():Void { - var hxml = System.findTemplate(project.templatePaths, "tizen/hxml/" + buildType + ".hxml"); + var path = targetDirectory + "/haxe/" + buildType + ".hxml"; - var context = project.templateContext; - context.CPP_DIR = targetDirectory + "/obj"; - context.OUTPUT_DIR = targetDirectory; - - var template = new Template(File.getContent(hxml)); - - Sys.println(template.execute(context)); + if (FileSystem.exists(path)) + { + return File.getContent(path); + } + else + { + var context = project.templateContext; + var hxml = new HXML(); + hxml.noOutput = true; + hxml.cpp = "_"; + return context.HAXE_FLAGS + "\n" + hxml.toString(); + } } public override function rebuild():Void diff --git a/tools/platforms/WindowsPlatform.hx b/tools/platforms/WindowsPlatform.hx index 629ae999b..055a0c2fc 100644 --- a/tools/platforms/WindowsPlatform.hx +++ b/tools/platforms/WindowsPlatform.hx @@ -1,8 +1,11 @@ package; +import hxp.Haxelib; +import hxp.HXML; +import hxp.Log; import hxp.Path; import hxp.NDLL; -import haxe.Template; +import hxp.System; import lime.tools.Architecture; import lime.tools.Asset; import lime.tools.AssetHelper; @@ -10,25 +13,18 @@ import lime.tools.AssetType; import lime.tools.CPPHelper; import lime.tools.CSHelper; import lime.tools.DeploymentHelper; -import hxp.System; import lime.tools.GUID; -import hxp.Haxelib; import lime.tools.HTML5Helper; +import lime.tools.HXProject; import lime.tools.Icon; import lime.tools.IconHelper; import lime.tools.JavaHelper; -import hxp.Log; import lime.tools.ModuleHelper; import lime.tools.NekoHelper; import lime.tools.NodeJSHelper; -import hxp.Path; import lime.tools.Platform; -import hxp.System; import lime.tools.PlatformTarget; -import hxp.System; -import lime.tools.HXProject; import lime.tools.ProjectHelper; -import hxp.System; import sys.io.File; import sys.FileSystem; @@ -420,13 +416,27 @@ class WindowsPlatform extends PlatformTarget private function getDisplayHXML():String { - var hxml = System.findTemplate(project.templatePaths, targetType + "/hxml/" + buildType + ".hxml"); - var template = new Template(File.getContent(hxml)); + var path = targetDirectory + "/haxe/" + buildType + ".hxml"; - var context = generateContext(); - context.OUTPUT_DIR = targetDirectory; - - return template.execute(context); + if (FileSystem.exists(path)) + { + return File.getContent(path); + } + else + { + var context = project.templateContext; + var hxml = new HXML(); + hxml.noOutput = true; + switch (targetType) + { + case "hl": hxml.hl = "_.hl"; + case "neko": hxml.neko = "_.n"; + case "java": hxml.java = "_"; + case "nodejs", "winjs": hxml.js = "_.js"; + default: hxml.cpp = "_"; + } + return context.HAXE_FLAGS + "\n" + hxml.toString(); + } } public override function rebuild():Void