Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haxelib libpath to return root path of a library #407

Closed
mastef opened this issue Feb 8, 2018 · 5 comments
Closed

haxelib libpath to return root path of a library #407

mastef opened this issue Feb 8, 2018 · 5 comments

Comments

@mastef
Copy link
Contributor

mastef commented Feb 8, 2018

Currently it seems that haxelib path returns a lot of unformatted extra-information, instead of just the path. It would be great if the extra information was hidden behind a flag, or a flag could be provided that would only return the path of the library - as the command suggests.

haxelib path returns the paths of libraries' source files + compiler flags. It would be great to have a command where just the root path of a library would be returned.

This way haxelib libpath can be used to programmatically work with library locations - e.g. to detect current git commit of libraries in use at build time, etc.

Desired output :

$ haxelib libpath openfl-samples
/usr/local/lib/haxe/lib/openfl-samples/4,0,0/
$ haxelib libpath openfl
/somewhere/unexpected/openfl/
$ haxelib libpath tink_macro
/usr/local/lib/haxe/lib/tink_macro/0,15,4/
@back2dos
Copy link
Member

back2dos commented Feb 8, 2018

Hmm, maybe the command documentation should be improved, but that's really not what it's for. It's primarily intended for the Haxe compiler to get all the necessary arguments for a library (classpath, defines, macros etc.) and its dependencies.

@Gama11
Copy link
Member

Gama11 commented Feb 8, 2018

It's frequently used the way @mastef describes though... There's code to parse the path out of haxelib path output in flixel as well as flixel-tools, for instance.

@mastef
Copy link
Contributor Author

mastef commented Feb 8, 2018

Same in lime - there's a whole helper to try and scan the returned lines for haxelib.json files, to see if they're parse-able, then to compare if the library name in them matches the one it's looking for etc. It seems overkill. I've submitted a PR now with a pathonly option.

As for the original intent - if the intent was to pass on args to the haxe compiler, then there should've been a haxelib buildinfo <library> or haxelib deps <library> option instead - but now it's too late for that as it would break backwards compatibility.

@elsassph
Copy link

elsassph commented Feb 8, 2018

haxelib path is doing a specific job, returning classpaths and extra compiler arguments - you want another feature.

Do you need the folder of the haxelib? Or the classpath of the haxelib? (it can be a subfolder)

@mastef mastef changed the title haxelib path to only return path haxelib libpath to return root path of a library Feb 8, 2018
@mastef
Copy link
Contributor Author

mastef commented Feb 8, 2018

Yep @elsassph @back2dos I've adjusted the issue and the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants