Skip to content

Commit

Permalink
Add hxml parsing support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanrishatum committed Aug 25, 2018
1 parent 9fdd1bf commit 413b342
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
16 changes: 4 additions & 12 deletions HLCompiler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -340,29 +340,21 @@ class HLCompiler
var hxmlPath:String = path;
base.resolveIncludes(Path.directory(path));
base.resolveLibraries();
var found:Hxml = null;
for(x in base.generateTargetHxmls())
{
var targets = x.getTargets();
for(t in targets)
{
if (t.target.indexOf("-hl") != -1 && StringTools.endsWith(t.path, ".c"))
{
found = x;
srcPath = Path.directory(t.path);
mainName = Path.withoutDirectory(t.path);
output = Path.directory(t.path);
exeName = Path.withoutDirectory(Path.withExtension(t.path, "exe"));
break;
Sys.command("haxe", [hxmlPath]);
compileJson(Path.join([Path.directory(t.path), "hlc.json"]));
return;
}
}
if (found != null) break;
}
if (found == null)
{
error("Hxml file does not generate HL C code!");
}

error("Hxml file does not generate HL C code!");
}

public function compile():Void
Expand Down
8 changes: 4 additions & 4 deletions HLCompilerCLI.hx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ class HLCompilerCLI
test = Path.join([path, file]);
if (FileSystem.exists(test))
{
// compiler.compileHxml(test);
// Sys.exit(0);
handleError("Found HXML, but HXML parsing not yet supported");
compiler.compileHxml(test);
Sys.exit(0);
}
}
}
Expand All @@ -90,7 +89,8 @@ class HLCompilerCLI
}
if (p.ext == "hxml")
{
handleError("Found HXML, but HXML parsing not yet supported");
compiler.compileHxml(path);
Sys.exit(0);
}
}
}
Expand Down

0 comments on commit 413b342

Please sign in to comment.