From 03ea041e0e38e54e4f8c2816d040141b06a02d21 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Thu, 2 Jan 2025 21:23:51 -0800 Subject: [PATCH] add `-json` flag to allow json types export --- tools/platforms/AndroidPlatform.hx | 5 +++++ tools/platforms/FlashPlatform.hx | 5 +++++ tools/platforms/HTML5Platform.hx | 5 +++++ tools/platforms/IOSPlatform.hx | 5 +++++ tools/platforms/LinuxPlatform.hx | 5 +++++ tools/platforms/MacPlatform.hx | 5 +++++ tools/platforms/TVOSPlatform.hx | 5 +++++ tools/platforms/TizenPlatform.hx | 5 +++++ tools/platforms/WindowsPlatform.hx | 10 ++++++++++ 9 files changed, 50 insertions(+) diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx index 4d4caaaf12..8451d2a70c 100644 --- a/tools/platforms/AndroidPlatform.hx +++ b/tools/platforms/AndroidPlatform.hx @@ -459,6 +459,11 @@ class AndroidPlatform extends PlatformTarget project.haxeflags.push("-xml " + targetDirectory + "/types.xml"); } + if (project.targetFlags.exists("json")) + { + project.haxeflags.push("--json " + targetDirectory + "/types.json"); + } + var context = project.templateContext; context.CPP_DIR = targetDirectory + "/obj"; diff --git a/tools/platforms/FlashPlatform.hx b/tools/platforms/FlashPlatform.hx index 21828d2a39..b6994c5567 100644 --- a/tools/platforms/FlashPlatform.hx +++ b/tools/platforms/FlashPlatform.hx @@ -139,6 +139,11 @@ class FlashPlatform extends PlatformTarget project.haxeflags.push("-xml " + targetDirectory + "/types.xml"); } + if (project.targetFlags.exists("json")) + { + project.haxeflags.push("--json " + targetDirectory + "/types.json"); + } + if (Log.verbose) { project.haxedefs.set("verbose", 1); diff --git a/tools/platforms/HTML5Platform.hx b/tools/platforms/HTML5Platform.hx index a5bbaf76b3..f76b862d77 100644 --- a/tools/platforms/HTML5Platform.hx +++ b/tools/platforms/HTML5Platform.hx @@ -353,6 +353,11 @@ class HTML5Platform extends PlatformTarget project.haxeflags.push("-xml " + targetDirectory + "/types.xml"); } + if (project.targetFlags.exists("json")) + { + project.haxeflags.push("--json " + targetDirectory + "/types.json"); + } + if (Log.verbose) { project.haxedefs.set("verbose", 1); diff --git a/tools/platforms/IOSPlatform.hx b/tools/platforms/IOSPlatform.hx index e13a9cdffd..cd1cca6618 100644 --- a/tools/platforms/IOSPlatform.hx +++ b/tools/platforms/IOSPlatform.hx @@ -169,6 +169,11 @@ class IOSPlatform extends PlatformTarget { project.haxeflags.push("-xml " + targetDirectory + "/types.xml"); } + + if (project.targetFlags.exists("json")) + { + project.haxeflags.push("--json " + targetDirectory + "/types.json"); + } if (project.targetFlags.exists("final")) { diff --git a/tools/platforms/LinuxPlatform.hx b/tools/platforms/LinuxPlatform.hx index 61b00e828f..66a1d0b468 100644 --- a/tools/platforms/LinuxPlatform.hx +++ b/tools/platforms/LinuxPlatform.hx @@ -556,6 +556,11 @@ class LinuxPlatform extends PlatformTarget project.haxeflags.push("-xml " + targetDirectory + "/types.xml"); } + if (project.targetFlags.exists("json")) + { + project.haxeflags.push("--json " + targetDirectory + "/types.json"); + } + var context = generateContext(); context.OUTPUT_DIR = targetDirectory; diff --git a/tools/platforms/MacPlatform.hx b/tools/platforms/MacPlatform.hx index 6c540b4303..64b89f5651 100644 --- a/tools/platforms/MacPlatform.hx +++ b/tools/platforms/MacPlatform.hx @@ -507,6 +507,11 @@ class MacPlatform extends PlatformTarget project.haxeflags.push("-xml " + targetDirectory + "/types.xml"); } + if (project.targetFlags.exists("json")) + { + project.haxeflags.push("--json " + targetDirectory + "/types.json"); + } + for (asset in project.assets) { if (asset.embed && asset.sourcePath == "") diff --git a/tools/platforms/TVOSPlatform.hx b/tools/platforms/TVOSPlatform.hx index 76714971c7..bf67f7897e 100644 --- a/tools/platforms/TVOSPlatform.hx +++ b/tools/platforms/TVOSPlatform.hx @@ -168,6 +168,11 @@ class TVOSPlatform extends PlatformTarget project.haxeflags.push("-xml " + targetDirectory + "/types.xml"); } + if (project.targetFlags.exists("json")) + { + project.haxeflags.push("--json " + targetDirectory + "/types.json"); + } + if (project.targetFlags.exists("final")) { project.haxedefs.set("final", ""); diff --git a/tools/platforms/TizenPlatform.hx b/tools/platforms/TizenPlatform.hx index 0ad18008dd..49bc7e9480 100644 --- a/tools/platforms/TizenPlatform.hx +++ b/tools/platforms/TizenPlatform.hx @@ -227,6 +227,11 @@ class TizenPlatform extends PlatformTarget project.haxeflags.push("-xml " + targetDirectory + "/types.xml"); } + if (project.targetFlags.exists("json")) + { + project.haxeflags.push("--json " + targetDirectory + "/types.json"); + } + var context = project.templateContext; context.CPP_DIR = targetDirectory + "/obj"; context.OUTPUT_DIR = targetDirectory; diff --git a/tools/platforms/WindowsPlatform.hx b/tools/platforms/WindowsPlatform.hx index a3019c0aed..98c5eea328 100644 --- a/tools/platforms/WindowsPlatform.hx +++ b/tools/platforms/WindowsPlatform.hx @@ -921,6 +921,11 @@ class WindowsPlatform extends PlatformTarget project.haxeflags.push("-xml " + targetDirectory + "/types.xml"); } + if (project.targetFlags.exists("json")) + { + project.haxeflags.push("--json " + targetDirectory + "/types.json"); + } + for (asset in project.assets) { if (asset.embed && asset.sourcePath == "") @@ -1067,6 +1072,11 @@ class WindowsPlatform extends PlatformTarget project.haxeflags.push("-xml " + targetDirectory + "/types.xml"); } + if (project.targetFlags.exists("json")) + { + project.haxeflags.push("--json " + targetDirectory + "/types.json"); + } + if (Log.verbose) { project.haxedefs.set("verbose", 1);