Skip to content

Commit

Permalink
add readme and small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Oct 17, 2018
1 parent 87a4503 commit 254e96b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 33 deletions.
42 changes: 32 additions & 10 deletions README.md
@@ -1,7 +1,13 @@
rebar3_path_dep
rebar3_path_deps
=====

A rebar plugin
A rebar plugin to specify path dependencies.

Over time, your project is growing significantly in size! It’s gotten to the point that
you probably want to split out a separate OTP applications for others to use.

This plugin add to rebar the supports of path dependencies which are typically sub-applications
that live within one repository.

Build
-----
Expand All @@ -11,16 +17,32 @@ Build
Use
---

Add the plugin to your rebar config:
To use it add to your rebar.config dependencies the path :

```erlang
{deps, [
{mysubapp, {path, "mysubapp"}},
..
]

```

This tells Rebar that we depend on an application called mysubapp which is found in the mysubapp
folder (relative to the `rebar.config` file its written in).


and then add the plugin to your rebar config:

{plugins, [
{ rebar3_path_dep, ".*", {git, "git@host:user/rebar3_path_dep.git", {tag, "0.1.0"}}}
rebar3_path_deps
]}.

Then just call your plugin directly in an existing application:
Then just compile your application


$ rebar3 rebar3_path_dep
===> Fetching rebar3_path_dep
===> Compiling rebar3_path_dep
<Plugin Output>
$ rebar3 compile
===> Compiling rebar3_path_deps
===> Verifying dependencies...
===> Fetching mysubapp ({path,"./mysubapp",
{mtime,<<"2018-10-17T11:21:18Z">>}})
===> Compiling hackney
===> Compiling myapp
15 changes: 0 additions & 15 deletions src/rebar3_path_dep.app.src

This file was deleted.

15 changes: 15 additions & 0 deletions src/rebar3_path_deps.app.src
@@ -0,0 +1,15 @@
{application, rebar3_path_deps,
[{description, "A rebar plugin to specify path dependencies. "},
{vsn, "0.1.0"},
{registered, []},
{applications,
[kernel,
stdlib
]},
{env,[]},
{modules, []},

{maintainers, ["Benoit Chesneauu"]},
{licenses, ["Apache 2.0"]},
{links, [{"Github", "https://github.com/benoitc/rebar3_path_deps"}]}
]}.
2 changes: 1 addition & 1 deletion src/rebar3_path_dep.erl → src/rebar3_path_deps.erl
@@ -1,4 +1,4 @@
-module(rebar3_path_dep).
-module(rebar3_path_deps).

-export([init/1]).

Expand Down
7 changes: 0 additions & 7 deletions src/rebar_path_resource.erl
Expand Up @@ -86,13 +86,6 @@ last_modified_(Files) ->
0,
Files).


%%to_timestamp({{Year,Month,Day},{Hours,Minutes,Seconds}}) ->
%% (calendar:datetime_to_gregorian_seconds(
%% {{Year,Month,Day},{Hours,Minutes,Seconds}}
%% ) - 62167219200)*1000000.


to_iso8601({{Y,Mo,D}, {H,Mn,S}}) ->
FmtStr = "~4.10.0B-~2.10.0B-~2.10.0BT~2.10.0B:~2.10.0B:~2.10.0BZ",
IsoStr = io_lib:format(FmtStr, [Y, Mo, D, H, Mn, S]),
Expand Down

0 comments on commit 254e96b

Please sign in to comment.