Use version from exact haxelibs included, rather than the newest installed, when setting -D lib=version
This commit is contained in:
@@ -951,6 +951,7 @@ class HXProject {
|
||||
LogHelper.verbose = cache;
|
||||
|
||||
var split = output.split ("\n");
|
||||
var haxelibName = null;
|
||||
|
||||
for (arg in split) {
|
||||
|
||||
@@ -960,20 +961,39 @@ class HXProject {
|
||||
|
||||
if (!StringTools.startsWith (arg, "-")) {
|
||||
|
||||
var param = "-cp " + PathHelper.standardize (arg);
|
||||
var path = PathHelper.standardize (arg);
|
||||
var param = "-cp " + path;
|
||||
compilerFlags.remove (param);
|
||||
compilerFlags.push (param);
|
||||
//if (compilerFlags.indexOf ("-cp " + arg) == -1) {
|
||||
|
||||
var version = "0.0.0";
|
||||
var jsonPath = PathHelper.combine (path, "haxelib.json");
|
||||
|
||||
try {
|
||||
|
||||
//compilerFlags.push ("-cp " + PathHelper.standardize (arg));
|
||||
if (FileSystem.exists (jsonPath)) {
|
||||
|
||||
var json = Json.parse (File.getContent (jsonPath));
|
||||
haxelibName = json.name;
|
||||
compilerFlags = ArrayHelper.concatUnique (compilerFlags, [ "-D " + haxelibName + "=" + json.version ], true);
|
||||
|
||||
}
|
||||
|
||||
//}
|
||||
} catch (e:Dynamic) {}
|
||||
|
||||
} else {
|
||||
|
||||
if (StringTools.startsWith (arg, "-D ") && arg.indexOf ("=") == -1) {
|
||||
|
||||
var haxelib = new Haxelib (arg.substr (3));
|
||||
var name = arg.substr (3);
|
||||
|
||||
if (name != haxelibName) {
|
||||
|
||||
compilerFlags = ArrayHelper.concatUnique (compilerFlags, [ "-D " + name ], true);
|
||||
|
||||
}
|
||||
|
||||
/*var haxelib = new Haxelib (arg.substr (3));
|
||||
var path = PathHelper.getHaxelib (haxelib);
|
||||
var version = getHaxelibVersion (haxelib);
|
||||
|
||||
@@ -982,7 +1002,7 @@ class HXProject {
|
||||
CompatibilityHelper.patchProject (this, haxelib, version);
|
||||
compilerFlags = ArrayHelper.concatUnique (compilerFlags, [ "-D " + haxelib.name + "=" + version ], true);
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
} else if (!StringTools.startsWith (arg, "-L")) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user