Add haxe variable with version value + error if haxe is less than 3.2.0. Fix #820

This commit is contained in:
Valentin Lemière
2016-10-30 11:26:51 +01:00
parent 4b91b343ba
commit 31b9b87b53
2 changed files with 7 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<extension>
<log error="Lime ${lime} is not compatible with Haxe ${haxe} (version 3.2.0 or higher is required)" if="${haxe < 3.2.0}" />
<set name="lime" />
<haxedef name="native" if="cpp || neko || nodejs || cs" />

View File

@@ -128,7 +128,11 @@ class ProjectXMLParser extends HXProject {
}
defines.set ("haxe3", "1");
var p = new sys.io.Process ("haxe", ["-version"]);
var haxeVersion = StringTools.replace (p.stderr.readAll ().toString (), "\n", "");
p.close ();
defines.set ("haxe", haxeVersion);
defines.set ("haxe"+haxeVersion.split(".")[0], "1");
if (debug) {