erlang.mk icon indicating copy to clipboard operation
erlang.mk copied to clipboard

document how to offer erlang code as a dependency

Open mk270 opened this issue 8 years ago • 8 comments

Having had a look through the documentation, I couldn't work out how to offer my own project as a dependency.

I want to do:

DEPS = lager sqlite my_project
dep_my_project = git https://github.com/myuser/myproject master

But it's not clear what the layout of the git repo at myproject needs to be. Does it need to have a Makefile? An src/ directory? rebar? etc

mk270 avatar Oct 11 '16 20:10 mk270

Can you be more specific?

essen avatar Oct 11 '16 21:10 essen

(I've updated the main description)

mk270 avatar Oct 13 '16 22:10 mk270

Erlang.mk is compatible with anything that has a Makefile (Erlang.mk project or not; doesn't even need to be an Erlang application ultimately, just needs to follow standard practices like "make" builds the thing), and most rebar projects (by patching them and generating a Makefile).

So it doesn't really matter as long as it's an Erlang.mk project, a rebar project, or it has a Makefile. Erlang projects have a specific structure (ebin/ src/ priv/ and so on) so you may want to make sure you follow it (if Erlang.mk or rebar project, then most likely you already do).

You can quickly check if the project builds when used as a dependency by adding it to the package index and running "make check p=myproject" from the Erlang.mk repository.

essen avatar Oct 13 '16 23:10 essen

The paragraphs you've written here ought to be in the documentation!

mk270 avatar Oct 13 '16 23:10 mk270

Question is where, because it is in the documentation already, just from different point of views (see autopatch for example).

essen avatar Oct 14 '16 07:10 essen

Thanks for engaging and explaining what the issue is: I see the problem now; we kind of need an inverse user guide :)

Should I sent a pull request against doc/src/guide, once I've found an appropriate spot?

mk270 avatar Oct 14 '16 15:10 mk270

Sure. The best would probably be a completely new chapter/tutorial "Publishing your project" or similar, that would continue from "Getting started" only for the publishing part of things.

essen avatar Oct 14 '16 16:10 essen

It wouldn't have to cover everything from the start of course. I can add more stuff later on.

essen avatar Oct 14 '16 16:10 essen