diff --git a/lime/project/HXProject.hx b/lime/project/HXProject.hx index dccdee46e..4d9208b79 100644 --- a/lime/project/HXProject.hx +++ b/lime/project/HXProject.hx @@ -215,23 +215,20 @@ class HXProject { defaultWindow.fullscreen = true; defaultWindow.requireShaders = true; - case WINDOWS, MAC, LINUX: + case WINDOWS: platformType = PlatformType.DESKTOP; - if (target == Platform.LINUX || target == Platform.MAC) { + if (targetFlags.exists ("uwp") || targetFlags.exists ("winjs")) { - architectures = [ PlatformHelper.hostArchitecture ]; - - } else if(targetFlags.exists ("uwp")) { - Sys.println("forcing platform to WEB"); - target = Platform.HTML5; - platformType = PlatformType.WEB; architectures = []; + + targetFlags.set ("uwp", ""); + targetFlags.set ("winjs", ""); + defaultWindow.width = 0; defaultWindow.height = 0; defaultWindow.fps = 60; - defaultWindow.allowHighDPI = false; } else { @@ -241,9 +238,16 @@ class HXProject { defaultWindow.allowHighDPI = false; + case MAC, LINUX: + + platformType = PlatformType.DESKTOP; + architectures = [ PlatformHelper.hostArchitecture ]; + + defaultWindow.allowHighDPI = false; + default: - // TODO: Better handle platform type for pluggable targets + // TODO: Better handling of platform type for pluggable targets platformType = PlatformType.CONSOLE; diff --git a/lime/project/ProjectXMLParser.hx b/lime/project/ProjectXMLParser.hx index f4692150e..704ad6142 100644 --- a/lime/project/ProjectXMLParser.hx +++ b/lime/project/ProjectXMLParser.hx @@ -120,10 +120,15 @@ class ProjectXMLParser extends HXProject { defines.set ("targetType", "swf"); defines.set ("flash", "1"); - } else if (targetFlags.exists("uwp")) { + } else if (target == Platform.WINDOWS && (targetFlags.exists ("uwp") || targetFlags.exists ("winjs"))) { + + targetFlags.set ("uwp", ""); + targetFlags.set ("winjs", ""); defines.set ("targetType", "js"); defines.set ("html5", "1"); + defines.set ("uwp", "1"); + defines.set ("winjs", "1"); } else if (platformType == DESKTOP && target != PlatformHelper.hostPlatform) { diff --git a/lime/system/System.hx b/lime/system/System.hx index 641733c51..294ccfb8c 100644 --- a/lime/system/System.hx +++ b/lime/system/System.hx @@ -311,7 +311,7 @@ class System { if (path != null) { - #if windows + #if (sys && windows) Sys.command ("start", [ path ]); diff --git a/lime/tools/helpers/GUID.hx b/lime/tools/helpers/GUID.hx index 6c44509e9..4be90dc51 100644 --- a/lime/tools/helpers/GUID.hx +++ b/lime/tools/helpers/GUID.hx @@ -1,4 +1,6 @@ package lime.tools.helpers; + + import haxe.crypto.Sha1; import haxe.io.Bytes; import haxe.crypto.Crc32; diff --git a/lime/tools/platforms/WindowsPlatform.hx b/lime/tools/platforms/WindowsPlatform.hx index b7adb5cb7..ddbf305fb 100644 --- a/lime/tools/platforms/WindowsPlatform.hx +++ b/lime/tools/platforms/WindowsPlatform.hx @@ -53,9 +53,9 @@ class WindowsPlatform extends PlatformTarget { } - if (project.targetFlags.exists ("uwp")) { + if (project.targetFlags.exists ("uwp") || project.targetFlags.exists ("winjs")) { - targetType = "html5"; + targetType = "winjs"; } else if (project.targetFlags.exists ("neko") || project.target != PlatformHelper.hostPlatform) { @@ -76,18 +76,18 @@ class WindowsPlatform extends PlatformTarget { } targetDirectory = PathHelper.combine (project.app.path, project.config.getString ("windows.output-directory", targetType == "cpp" ? "windows" : targetType)); - - if (project.targetFlags.exists ("uwp")) { - - //targetDirectory = PathHelper.combine (project.app.path, "windows" + (is64 ? "64" : "") + "/" + targetType + "/" + buildType); - outputFile = targetDirectory + "/source/js/" + project.app.file + ".js"; - - } - targetDirectory = StringTools.replace (targetDirectory, "arch64", is64 ? "64" : ""); - applicationDirectory = targetDirectory + "/bin/"; - executablePath = applicationDirectory + project.app.file + ".exe"; + if (targetType == "winjs") { + + outputFile = targetDirectory + "/source/js/" + project.app.file + ".js"; + + } else { + + applicationDirectory = targetDirectory + "/bin/"; + executablePath = applicationDirectory + project.app.file + ".exe"; + + } } @@ -97,27 +97,27 @@ class WindowsPlatform extends PlatformTarget { var hxml = targetDirectory + "/haxe/" + buildType + ".hxml"; PathHelper.mkdir (targetDirectory); - + var icons = project.icons; - + if (icons.length == 0) { - + icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ]; - + } - - // universal windows platform - // for now build html5 - if (project.targetFlags.exists ("uwp")) { - Sys.println ("Start UWP Build"); + + if (targetType == "winjs") { + ModuleHelper.buildModules (project, targetDirectory, targetDirectory); if (project.app.main != null) { - ProcessHelper.runCommand ("", "haxe", [ hxml ] ); - ProcessHelper.runCommand("","MSBuild",[ targetDirectory + "/source/uwp-project.jsproj", - "/p:Configuration=Release"]); - + ProcessHelper.runCommand ("", "haxe", [ hxml ]); + + var msBuildPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\MSBuild.exe"; + var args = [ PathHelper.tryFullPath (targetDirectory + "/source/" + project.app.file + ".jsproj"), "/p:Configuration=Release" ]; + + ProcessHelper.runCommand ("", msBuildPath, args); if (noOutput) return; if (project.targetFlags.exists ("webgl")) { @@ -139,125 +139,126 @@ class WindowsPlatform extends PlatformTarget { } } - return; - } - - for (dependency in project.dependencies) { - - if (StringTools.endsWith (dependency.path, ".dll")) { - - var fileName = Path.withoutDirectory (dependency.path); - FileHelper.copyIfNewer (dependency.path, applicationDirectory + "/" + fileName); - - } - - } - - if (!project.targetFlags.exists ("static") || targetType != "cpp") { - - for (ndll in project.ndlls) { - - FileHelper.copyLibrary (project, ndll, "Windows" + (is64 ? "64" : ""), "", (ndll.haxelib != null && (ndll.haxelib.name == "hxcpp" || ndll.haxelib.name == "hxlibc")) ? ".dll" : ".ndll", applicationDirectory, project.debug); - - } - - } - - - //IconHelper.createIcon (project.icons, 32, 32, PathHelper.combine (applicationDirectory, "icon.png")); - - if (targetType == "neko") { - - ProcessHelper.runCommand ("", "haxe", [ hxml ]); - - if (noOutput) return; - - var iconPath = PathHelper.combine (applicationDirectory, "icon.ico"); - - if (!IconHelper.createWindowsIcon (icons, iconPath)) { - - iconPath = null; - - } - - NekoHelper.createWindowsExecutable (project.templatePaths, targetDirectory + "/obj/ApplicationMain.n", executablePath, iconPath); - NekoHelper.copyLibraries (project.templatePaths, "windows" + (is64 ? "64" : ""), applicationDirectory); - - } else if (targetType == "nodejs") { - - ProcessHelper.runCommand ("", "haxe", [ hxml ]); - - if (noOutput) return; - - //NekoHelper.createExecutable (project.templatePaths, "windows" + (is64 ? "64" : ""), targetDirectory + "/obj/ApplicationMain.n", executablePath); - NekoHelper.copyLibraries (project.templatePaths, "windows" + (is64 ? "64" : ""), 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); - CSHelper.addGUID (txtPath, GUID.uuid ()); - CSHelper.compile (project, targetDirectory + "/obj", applicationDirectory + project.app.file, "x86", "desktop"); } else { - var haxeArgs = [ hxml ]; - var flags = []; - - if (is64) { + for (dependency in project.dependencies) { - haxeArgs.push ("-D"); - haxeArgs.push ("HXCPP_M64"); - flags.push ("-DHXCPP_M64"); - - } else { - - flags.push ("-DHXCPP_M32"); + if (StringTools.endsWith (dependency.path, ".dll")) { + + var fileName = Path.withoutDirectory (dependency.path); + FileHelper.copyIfNewer (dependency.path, applicationDirectory + "/" + fileName); + + } } - if (!project.environment.exists ("SHOW_CONSOLE")) { + if (!project.targetFlags.exists ("static") || targetType != "cpp") { - haxeArgs.push ("-D"); - haxeArgs.push ("no_console"); - flags.push ("-Dno_console"); + for (ndll in project.ndlls) { + + FileHelper.copyLibrary (project, ndll, "Windows" + (is64 ? "64" : ""), "", (ndll.haxelib != null && (ndll.haxelib.name == "hxcpp" || ndll.haxelib.name == "hxlibc")) ? ".dll" : ".ndll", applicationDirectory, project.debug); + + } } - if (!project.targetFlags.exists ("static")) { + //IconHelper.createIcon (project.icons, 32, 32, PathHelper.combine (applicationDirectory, "icon.png")); + + if (targetType == "neko") { - ProcessHelper.runCommand ("", "haxe", haxeArgs); + ProcessHelper.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; - CPPHelper.compile (project, targetDirectory + "/obj", flags); + var iconPath = PathHelper.combine (applicationDirectory, "icon.ico"); - FileHelper.copyFile (targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : "") + ".exe", executablePath); + if (!IconHelper.createWindowsIcon (icons, iconPath)) { + + iconPath = null; + + } - } else { + NekoHelper.createWindowsExecutable (project.templatePaths, targetDirectory + "/obj/ApplicationMain.n", executablePath, iconPath); + NekoHelper.copyLibraries (project.templatePaths, "windows" + (is64 ? "64" : ""), applicationDirectory); - ProcessHelper.runCommand ("", "haxe", haxeArgs.concat ([ "-D", "static_link" ])); + } else if (targetType == "nodejs") { + + ProcessHelper.runCommand ("", "haxe", [ hxml ]); if (noOutput) return; - CPPHelper.compile (project, targetDirectory + "/obj", flags.concat ([ "-Dstatic_link" ])); - CPPHelper.compile (project, targetDirectory + "/obj", flags, "BuildMain.xml"); + //NekoHelper.createExecutable (project.templatePaths, "windows" + (is64 ? "64" : ""), targetDirectory + "/obj/ApplicationMain.n", executablePath); + NekoHelper.copyLibraries (project.templatePaths, "windows" + (is64 ? "64" : ""), applicationDirectory); - FileHelper.copyFile (targetDirectory + "/obj/Main" + (project.debug ? "-debug" : "") + ".exe", executablePath); + } else if (targetType == "cs") { - } - - var iconPath = PathHelper.combine (applicationDirectory, "icon.ico"); - - if (IconHelper.createWindowsIcon (icons, iconPath) && PlatformHelper.hostPlatform == Platform.WINDOWS) { + ProcessHelper.runCommand ("", "haxe", [ hxml ]); - var templates = [ PathHelper.getHaxelib (new Haxelib ("lime")) + "/templates" ].concat (project.templatePaths); - ProcessHelper.runCommand ("", PathHelper.findTemplate (templates, "bin/ReplaceVistaIcon.exe"), [ executablePath, iconPath, "1" ], true, true); + if (noOutput) return; + + CSHelper.copySourceFiles (project.templatePaths, targetDirectory + "/obj/src"); + var txtPath = targetDirectory + "/obj/hxcs_build.txt"; + CSHelper.addSourceFiles (txtPath, CSHelper.ndllSourceFiles); + CSHelper.addGUID (txtPath, GUID.uuid ()); + CSHelper.compile (project, targetDirectory + "/obj", applicationDirectory + project.app.file, "x86", "desktop"); + + } else { + + var haxeArgs = [ hxml ]; + var flags = []; + + if (is64) { + + haxeArgs.push ("-D"); + haxeArgs.push ("HXCPP_M64"); + flags.push ("-DHXCPP_M64"); + + } else { + + flags.push ("-DHXCPP_M32"); + + } + + if (!project.environment.exists ("SHOW_CONSOLE")) { + + haxeArgs.push ("-D"); + haxeArgs.push ("no_console"); + flags.push ("-Dno_console"); + + } + + 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); + + } 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"); + + FileHelper.copyFile (targetDirectory + "/obj/Main" + (project.debug ? "-debug" : "") + ".exe", executablePath); + + } + + var iconPath = PathHelper.combine (applicationDirectory, "icon.ico"); + + if (IconHelper.createWindowsIcon (icons, iconPath) && PlatformHelper.hostPlatform == Platform.WINDOWS) { + + var templates = [ PathHelper.getHaxelib (new Haxelib ("lime")) + "/templates" ].concat (project.templatePaths); + ProcessHelper.runCommand ("", PathHelper.findTemplate (templates, "bin/ReplaceVistaIcon.exe"), [ executablePath, iconPath, "1" ], true, true); + + } } @@ -302,10 +303,37 @@ class WindowsPlatform extends PlatformTarget { var context = project.templateContext; - context.NEKO_FILE = targetDirectory + "/obj/ApplicationMain.n"; - context.NODE_FILE = targetDirectory + "/bin/ApplicationMain.js"; - context.CPP_DIR = targetDirectory + "/obj"; - context.BUILD_DIR = project.app.path + "/windows" + (is64 ? "64" : ""); + if (targetType == "winjs") { + + context.WIN_FLASHBACKGROUND = project.window.background != null ? StringTools.hex (project.window.background, 6) : ""; + context.OUTPUT_FILE = outputFile; + + if (project.targetFlags.exists ("webgl")) { + + context.CPP_DIR = targetDirectory; + + } + + var guid = GUID.seededUuid (project.meta.packageName); + context.APP_GUID = guid; + + var guidNoBrackets = guid.split("{").join("").split("}").join(""); + context.APP_GUID_NOBRACKETS = guidNoBrackets; + + if (context.APP_DESCRIPTION == null || context.APP_DESCRIPTION == "") { + + context.APP_DESCRIPTION = project.meta.title; + + } + + } else { + + context.NEKO_FILE = targetDirectory + "/obj/ApplicationMain.n"; + context.NODE_FILE = targetDirectory + "/bin/ApplicationMain.js"; + context.CPP_DIR = targetDirectory + "/obj"; + context.BUILD_DIR = project.app.path + "/windows" + (is64 ? "64" : ""); + + } return context; @@ -314,27 +342,31 @@ class WindowsPlatform extends PlatformTarget { public override function rebuild ():Void { - if (project.environment.exists ("VS110COMNTOOLS") && project.environment.exists ("VS100COMNTOOLS")) { + if (targetType != "winjs") { - project.environment.set ("HXCPP_MSVC", project.environment.get ("VS100COMNTOOLS")); - Sys.putEnv ("HXCPP_MSVC", project.environment.get ("VS100COMNTOOLS")); + if (project.environment.exists ("VS110COMNTOOLS") && project.environment.exists ("VS100COMNTOOLS")) { + + project.environment.set ("HXCPP_MSVC", project.environment.get ("VS100COMNTOOLS")); + Sys.putEnv ("HXCPP_MSVC", project.environment.get ("VS100COMNTOOLS")); + + } + + var commands = []; + + if (targetFlags.exists ("64")) { + + commands.push ([ "-Dwindow", "-DHXCPP_M64" ]); + + } else { + + commands.push ([ "-Dwindow", "-DHXCPP_M32" ]); + + } + + CPPHelper.rebuild (project, commands); } - var commands = []; - - if (targetFlags.exists ("64")) { - - commands.push ([ "-Dwindow", "-DHXCPP_M64" ]); - - } else { - - commands.push ([ "-Dwindow", "-DHXCPP_M32" ]); - - } - - CPPHelper.rebuild (project, commands); - } @@ -352,7 +384,7 @@ class WindowsPlatform extends PlatformTarget { NodeJSHelper.run (project, targetDirectory + "/bin/ApplicationMain.js", arguments); - } else if (project.targetFlags.exists ("uwp")) { + } else if (targetType == "winjs") { /* @@ -408,10 +440,12 @@ class WindowsPlatform extends PlatformTarget { */ // Using option B because obtaining the device pin programatically does not seem possible. - ProcessHelper.runCommand ("", "regedit", [ '/s', '"' + targetDirectory + '/bin/PowerShell_Set_Unrestricted.reg"' ] ); - var test = '"& ""' + targetDirectory + '/bin/PowerShell_Set_Unrestricted.reg"""'; - ProcessHelper.runCommand ("", "powershell", [ '& ""' + targetDirectory + '/bin/source/AppPackages/uwp-project_1.0.0.0_AnyCPU_Test/Add-AppDevPackage.ps1""' ] ); - + //ProcessHelper.runCommand ("", "regedit", [ '/s', '"' + targetDirectory + '/bin/PowerShell_Set_Unrestricted.reg"' ]); + //var test = '"& ""' + targetDirectory + '/bin/PowerShell_Set_Unrestricted.reg"""'; + //Sys.command ('powershell & ""' + targetDirectory + '/bin/source/AppPackages/' + project.app.file + '_1.0.0.0_AnyCPU_Test/Add-AppDevPackage.ps1""'); + var version = project.meta.version + "." + project.meta.buildNumber; + ProcessHelper.openFile (targetDirectory + "/source/AppPackages/" + project.app.file + "_" + version + "_AnyCPU_Test", project.app.file + "_" + version + "_AnyCPU.appx"); + //source/AppPackages/uwp-project_1.0.0.0_AnyCPU_Test/Add-AppDevPackage.ps1 //HTML5Helper.launch (project, targetDirectory + "/bin"); @@ -426,237 +460,13 @@ class WindowsPlatform extends PlatformTarget { } - public function updateUwp ():Void { - - project = project.clone (); - - var destination = targetDirectory + "/source/"; - PathHelper.mkdir (destination); - - var webfontDirectory = targetDirectory + "/obj/webfont"; - var useWebfonts = true; - - for (haxelib in project.haxelibs) { - - if (haxelib.name == "openfl-html5-dom" || haxelib.name == "openfl-bitfive") { - - useWebfonts = false; - - } - - } - - var fontPath; - - for (asset in project.assets) { - - if (asset.type == AssetType.FONT) { - - if (useWebfonts) { - - fontPath = PathHelper.combine (webfontDirectory, Path.withoutDirectory (asset.targetPath)); - - if (!FileSystem.exists (fontPath)) { - - PathHelper.mkdir (webfontDirectory); - FileHelper.copyFile (asset.sourcePath, fontPath); - - asset.sourcePath = fontPath; - - HTML5Helper.generateWebfonts (project, asset); - - } - - asset.sourcePath = fontPath; - asset.targetPath = Path.withoutExtension (asset.targetPath); - - } else { - - project.haxeflags.push (HTML5Helper.generateFontData (project, asset)); - - } - - } - - } - - if (project.targetFlags.exists ("xml")) { - - project.haxeflags.push ("-xml " + targetDirectory + "/types.xml"); - - } - - if (LogHelper.verbose) { - - project.haxedefs.set ("verbose", 1); - - } - - ModuleHelper.updateProject (project); - - var libraryNames = new Map (); - - for (asset in project.assets) { - - if (asset.library != null && !libraryNames.exists (asset.library)) { - - libraryNames[asset.library] = true; - - } - - } - - //for (library in libraryNames.keys ()) { - // - //project.haxeflags.push ("-resource " + targetDirectory + "/obj/manifest/" + library + ".json@__ASSET_MANIFEST__" + library); - // - //} - - //project.haxeflags.push ("-resource " + targetDirectory + "/obj/manifest/default.json@__ASSET_MANIFEST__default"); - - var context = project.templateContext; - - context.WIN_FLASHBACKGROUND = project.window.background != null ? StringTools.hex (project.window.background, 6) : ""; - context.OUTPUT_DIR = targetDirectory; - context.OUTPUT_FILE = outputFile; - - if (project.targetFlags.exists ("webgl")) { - - context.CPP_DIR = targetDirectory; - - } - - context.favicons = []; - - var icons = project.icons; - - if (icons.length == 0) { - - icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ]; - - } - - //if (IconHelper.createWindowsIcon (icons, PathHelper.combine (destination, "favicon.ico"))) { - // - //context.favicons.push ({ rel: "icon", type: "image/x-icon", href: "./favicon.ico" }); - // - //} - - if (IconHelper.createIcon (icons, 192, 192, PathHelper.combine (destination, "favicon.png"))) { - - context.favicons.push ({ rel: "shortcut icon", type: "image/png", href: "./favicon.png" }); - - } - - context.linkedLibraries = []; - - for (dependency in project.dependencies) { - - Sys.println("found dependency: " + dependency.name + " path: " + dependency.path); - - - if (StringTools.endsWith (dependency.name, ".js")) { - - context.linkedLibraries.push (dependency.name); - - } else if (StringTools.endsWith (dependency.path, ".js") && FileSystem.exists (dependency.path)) { - - var name = Path.withoutDirectory (dependency.path); - - context.linkedLibraries.push ("./js/lib/" + name); - FileHelper.copyIfNewer (dependency.path, PathHelper.combine (destination, PathHelper.combine ("js/lib", name))); - - } - - } - - var seed = "unknown"; - if(project.defines.exists("APP_PACKAGE")) { - seed = project.defines.get("APP_PACKAGE"); - } else if(project.defines.exists("APP_TITLE")) { - seed = project.defines.get("APP_TITLE"); - } - var guid = GUID.seededUuid(seed); - context.APP_GUID = guid; - var guidNoBrackets = guid.split("{").join("").split("}").join(""); - context.APP_GUID_NOBRACKETS = guidNoBrackets; - context.APP_DESCRIPTION = project.defines.get("APP_DESCRIPTION") != null ? - project.defines.get("APP_DESCRIPTION") : project.defines.get("APP_TITLE"); - - for (asset in project.assets) { - - var path = PathHelper.combine (destination, asset.targetPath); - - if (asset.type != AssetType.TEMPLATE) { - - if (asset.type != AssetType.FONT) { - - PathHelper.mkdir (Path.directory (path)); - FileHelper.copyAssetIfNewer (asset, path); - - } else if (useWebfonts) { - - PathHelper.mkdir (Path.directory (path)); - var ext = "." + Path.extension (asset.sourcePath); - var source = Path.withoutExtension (asset.sourcePath); - - for (extension in [ ext, ".eot", ".woff", ".svg" ]) { - - if (FileSystem.exists (source + extension)) { - - FileHelper.copyIfNewer (source + extension, path + extension); - - } else { - - LogHelper.warn ("Could not find generated font file \"" + source + extension + "\""); - - } - - } - - } - - } - - } - - FileHelper.recursiveCopyTemplate (project.templatePaths, "windows/template", targetDirectory, context); - - if (project.app.main != null) { - - FileHelper.recursiveCopyTemplate (project.templatePaths, "haxe", targetDirectory + "/haxe", context); - FileHelper.recursiveCopyTemplate (project.templatePaths, "windows/haxe", targetDirectory + "/haxe", context, true, false); - FileHelper.recursiveCopyTemplate (project.templatePaths, "windows/hxml", targetDirectory + "/haxe", context); - - if (project.targetFlags.exists ("webgl")) { - - FileHelper.recursiveCopyTemplate (project.templatePaths, "webgl/hxml", targetDirectory + "/haxe", context, true, false); - - } - - } - - for (asset in project.assets) { - - var path = PathHelper.combine (destination, asset.targetPath); - - if (asset.type == AssetType.TEMPLATE) { - - PathHelper.mkdir (Path.directory (path)); - FileHelper.copyAsset (asset, path, context); - - } - - } - - } - - public override function update ():Void { - if(project.targetFlags.exists("uwp")) { - updateUwp(); + if (targetType == "winjs") { + + updateUWP (); return; + } project = project.clone (); @@ -755,6 +565,227 @@ class WindowsPlatform extends PlatformTarget { } + private function updateUWP ():Void { + + project = project.clone (); + + var destination = targetDirectory + "/source/"; + PathHelper.mkdir (destination); + + var webfontDirectory = targetDirectory + "/obj/webfont"; + var useWebfonts = true; + + for (haxelib in project.haxelibs) { + + if (haxelib.name == "openfl-html5-dom" || haxelib.name == "openfl-bitfive") { + + useWebfonts = false; + + } + + } + + var fontPath; + + for (asset in project.assets) { + + if (asset.type == AssetType.FONT) { + + if (useWebfonts) { + + fontPath = PathHelper.combine (webfontDirectory, Path.withoutDirectory (asset.targetPath)); + + if (!FileSystem.exists (fontPath)) { + + PathHelper.mkdir (webfontDirectory); + FileHelper.copyFile (asset.sourcePath, fontPath); + + asset.sourcePath = fontPath; + + HTML5Helper.generateWebfonts (project, asset); + + } + + asset.sourcePath = fontPath; + asset.targetPath = Path.withoutExtension (asset.targetPath); + + } else { + + project.haxeflags.push (HTML5Helper.generateFontData (project, asset)); + + } + + } + + } + + if (project.targetFlags.exists ("xml")) { + + project.haxeflags.push ("-xml " + targetDirectory + "/types.xml"); + + } + + if (LogHelper.verbose) { + + project.haxedefs.set ("verbose", 1); + + } + + ModuleHelper.updateProject (project); + + var libraryNames = new Map (); + + for (asset in project.assets) { + + if (asset.library != null && !libraryNames.exists (asset.library)) { + + libraryNames[asset.library] = true; + + } + + } + + //for (library in libraryNames.keys ()) { + // + //project.haxeflags.push ("-resource " + targetDirectory + "/obj/manifest/" + library + ".json@__ASSET_MANIFEST__" + library); + // + //} + + //project.haxeflags.push ("-resource " + targetDirectory + "/obj/manifest/default.json@__ASSET_MANIFEST__default"); + + var context = generateContext (); + context.OUTPUT_DIR = targetDirectory; + + context.favicons = []; + + var icons = project.icons; + + if (icons.length == 0) { + + icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ]; + + } + + //if (IconHelper.createWindowsIcon (icons, PathHelper.combine (destination, "favicon.ico"))) { + // + //context.favicons.push ({ rel: "icon", type: "image/x-icon", href: "./favicon.ico" }); + // + //} + + if (IconHelper.createIcon (icons, 192, 192, PathHelper.combine (destination, "favicon.png"))) { + + context.favicons.push ({ rel: "shortcut icon", type: "image/png", href: "./favicon.png" }); + + } + + context.linkedLibraries = []; + + for (dependency in project.dependencies) { + + if (StringTools.endsWith (dependency.name, ".js")) { + + context.linkedLibraries.push (dependency.name); + + } else if (StringTools.endsWith (dependency.path, ".js") && FileSystem.exists (dependency.path)) { + + var name = Path.withoutDirectory (dependency.path); + + context.linkedLibraries.push ("./js/lib/" + name); + FileHelper.copyIfNewer (dependency.path, PathHelper.combine (destination, PathHelper.combine ("js/lib", name))); + + } + + } + + for (asset in project.assets) { + + var path = PathHelper.combine (destination, asset.targetPath); + + if (asset.type != AssetType.TEMPLATE) { + + if (asset.type != AssetType.FONT) { + + PathHelper.mkdir (Path.directory (path)); + FileHelper.copyAssetIfNewer (asset, path); + + } else if (useWebfonts) { + + PathHelper.mkdir (Path.directory (path)); + var ext = "." + Path.extension (asset.sourcePath); + var source = Path.withoutExtension (asset.sourcePath); + + for (extension in [ ext, ".eot", ".woff", ".svg" ]) { + + if (FileSystem.exists (source + extension)) { + + FileHelper.copyIfNewer (source + extension, path + extension); + + } else { + + LogHelper.warn ("Could not find generated font file \"" + source + extension + "\""); + + } + + } + + } + + } + + } + + FileHelper.recursiveCopyTemplate (project.templatePaths, "winjs/template", targetDirectory, context); + + var renamePaths = [ "uwp-project.sln", "source/uwp-project.jsproj", "source/uwp-project_TemporaryKey.pfx" ]; + var fullPath; + + for (path in renamePaths) { + + fullPath = targetDirectory + "/" + path; + + try { + + if (FileSystem.exists (fullPath)) { + + File.copy (fullPath, targetDirectory + "/" + StringTools.replace (path, "uwp-project", project.app.file)); + FileSystem.deleteFile (fullPath); + + } + + } catch (e:Dynamic) {} + + } + + if (project.app.main != null) { + + FileHelper.recursiveCopyTemplate (project.templatePaths, "haxe", targetDirectory + "/haxe", context); + FileHelper.recursiveCopyTemplate (project.templatePaths, "winjs/haxe", targetDirectory + "/haxe", context, true, false); + FileHelper.recursiveCopyTemplate (project.templatePaths, "winjs/hxml", targetDirectory + "/haxe", context); + + if (project.targetFlags.exists ("webgl")) { + + FileHelper.recursiveCopyTemplate (project.templatePaths, "webgl/hxml", targetDirectory + "/haxe", context, true, false); + + } + + } + + for (asset in project.assets) { + + var path = PathHelper.combine (destination, asset.targetPath); + + if (asset.type == AssetType.TEMPLATE) { + + PathHelper.mkdir (Path.directory (path)); + FileHelper.copyAsset (asset, path, context); + + } + + } + + } + + @ignore public override function install ():Void {} @ignore public override function trace ():Void {} @ignore public override function uninstall ():Void {} diff --git a/templates/haxe/ManifestResources.hx b/templates/haxe/ManifestResources.hx index f61726b1c..fbd8cc783 100644 --- a/templates/haxe/ManifestResources.hx +++ b/templates/haxe/ManifestResources.hx @@ -37,7 +37,7 @@ import sys.FileSystem; #if (ios || tvos || emscripten) rootPath = "assets/"; - #elseif (windows && !cs) + #elseif (sys && windows && !cs) rootPath = FileSystem.absolutePath (haxe.io.Path.directory (#if (haxe_ver >= 3.3) Sys.programPath () #else Sys.executablePath () #end)) + "/"; #else rootPath = ""; diff --git a/templates/windows/hxswfml.n b/templates/windows/hxswfml.n deleted file mode 100644 index 08b25cd86..000000000 Binary files a/templates/windows/hxswfml.n and /dev/null differ diff --git a/templates/windows/hxml/debug.hxml b/templates/winjs/hxml/debug.hxml similarity index 79% rename from templates/windows/hxml/debug.hxml rename to templates/winjs/hxml/debug.hxml index b7f2af904..b887ec5c1 100644 --- a/templates/windows/hxml/debug.hxml +++ b/templates/winjs/hxml/debug.hxml @@ -3,4 +3,7 @@ -cp ::OUTPUT_DIR::/haxe -D html5 -D html +-D windows +-D winjs +-D uwp -debug diff --git a/templates/windows/hxml/final.hxml b/templates/winjs/hxml/final.hxml similarity index 77% rename from templates/windows/hxml/final.hxml rename to templates/winjs/hxml/final.hxml index 6380d12fd..9c8a928bf 100644 --- a/templates/windows/hxml/final.hxml +++ b/templates/winjs/hxml/final.hxml @@ -3,6 +3,9 @@ -cp ::OUTPUT_DIR::/haxe -D html5 -D html +-D windows +-D winjs +-D uwp -D final -D js-flatten -dce full \ No newline at end of file diff --git a/templates/windows/hxml/release.hxml b/templates/winjs/hxml/release.hxml similarity index 72% rename from templates/windows/hxml/release.hxml rename to templates/winjs/hxml/release.hxml index 35c7cec78..9c63095f9 100644 --- a/templates/windows/hxml/release.hxml +++ b/templates/winjs/hxml/release.hxml @@ -2,4 +2,7 @@ -js ::OUTPUT_FILE:: -cp ::OUTPUT_DIR::/haxe -D html5 --D html \ No newline at end of file +-D html +-D windows +-D winjs +-D uwp \ No newline at end of file diff --git a/templates/windows/template/PowerShell_Set_Unrestricted.reg b/templates/winjs/template/PowerShell_Set_Unrestricted.reg similarity index 100% rename from templates/windows/template/PowerShell_Set_Unrestricted.reg rename to templates/winjs/template/PowerShell_Set_Unrestricted.reg diff --git a/templates/windows/template/source/css/default.css b/templates/winjs/template/source/css/default.css similarity index 95% rename from templates/windows/template/source/css/default.css rename to templates/winjs/template/source/css/default.css index 7508dfca5..74e87ccaa 100644 --- a/templates/windows/template/source/css/default.css +++ b/templates/winjs/template/source/css/default.css @@ -1,5 +1,5 @@ -body { - /* Uncomment this to enable scrolling and zooming - touch-action: manipulation; - */ -} +body { + /* Uncomment this to enable scrolling and zooming + touch-action: manipulation; + */ +} diff --git a/templates/windows/template/source/images/LockScreenLogo.scale-200.png b/templates/winjs/template/source/images/LockScreenLogo.scale-200.png similarity index 100% rename from templates/windows/template/source/images/LockScreenLogo.scale-200.png rename to templates/winjs/template/source/images/LockScreenLogo.scale-200.png diff --git a/templates/windows/template/source/images/SplashScreen.scale-200.png b/templates/winjs/template/source/images/SplashScreen.scale-200.png similarity index 100% rename from templates/windows/template/source/images/SplashScreen.scale-200.png rename to templates/winjs/template/source/images/SplashScreen.scale-200.png diff --git a/templates/windows/template/source/images/Square150x150Logo.scale-200.png b/templates/winjs/template/source/images/Square150x150Logo.scale-200.png similarity index 100% rename from templates/windows/template/source/images/Square150x150Logo.scale-200.png rename to templates/winjs/template/source/images/Square150x150Logo.scale-200.png diff --git a/templates/windows/template/source/images/Square44x44Logo.scale-200.png b/templates/winjs/template/source/images/Square44x44Logo.scale-200.png similarity index 100% rename from templates/windows/template/source/images/Square44x44Logo.scale-200.png rename to templates/winjs/template/source/images/Square44x44Logo.scale-200.png diff --git a/templates/windows/template/source/images/Square44x44Logo.targetsize-24_altform-unplated.png b/templates/winjs/template/source/images/Square44x44Logo.targetsize-24_altform-unplated.png similarity index 100% rename from templates/windows/template/source/images/Square44x44Logo.targetsize-24_altform-unplated.png rename to templates/winjs/template/source/images/Square44x44Logo.targetsize-24_altform-unplated.png diff --git a/templates/windows/template/source/images/StoreLogo.png b/templates/winjs/template/source/images/StoreLogo.png similarity index 100% rename from templates/windows/template/source/images/StoreLogo.png rename to templates/winjs/template/source/images/StoreLogo.png diff --git a/templates/windows/template/source/images/Wide310x150Logo.scale-200.png b/templates/winjs/template/source/images/Wide310x150Logo.scale-200.png similarity index 100% rename from templates/windows/template/source/images/Wide310x150Logo.scale-200.png rename to templates/winjs/template/source/images/Wide310x150Logo.scale-200.png diff --git a/templates/windows/template/source/index.html b/templates/winjs/template/source/index.html similarity index 97% rename from templates/windows/template/source/index.html rename to templates/winjs/template/source/index.html index 381a53830..59e4125e8 100644 --- a/templates/windows/template/source/index.html +++ b/templates/winjs/template/source/index.html @@ -1,52 +1,52 @@ - - - - - ::APP_TITLE:: - ::guid:: - - - - ::if favicons::::foreach (favicons):: - ::end::::end:: - - ::if linkedLibraries::::foreach (linkedLibraries):: - ::end::::end:: - - - - - - - - - - - - ::foreach assets::::if (type == "font"):: - ::end::::end:: - -
- - - - + + + + + ::APP_TITLE:: - ::guid:: + + + + ::if favicons::::foreach (favicons):: + ::end::::end:: + + ::if linkedLibraries::::foreach (linkedLibraries):: + ::end::::end:: + + + + + + + + + + + + ::foreach assets::::if (type == "font"):: + ::end::::end:: + +
+ + + + diff --git a/templates/windows/template/source/js/main.js b/templates/winjs/template/source/js/main.js similarity index 97% rename from templates/windows/template/source/js/main.js rename to templates/winjs/template/source/js/main.js index e6f5b30e6..ae0bd3dfc 100644 --- a/templates/windows/template/source/js/main.js +++ b/templates/winjs/template/source/js/main.js @@ -1,73 +1,73 @@ -// For an introduction to the Blank template, see the following documentation: -// https://go.microsoft.com/fwlink/?LinkId=232509 - -(function () { - "use strict"; - - if(typeof Windows !== "undefined") { - initUWP(); - } else { - lime.embed ("::APP_FILE::", "content", ::WIN_WIDTH::, ::WIN_HEIGHT::); - } - - - function initUWP() { - var app = WinJS.Application; - var activation = Windows.ApplicationModel.Activation; - var isFirstActivation = true; - - app.onactivated = function (args) { - if (args.detail.kind === activation.ActivationKind.voiceCommand) { - // TODO: Handle relevant ActivationKinds. For example, if your app can be started by voice commands, - // this is a good place to decide whether to populate an input field or choose a different initial view. - } - else if (args.detail.kind === activation.ActivationKind.launch) { - // A Launch activation happens when the user launches your app via the tile - // or invokes a toast notification by clicking or tapping on the body. - if (args.detail.arguments) { - // TODO: If the app supports toasts, use this value from the toast payload to determine where in the app - // to take the user in response to them invoking a toast notification. - } - else if (args.detail.previousExecutionState === activation.ApplicationExecutionState.terminated) { - // TODO: This application had been suspended and was then terminated to reclaim memory. - // To create a smooth user experience, restore application state here so that it looks like the app never stopped running. - // Note: You may want to record the time when the app was last suspended and only restore state if they've returned after a short period. - } - } - - if (!args.detail.prelaunchActivated) { - // TODO: If prelaunchActivated were true, it would mean the app was prelaunched in the background as an optimization. - // In that case it would be suspended shortly thereafter. - // Any long-running operations (like expensive network or disk I/O) or changes to user state which occur at launch - // should be done here (to avoid doing them in the prelaunch case). - // Alternatively, this work can be done in a resume or visibilitychanged handler. - } - - if (isFirstActivation) { - // TODO: The app was activated and had not been running. Do general startup initialization here. - Debug.writeln("app.onactivated isFirstActivation"); - lime.embed ("::APP_FILE::", "content", ::WIN_WIDTH::, ::WIN_HEIGHT::); - document.addEventListener("visibilitychange", onVisibilityChanged); - args.setPromise(WinJS.UI.processAll()); - } - - isFirstActivation = false; - }; - - function onVisibilityChanged(args) { - if (!document.hidden) { - // TODO: The app just became visible. This may be a good time to refresh the view. - } - } - - app.oncheckpoint = function (args) { - // TODO: This application is about to be suspended. Save any state that needs to persist across suspensions here. - // You might use the WinJS.Application.sessionState object, which is automatically saved and restored across suspension. - // If you need to complete an asynchronous operation before your application is suspended, call args.setPromise(). - }; - - app.start(); - } - - -})(); +// For an introduction to the Blank template, see the following documentation: +// https://go.microsoft.com/fwlink/?LinkId=232509 + +(function () { + "use strict"; + + if(typeof Windows !== "undefined") { + initUWP(); + } else { + lime.embed ("::APP_FILE::", "content", ::WIN_WIDTH::, ::WIN_HEIGHT::); + } + + + function initUWP() { + var app = WinJS.Application; + var activation = Windows.ApplicationModel.Activation; + var isFirstActivation = true; + + app.onactivated = function (args) { + if (args.detail.kind === activation.ActivationKind.voiceCommand) { + // TODO: Handle relevant ActivationKinds. For example, if your app can be started by voice commands, + // this is a good place to decide whether to populate an input field or choose a different initial view. + } + else if (args.detail.kind === activation.ActivationKind.launch) { + // A Launch activation happens when the user launches your app via the tile + // or invokes a toast notification by clicking or tapping on the body. + if (args.detail.arguments) { + // TODO: If the app supports toasts, use this value from the toast payload to determine where in the app + // to take the user in response to them invoking a toast notification. + } + else if (args.detail.previousExecutionState === activation.ApplicationExecutionState.terminated) { + // TODO: This application had been suspended and was then terminated to reclaim memory. + // To create a smooth user experience, restore application state here so that it looks like the app never stopped running. + // Note: You may want to record the time when the app was last suspended and only restore state if they've returned after a short period. + } + } + + if (!args.detail.prelaunchActivated) { + // TODO: If prelaunchActivated were true, it would mean the app was prelaunched in the background as an optimization. + // In that case it would be suspended shortly thereafter. + // Any long-running operations (like expensive network or disk I/O) or changes to user state which occur at launch + // should be done here (to avoid doing them in the prelaunch case). + // Alternatively, this work can be done in a resume or visibilitychanged handler. + } + + if (isFirstActivation) { + // TODO: The app was activated and had not been running. Do general startup initialization here. + Debug.writeln("app.onactivated isFirstActivation"); + lime.embed ("::APP_FILE::", "content", ::WIN_WIDTH::, ::WIN_HEIGHT::); + document.addEventListener("visibilitychange", onVisibilityChanged); + args.setPromise(WinJS.UI.processAll()); + } + + isFirstActivation = false; + }; + + function onVisibilityChanged(args) { + if (!document.hidden) { + // TODO: The app just became visible. This may be a good time to refresh the view. + } + } + + app.oncheckpoint = function (args) { + // TODO: This application is about to be suspended. Save any state that needs to persist across suspensions here. + // You might use the WinJS.Application.sessionState object, which is automatically saved and restored across suspension. + // If you need to complete an asynchronous operation before your application is suspended, call args.setPromise(). + }; + + app.start(); + } + + +})(); diff --git a/templates/windows/template/source/lib/winjs-4.0.1/css/ui-dark.css b/templates/winjs/template/source/lib/winjs-4.0.1/css/ui-dark.css similarity index 100% rename from templates/windows/template/source/lib/winjs-4.0.1/css/ui-dark.css rename to templates/winjs/template/source/lib/winjs-4.0.1/css/ui-dark.css diff --git a/templates/windows/template/source/lib/winjs-4.0.1/css/ui-light.css b/templates/winjs/template/source/lib/winjs-4.0.1/css/ui-light.css similarity index 100% rename from templates/windows/template/source/lib/winjs-4.0.1/css/ui-light.css rename to templates/winjs/template/source/lib/winjs-4.0.1/css/ui-light.css diff --git a/templates/windows/template/source/lib/winjs-4.0.1/fonts/Symbols.ttf b/templates/winjs/template/source/lib/winjs-4.0.1/fonts/Symbols.ttf similarity index 100% rename from templates/windows/template/source/lib/winjs-4.0.1/fonts/Symbols.ttf rename to templates/winjs/template/source/lib/winjs-4.0.1/fonts/Symbols.ttf diff --git a/templates/windows/template/source/lib/winjs-4.0.1/js/base.js b/templates/winjs/template/source/lib/winjs-4.0.1/js/base.js similarity index 100% rename from templates/windows/template/source/lib/winjs-4.0.1/js/base.js rename to templates/winjs/template/source/lib/winjs-4.0.1/js/base.js diff --git a/templates/windows/template/source/lib/winjs-4.0.1/js/ui.js b/templates/winjs/template/source/lib/winjs-4.0.1/js/ui.js similarity index 100% rename from templates/windows/template/source/lib/winjs-4.0.1/js/ui.js rename to templates/winjs/template/source/lib/winjs-4.0.1/js/ui.js diff --git a/templates/windows/template/source/package.appxmanifest b/templates/winjs/template/source/package.appxmanifest similarity index 95% rename from templates/windows/template/source/package.appxmanifest rename to templates/winjs/template/source/package.appxmanifest index 33c9068da..e5c76ac79 100644 --- a/templates/windows/template/source/package.appxmanifest +++ b/templates/winjs/template/source/package.appxmanifest @@ -1,52 +1,52 @@ - - - - - - - - - ::APP_TITLE:: - ::APP_COMPANY:: - images\storelogo.png - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + ::APP_TITLE:: + ::APP_COMPANY:: + images\storelogo.png + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/windows/template/source/uwp-project.jsproj b/templates/winjs/template/source/uwp-project.jsproj similarity index 94% rename from templates/windows/template/source/uwp-project.jsproj rename to templates/winjs/template/source/uwp-project.jsproj index 24c10df5f..d32578b29 100644 --- a/templates/windows/template/source/uwp-project.jsproj +++ b/templates/winjs/template/source/uwp-project.jsproj @@ -1,100 +1,100 @@ - - - - - Debug - AnyCPU - - - Debug - ARM - - - Debug - x64 - - - Debug - x86 - - - Release - AnyCPU - - - Release - ARM - true - - - Release - x64 - true - - - Release - x86 - true - - - - e9d48192-1008-49be-8a59-932a3ef1a1ca - - - - 14.0 - - - - - UAP - 10.0.15063.0 - 10.0.10586.0 - $(VersionNumberMajor).$(VersionNumberMinor) - en-US - - uwp-project_TemporaryKey.pfx - - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + AnyCPU + + + Debug + ARM + + + Debug + x64 + + + Debug + x86 + + + Release + AnyCPU + + + Release + ARM + true + + + Release + x64 + true + + + Release + x86 + true + + + + e9d48192-1008-49be-8a59-932a3ef1a1ca + + + + 14.0 + + + + + UAP + 10.0.15063.0 + 10.0.10586.0 + $(VersionNumberMajor).$(VersionNumberMinor) + en-US + + ::APP_FILE::_TemporaryKey.pfx + + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/windows/template/source/uwp-project_TemporaryKey.pfx b/templates/winjs/template/source/uwp-project_TemporaryKey.pfx similarity index 100% rename from templates/windows/template/source/uwp-project_TemporaryKey.pfx rename to templates/winjs/template/source/uwp-project_TemporaryKey.pfx diff --git a/templates/windows/template/uwp-project.sln b/templates/winjs/template/uwp-project.sln similarity index 93% rename from templates/windows/template/uwp-project.sln rename to templates/winjs/template/uwp-project.sln index d337d3e39..31cf09fda 100644 --- a/templates/windows/template/uwp-project.sln +++ b/templates/winjs/template/uwp-project.sln @@ -1,48 +1,48 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.16 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "uwp-project", "source\uwp-project.jsproj", "{E9D48192-1008-49BE-8A59-932A3EF1A1CA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|ARM.ActiveCfg = Debug|ARM - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|ARM.Build.0 = Debug|ARM - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|ARM.Deploy.0 = Debug|ARM - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|x64.ActiveCfg = Debug|x64 - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|x64.Build.0 = Debug|x64 - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|x64.Deploy.0 = Debug|x64 - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|x86.ActiveCfg = Debug|x86 - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|x86.Build.0 = Debug|x86 - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|x86.Deploy.0 = Debug|x86 - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|Any CPU.Build.0 = Release|Any CPU - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|Any CPU.Deploy.0 = Release|Any CPU - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|ARM.ActiveCfg = Release|ARM - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|ARM.Build.0 = Release|ARM - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|ARM.Deploy.0 = Release|ARM - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|x64.ActiveCfg = Release|x64 - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|x64.Build.0 = Release|x64 - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|x64.Deploy.0 = Release|x64 - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|x86.ActiveCfg = Release|x86 - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|x86.Build.0 = Release|x86 - {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|x86.Deploy.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26430.16 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "::APP_FILE::", "source\::APP_FILE::.jsproj", "{E9D48192-1008-49BE-8A59-932A3EF1A1CA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|ARM.ActiveCfg = Debug|ARM + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|ARM.Build.0 = Debug|ARM + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|ARM.Deploy.0 = Debug|ARM + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|x64.ActiveCfg = Debug|x64 + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|x64.Build.0 = Debug|x64 + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|x64.Deploy.0 = Debug|x64 + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|x86.ActiveCfg = Debug|x86 + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|x86.Build.0 = Debug|x86 + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Debug|x86.Deploy.0 = Debug|x86 + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|Any CPU.Build.0 = Release|Any CPU + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|Any CPU.Deploy.0 = Release|Any CPU + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|ARM.ActiveCfg = Release|ARM + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|ARM.Build.0 = Release|ARM + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|ARM.Deploy.0 = Release|ARM + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|x64.ActiveCfg = Release|x64 + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|x64.Build.0 = Release|x64 + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|x64.Deploy.0 = Release|x64 + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|x86.ActiveCfg = Release|x86 + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|x86.Build.0 = Release|x86 + {E9D48192-1008-49BE-8A59-932A3EF1A1CA}.Release|x86.Deploy.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx index 6a8646e6a..9e9456374 100644 --- a/tools/CommandLineTools.hx +++ b/tools/CommandLineTools.hx @@ -703,11 +703,7 @@ class CommandLineTools { case HTML5: - if(targetFlags.exists ("uwp")) { - platform = new WindowsPlatform (command, project, targetFlags); - } else { - platform = new HTML5Platform (command, project, targetFlags); - } + platform = new HTML5Platform (command, project, targetFlags); case FIREFOX: @@ -1711,6 +1707,12 @@ class CommandLineTools { target = Platform.EMSCRIPTEN; targetFlags.set ("webassembly", ""); + case "winjs", "uwp": + + target = Platform.WINDOWS; + targetFlags.set ("uwp", ""); + targetFlags.set ("winjs", ""); + default: target = cast targetName.toLowerCase ();