Tristan Sloughter 10 лет назад
Родитель
Сommit
5fd4996803
1 измененных файлов: 34 добавлений и 1 удалений
  1. +34
    -1
      doc/guide.md

+ 34
- 1
doc/guide.md Просмотреть файл

@ -57,7 +57,23 @@ Dependencies are listed in `rebar.config` file under the `deps` key:
]}.
```
Then you'll most likely want to add the dependency to one of your project's application's `.app.src` file under applications.
Now you can add the dep to one of your project's application's `.app.src` file under applications:
```erlang
{application, <APPNAME>,
[{description, ""},
{vsn, "<APPVSN>"},
{registered, []},
{modules, []},
{applications, [
kernel
,stdlib
,cowboy
]},
{mod, {<APPNAME>_app, []}},
{env, []}
]}.
```
## Rebar3 Conventions
@ -74,6 +90,23 @@ Rebar3 is entirely based on building OTP applications and releases.
## Checkout Dependencies
Often while developing you find yourself working on mulitple applications from separate repos together. To simplify this process `rebar3` will look in the directory `_checkouts` for applications to override a dependency.
For example, you are working on project `app1` which depends on `app2`. You want to have your modifications to `app2` used by `app1`:
```shell
[app1] $ pwd
/home/user/code/app1
[app1] $ cat rebar.config
{deps, [
{app2, "", {git, "git://github.com:user/app2.git", {branch, "master"}}}
]}.
[app1] $ ls -l _checkouts
lrwxrwxrwx app2 -> /home/user/code/app2
```
Since a symlink to `app2` exists in `_checkouts` there will not be a fetch of `app2` by `rebar3` when the project is built.
## Tests
Rebar3 has the concept of test dependencies. These dependencies will only be fetched when a rebar3 command that runs tests is run by the user.

Загрузка…
Отмена
Сохранить