diff options
author | Jean-Sébastien Pédron <[email protected]> | 2017-05-12 09:30:45 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-05-12 11:57:30 +0200 |
commit | cd99adbb98d8965c65f68da2853f14506756d7b3 (patch) | |
tree | 697617c1a027e425ad67d0fc6f042bf81abbd585 /doc | |
parent | ae5415d4a1000022c568932e7a6efa96e684b016 (diff) | |
download | erlang.mk-cd99adbb98d8965c65f68da2853f14506756d7b3.tar.gz erlang.mk-cd99adbb98d8965c65f68da2853f14506756d7b3.tar.bz2 erlang.mk-cd99adbb98d8965c65f68da2853f14506756d7b3.zip |
Support early-stage plugins through `$(DEP_EARLY_PLUGINS)`
Regular plugins (`$(DEP_PLUGINS)`) are loaded near the end of Erlang.mk.
This is fine when you want to modify variables initialized earlier in
Erlang.mk or add new targets and variables.
However, it doesn't allow you to declare more dependencies because they
are loaded too late for that.
This commit introduces a new variable, `$(DEP_EARLY_PLUGINS)`, which can
be used to list plugins meant to be loaded near the beginning of
Erlang.mk. Those allow to append to the list of dependencies.
They work exactly like regular plugins otherwise. The default filename
loaded is `early-plugins.mk`.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/guide/external_plugins.asciidoc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/src/guide/external_plugins.asciidoc b/doc/src/guide/external_plugins.asciidoc index d3dafaa..c398c59 100644 --- a/doc/src/guide/external_plugins.asciidoc +++ b/doc/src/guide/external_plugins.asciidoc @@ -75,3 +75,29 @@ The `THIS` variable is required to relatively include files. This allows users to not only be able to select individual plugins, but also select all plugins from the dependency in one go if they wish to do so. + +=== Early-stage plugins + +Plugins declared in `DEP_PLUGINS` are loaded near the end of Erlang.mk. +That's why you have access to all previously initialized variables. +However, if you want your plugin to add common dependencies to +your applications, a regular is loaded too late in the process. +You need to use "Early-stage plugins". They are declared using the +`DEP_EARLY_PLUGINS` variable instead. Plugins listed in this variable +are loaded near the beginning of Erlang.mk Otherwise, they work exactly +the same. + +If you only give the name of a dependency, the default file loaded is +'early-plugins.mk'. You can specify a filename exactly like you would +have done it with regular plugins. + +[source,make] +# In your application's Makefile +BUILD_DEPS = common_deps +DEP_EARLY_PLUGINS = common_deps + +[source,make] +# In the plugin's early-plugins.mk +DEPS += cowboy +TEST_DEPS = ct_helper +dep_ct_helper = git https://github.com/ninenines/ct_helper master |