Current section

13 Versions

Jump to

Compare versions

9 files changed
+160 additions
-33 deletions
  @@ -7,7 +7,8 @@ Compile clojerl projects
7 7
8 8 ## Use
9 9
10 - Add the plugin to your `rebar.config` (along with `clojerl` as a dependency):
10 + Add the plugin to your `rebar.config` (along with `clojerl` as a
11 + dependency):
11 12
12 13 {deps, [clojerl]}.
13 14 {plugins, [rebar3_clojerl]}.
  @@ -28,8 +29,8 @@ To get a list of all available tasks for the plugin run:
28 29 repl Start a clojerl repl
29 30 test Test clojerl project
30 31
31 - For each of these you can then get more details and available options by running
32 - for example:
32 + For each of these you can then get more details and available options
33 + by running for example:
33 34
34 35 $ rebar3 help clojerl repl
35 36 Start a clojerl repl
  @@ -41,23 +42,28 @@ for example:
41 42
42 43 ### rebar.config options
43 44
44 - The following options are helpful for handling custom directory structure and/or
45 - compilation behaviour:
45 + These are the available options:
46 46
47 - - `clje_src_dirs`: List of directories where Clojerl source is located (default: `["src"]`).
48 - - `clje_test_dirs`: List of directories where Clojerl tests are located (default: `["test"]`).
49 - - `clje_compile_first`: List of files that should be compiled first (default: `[]`).
50 - - `clje_exclude`: List of files that should be excluded from compilation (default: `[]`).
47 + | Name | Description |
48 + |----------------------|-----------------------------------------------------------------------------------------|
49 + | `clje_src_dirs` | List of directories where Clojerl source is located (default: `["src"]`). |
50 + | `clje_test_dirs` | List of directories where Clojerl tests are located (default: `["test"]`). |
51 + | `clje_compile_first` | List of files that should be compiled first (default: `[]`). |
52 + | `clje_exclude` | List of files that should be excluded from compilation (default: `[]`). |
53 + | `clje_main` | String specifying either a fully qualified function or a namespace (e.g. `"foo/main"`). |
51 54
52 - For example, if the Clojerl code was in `src/clj` instead of just `src`, the
53 - `rebar.config` should include the following entry:
55 + The first four are helpful for handling custom directory structure
56 + and/or compilation behaviour.
57 +
58 + For example, if the Clojerl code was in `src/clj` instead of just
59 + `src`, the `rebar.config` should include the following entry:
54 60
55 61 ```
56 62 {clje_src_dirs, ["src/clj"]}.
57 63 ```
58 64
59 - And if we wanted to have the file for namespace `foo.bar` compiled first we would
60 - also include the entry:
65 + And if we wanted to have the file for namespace `foo.bar` compiled
66 + first we would also include the entry:
61 67
62 68 ```
63 69 {clj_compile_first, ["foo/bar.clje"]}.
  @@ -65,7 +71,8 @@ also include the entry:
65 71
66 72 ## Plugin Development
67 73
68 - Run the following commands to checkout the repository and build the plugin:
74 + Run the following commands to checkout the repository and build the
75 + plugin:
69 76
70 77 git checkout https://github.com/clojerl/rebar3_clojerl
71 78 cd rebar3_clojerl
  @@ -73,19 +80,19 @@ Run the following commands to checkout the repository and build the plugin:
73 80
74 81 ### Install globally
75 82
76 - `rebar3` also allows you to install [plugins globally][rebar3-plugins] through its
77 - configuration file `~/.config/rebar3/rebar.config`.
83 + `rebar3` also allows you to install [plugins globally][rebar3-plugins]
84 + through its configuration file `~/.config/rebar3/rebar.config`.
78 85
79 - By adding the following entry in the global `rebar.config` you will be able to use
80 - the plugin to build your project or create a new one with the available
81 - [template](#template).
86 + By adding the following entry in the global `rebar.config` you will be
87 + able to use the plugin to build your project or create a new one with
88 + the available [template](#template).
82 89
83 90 {plugins, [rebar3_clojerl]}.
84 91
85 92 ## Template
86 93
87 - When the plugin is [installed globally](#install-globally) you can use its template
88 - to create a new Clojerl application.
94 + When the plugin is [installed globally](#install-globally) you can use
95 + its template to create a new Clojerl application.
89 96
90 97 rebar3 new clojerl_app awesome
91 98
  @@ -95,9 +102,9 @@ Running `rebar3 clojerl compile` will build the application.
95 102
96 103 ### Application name
97 104
98 - Because of how Clojerl (and Clojure) processes dashes for namespace names,
99 - and current limitations of the templating mechanism, you can't include dashes in your
100 - application's name. It's sad, I know. :(
105 + Because of how Clojerl (and Clojure) processes dashes for namespace
106 + names, and current limitations of the templating mechanism, you can't
107 + include dashes in your application's name. It's sad, I know. :(
101 108
102 109 [rebar3-plugins]: https://www.rebar3.org/docs/using-available-plugins
103 110 [rebar3-provider-hooks]: https://www.rebar3.org/docs/configuration#section-provider-hooks
  @@ -10,12 +10,12 @@
10 10 <<"priv/templates/sup.clje.tpl">>,<<"rebar.config">>,<<"rebar.lock">>,
11 11 <<"src/rebar3_clojerl.app.src">>,<<"src/rebar3_clojerl.erl">>,
12 12 <<"src/rebar3_clojerl.hrl">>,<<"src/rebar3_clojerl_prv_compile.erl">>,
13 - <<"src/rebar3_clojerl_prv_repl.erl">>,<<"src/rebar3_clojerl_prv_test.erl">>,
14 - <<"src/rebar3_clojerl_utils.erl">>]}.
13 + <<"src/rebar3_clojerl_prv_repl.erl">>,<<"src/rebar3_clojerl_prv_run.erl">>,
14 + <<"src/rebar3_clojerl_prv_test.erl">>,<<"src/rebar3_clojerl_utils.erl">>]}.
15 15 {<<"licenses">>,[<<"Apache 2.0">>]}.
16 16 {<<"links">>,
17 17 [{<<"Clojerl">>,<<"https://github.com/clojerl/clojerl">>},
18 18 {<<"GitHub">>,<<"https://github.com/clojerl/rebar3_clojerl">>}]}.
19 19 {<<"name">>,<<"rebar3_clojerl">>}.
20 20 {<<"requirements">>,[]}.
21 - {<<"version">>,<<"0.6.8">>}.
21 + {<<"version">>,<<"0.7.0">>}.
  @@ -1,4 +1,4 @@
1 1 {erl_opts, [debug_info]}.
2 2
3 - {deps, [{clojerl, "0.5.1"}]}.
4 - {plugins, [{rebar3_clojerl, "0.6.8"}]}.
3 + {deps, [{clojerl, "0.6.0"}]}.
4 + {plugins, [{rebar3_clojerl, "0.7.0"}]}.
  @@ -1,6 +1,6 @@
1 1 {application,rebar3_clojerl,
2 2 [{description,"Compile clojerl projects"},
3 - {vsn,"0.6.8"},
3 + {vsn,"0.7.0"},
4 4 {registered,[]},
5 5 {applications,[kernel,stdlib]},
6 6 {env,[]},
  @@ -7,6 +7,7 @@ init(State) ->
7 7 Commands = [ fun rebar3_clojerl_prv_compile:init/1
8 8 , fun rebar3_clojerl_prv_test:init/1
9 9 , fun rebar3_clojerl_prv_repl:init/1
10 + , fun rebar3_clojerl_prv_run:init/1
10 11 ],
11 12 FoldFun = fun(F, {ok, StateAcc}) -> F(StateAcc) end,
12 13 lists:foldl(FoldFun, {ok, State}, Commands).
Loading more files…