From b2139293318ec45a5e75f17177d1e4e028c41a62 Mon Sep 17 00:00:00 2001 From: Toby Davis Date: Sun, 1 Mar 2026 04:04:11 -0500 Subject: [PATCH] Add getPathClassPath to Haxelib.hx Returns the classPath property from a library's haxelib.json using a provided path. --- src/hxp/Haxelib.hx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/hxp/Haxelib.hx b/src/hxp/Haxelib.hx index b16774b..7514a90 100644 --- a/src/hxp/Haxelib.hx +++ b/src/hxp/Haxelib.hx @@ -343,6 +343,24 @@ class Haxelib } return paths.get(name); } + + public static function getPathClassPath(path:String):String + { + path = Path.combine(path, "haxelib.json"); + + if (FileSystem.exists(path)) + { + try + { + var json = Json.parse(File.getContent(path)); + var classPathString:String = json.classPath; + return classPathString; + } + catch (e:Dynamic) {} + } + + return null; + } public static function getPathVersion(path:String):Version {