diff options
Diffstat (limited to 'doc/src/guide/deps.asciidoc')
-rw-r--r-- | doc/src/guide/deps.asciidoc | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/doc/src/guide/deps.asciidoc b/doc/src/guide/deps.asciidoc index 081f4f7..1ac2d8a 100644 --- a/doc/src/guide/deps.asciidoc +++ b/doc/src/guide/deps.asciidoc @@ -132,6 +132,18 @@ target `deps::` before including 'erlang.mk', for example: [source,make] deps:: $(CURDIR)/deps/triq +Sometimes dependencies are allowed to be missing. However, your application +may depend on an optional application being started. To ensure that an +optional dependency is started before your application, the variable +`OPTIONAL_DEPS` may be used: + +[source,make] +OPTIONAL_DEPS = quicer + +The top-level project can then decide whether to include this +application by adding it to its `BUILD_DEPS` and including +it in the release dependencies. + ==== Modifying the dependency source or version By default, Erlang.mk will look into its package index to @@ -151,10 +163,10 @@ variable. In the case of Cowboy, this would look like this: [source,make] DEPS = cowboy -dep_cowboy_commit = 2.0.0-pre.2 +dep_cowboy_commit = 2.12.0 Erlang.mk will use the package index to get all information -about Cowboy, except the commit number which will be overriden. +about Cowboy, except the commit number which will be overridden. If you need to set the fetch method or repository information too, for example because you want to use your own fork, or @@ -163,7 +175,7 @@ can define the `dep_$(DEP_NAME)` variable with everything: [source,make] DEPS = cowboy -dep_cowboy = git https://github.com/essen/cowboy 2.0.0-pre.2 +dep_cowboy = git https://github.com/essen/cowboy 2.12.0 This will fetch Cowboy from your fork at the given commit. @@ -252,7 +264,7 @@ If none of the existing methods fit your use, you can simply define your own. Erlang.mk will consider all variables that are named as `dep_fetch_$(METHOD)` to be available fetch methods. You can do anything inside this variable, as long -as you create a folder named '$(DEPS_DIR)/$(call dep_name,$1)'. +as you create a folder named '$(DEPS_DIR)/$(call query_name,$1)'. Or in layman terms, if your dependency is Cowboy, this would become 'deps/cowboy'. @@ -261,8 +273,8 @@ To give an example, this is what the Git method does: [source,make] ---- define dep_fetch_git - git clone -q -n -- $(call dep_repo,$1) $(DEPS_DIR)/$(call dep_name,$1); \ - cd $(DEPS_DIR)/$(call dep_name,$1) && git checkout -q $(call dep_commit,$1); + git clone -q -n -- $(call query_repo_git,$1) $(DEPS_DIR)/$(call query_name,$1); \ + cd $(DEPS_DIR)/$(call query_name,$1) && git checkout -q $(call query_version_git,$1); endef ---- @@ -559,10 +571,8 @@ performed: * Run autopatch on the project Autopatch first checks if there is any project-specific patch -enabled. There are currently three: `RABBITMQ_CLIENT_PATCH` for -the `amqp_client` dependency (before 3.6.0), `RABBITMQ_SERVER_PATCH` -for the `rabbit` dependency (before 3.6.0) and `ELIXIR_PATCH` -for the `elixir` dependency. +enabled. There are currently two: `ELIXIR_PATCH` for the `elixir` +dependency and `HUT_PATCH` for the `hut` dependency. Otherwise, autopatch performs different operations depending on the kind of project it finds the dependency to be. |