Requirements / Dependencies File for Haxelib

44 views
Skip to first unread message

Jason O'Neil

unread,
Jun 11, 2012, 11:46:33 AM6/11/12
to haxe...@googlegroups.com
Hi

As the Haxe community expands with more 3rd party libraries, and as
projects of greater complexity require more and more of these
libraries... it would be good to have a requirements file which installs
all the libraries required for a project. Python has requirements.py,
Ruby has it's Gemfiles etc.

We could keep it easy, and implement this by having the Haxelib tool
read hxml files:

haxelib install-all build.hxml

Or, if you have many build files, you could use an all-classes hxml
(also useful for generating documentation):

haxelib install-all all-classes.hxml

If the library names were banned from having ".hxml" in the name, you
could even keep the syntax as:

haxelib install build.hxml

Thoughts?

Jason

Philippe Elsass

unread,
Jun 11, 2012, 11:50:58 AM6/11/12
to haxe...@googlegroups.com
Yep, I agree dependencies in haxelibs are needed, even if it means to declare them in the haxelib.xml.
--
Philippe

Jason O'Neil

unread,
Jun 11, 2012, 11:55:01 AM6/11/12
to haxe...@googlegroups.com
Glad to know I'm not the only one.

If we can avoid having to enter information into yet another file I'll
be glad, hence the hxml solution. No idea how difficult it would be to
have haxelib pass this accurately. May even have a go at coding it
myself if there's demand.

Jason

Nicolas Cannasse

unread,
Jun 11, 2012, 11:57:02 AM6/11/12
to haxe...@googlegroups.com
Le 11/06/2012 17:50, Philippe Elsass a �crit :
> Yep, I agree dependencies in haxelibs are needed, even if it means to
> declare them in the haxelib.xml.

That's already possible :
http://haxe.org/doc/haxelib/using_haxelib#dependencies

Best,
Nicolas

Nicolas Cannasse

unread,
Jun 11, 2012, 11:59:16 AM6/11/12
to haxe...@googlegroups.com
> If the library names were banned from having ".hxml" in the name, you
> could even keep the syntax as:
>
> haxelib install build.hxml

Yes, we could do that, it's just a matter for listing the -lib that we
find in the the .hxml file (and maybe the other .hxml it includes).

Waiting for a proper patch proposal for haxelib Main.hx (in
std/tools/haxelib) ;)

Best,
Nicolas

Jason O'Neil

unread,
Jun 11, 2012, 12:03:28 PM6/11/12
to haxe...@googlegroups.com
On Mon 11 Jun 2012 23:57:02 WST, Nicolas Cannasse wrote:
>
> That's already possible :
> http://haxe.org/doc/haxelib/using_haxelib#dependencies
>

Correct me if I'm wrong, but isn't this for specifying dependencies
when creating your own *library*, not for a project?

For example, I have a project that has this build file:

-js test.js
-main Test
-lib mdown
-lib erazor
-lib xirsys_stdjs

Now I want to collaborate with another developer, who has none of these
libraries installed. Is there any way for my co-developer to, in one
command, get all of the necessary haxelibs to build my project?

The haxelib.xml approach works for dependencies of other haxelibs, but
not for the dependencies of projects (unless I'm missing something?)

Jason

Nicolas Cannasse

unread,
Jun 11, 2012, 12:11:21 PM6/11/12
to haxe...@googlegroups.com
Yes, you're perfectly right. I was answering to Philippe message, and I
made another answer to your original post :)

Best,
Nicolas

Jason O'Neil

unread,
Jun 11, 2012, 12:33:25 PM6/11/12
to haxe...@googlegroups.com
Haha I missed it!

Thank you. Just took a look at the code and it looks quite do-able.
How consistent is the syntax in a hxml file? Can I rely on "-lib
myhaxelib" commands to always be on their own line? Do you ever get
multiple libraries on one line, or multiple commands on one line etc?

If the hxml syntax is consistent enough this should be relatively easy
to implement. Will have to learn how to use SVN :)

Jason

Nicolas Cannasse

unread,
Jun 11, 2012, 12:37:57 PM6/11/12
to haxe...@googlegroups.com
Le 11/06/2012 18:33, Jason O'Neil a écrit :
> Haha I missed it!
>
> Thank you. Just took a look at the code and it looks quite do-able. How
> consistent is the syntax in a hxml file? Can I rely on "-lib myhaxelib"
> commands to always be on their own line? Do you ever get multiple
> libraries on one line, or multiple commands on one line etc?
>
> If the hxml syntax is consistent enough this should be relatively easy
> to implement. Will have to learn how to use SVN :)

It's consistent : one single -lib per line.

Best,
Nicolas
Reply all
Reply to author
Forward
0 new messages