Skip to content

Commit

Permalink
add -json flag to allow json types export
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjamuffin99 authored and joshtynjala committed Jan 10, 2025
1 parent ff3ccf1 commit 03ea041
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/platforms/AndroidPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
5 changes: 5 additions & 0 deletions tools/platforms/FlashPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions tools/platforms/HTML5Platform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions tools/platforms/IOSPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
{
Expand Down
5 changes: 5 additions & 0 deletions tools/platforms/LinuxPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 5 additions & 0 deletions tools/platforms/MacPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "")
Expand Down
5 changes: 5 additions & 0 deletions tools/platforms/TVOSPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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", "");
Expand Down
5 changes: 5 additions & 0 deletions tools/platforms/TizenPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions tools/platforms/WindowsPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "")
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 03ea041

Please sign in to comment.