Browse Source

From rebar2.5 to rebar3

Takeru Ohta 9 years ago
parent
commit
c9a6b9eee0
8 changed files with 35 additions and 105 deletions
  1. 2 1
      .gitignore
  2. 9 24
      Makefile
  3. 0 8
      doc/README.md
  4. 6 72
      doc/jsone.md
  5. BIN
      rebar
  6. 17 0
      rebar.config
  7. 1 0
      rebar.lock
  8. BIN
      rebar3

+ 2 - 1
.gitignore

@@ -9,4 +9,5 @@ deps
 doc/*
 doc/*
 !doc/overview.edoc
 !doc/overview.edoc
 !doc/*.md
 !doc/*.md
-.rebar
+.rebar
+_build

+ 9 - 24
Makefile

@@ -1,37 +1,22 @@
-APP=jsone
-
-DIALYZER_OPTS=-Werror_handling -Wrace_conditions -Wunmatched_returns
-
-all: compile xref eunit dialyze
-
-init:
-	@./rebar get-deps compile
+all: compile xref eunit dialyze edoc
 
 
 compile:
 compile:
-	@./rebar compile skip_deps=true
+	@./rebar3 compile
 
 
 xref:
 xref:
-	@./rebar xref skip_deps=true
+	@./rebar3 xref
 
 
 clean:
 clean:
-	@./rebar clean skip_deps=true
+	@./rebar3 clean
 
 
 eunit:
 eunit:
-	@./rebar eunit skip_deps=true
+	@./rebar3 eunit
 
 
 edoc:
 edoc:
-	@./rebar doc skip_deps=true
+	@./rebar3 as doc edoc
 
 
 start: compile
 start: compile
-	erl -pz ebin deps/*/ebin \
-      -eval 'erlang:display({start_app, $(APP), application:start($(APP))}).'
-
-.dialyzer.plt:
-	touch .dialyzer.plt
-	dialyzer --build_plt --plt .dialyzer.plt --apps erts kernel stdlib
-
-dialyze: .dialyzer.plt compile
-	dialyzer --plt .dialyzer.plt -r ebin $(DIALYZER_OPTS)
+	@./rebar3 shell
 
 
-create_app:
-	@./rebar create-app appid=$(APP) skip_deps=true
+dialyze: compile
+	@./rebar3 dialyzer

+ 0 - 8
doc/README.md

@@ -1,11 +1,3 @@
 
 
 
 
 # The jsone application #
 # The jsone application #
-
-
-## Modules ##
-
-
-<table width="100%" border="0" summary="list of modules">
-<tr><td><a href="jsone.md" class="module">jsone</a></td></tr></table>
-

+ 6 - 72
doc/jsone.md

@@ -6,10 +6,8 @@
 * [Function Index](#index)
 * [Function Index](#index)
 * [Function Details](#functions)
 * [Function Details](#functions)
 
 
-
 JSON decoding/encoding module.
 JSON decoding/encoding module.
 
 
-
 <a name="types"></a>
 <a name="types"></a>
 
 
 ## Data Types ##
 ## Data Types ##
@@ -20,14 +18,11 @@ JSON decoding/encoding module.
 ### <a name="type-decode_option">decode_option()</a> ###
 ### <a name="type-decode_option">decode_option()</a> ###
 
 
 
 
-
 <pre><code>
 <pre><code>
 decode_option() = {object_format, tuple | proplist | map}
 decode_option() = {object_format, tuple | proplist | map}
 </code></pre>
 </code></pre>
 
 
-
-
-  object_format: <br />
+ object_format: <br />
 - Decoded JSON object format <br />
 - Decoded JSON object format <br />
 - `tuple`: An object is decoded as `{[]}` if it is empty, otherwise `{[{Key, Value}]}`. <br />
 - `tuple`: An object is decoded as `{[]}` if it is empty, otherwise `{[{Key, Value}]}`. <br />
 - `proplist`: An object is decoded as `[{}]` if it is empty, otherwise `[{Key, Value}]`. <br />
 - `proplist`: An object is decoded as `[{}]` if it is empty, otherwise `[{Key, Value}]`. <br />
@@ -39,30 +34,21 @@ decode_option() = {object_format, tuple | proplist | map}
 ### <a name="type-encode_option">encode_option()</a> ###
 ### <a name="type-encode_option">encode_option()</a> ###
 
 
 
 
-
 <pre><code>
 <pre><code>
 encode_option() = native_utf8 | {float_format, [<a href="#type-float_format_option">float_format_option()</a>]} | {space, non_neg_integer()} | {indent, non_neg_integer()}
 encode_option() = native_utf8 | {float_format, [<a href="#type-float_format_option">float_format_option()</a>]} | {space, non_neg_integer()} | {indent, non_neg_integer()}
 </code></pre>
 </code></pre>
 
 
-
-
-
 `native_utf8`: <br />
 `native_utf8`: <br />
 - Encodes UTF-8 characters as a human-readable(non-escaped) string <br />
 - Encodes UTF-8 characters as a human-readable(non-escaped) string <br />
 
 
-
-
 `{float_format, Optoins}`:
 `{float_format, Optoins}`:
 - Encodes a `float()` value in the format which specified by `Options` <br />
 - Encodes a `float()` value in the format which specified by `Options` <br />
 - default: `[{scientific, 20}]` <br />
 - default: `[{scientific, 20}]` <br />
 
 
-
-
 `{space, N}`: <br />
 `{space, N}`: <br />
 - Inserts `N` spaces after every commna and colon <br />
 - Inserts `N` spaces after every commna and colon <br />
 - default: `0` <br />
 - default: `0` <br />
 
 
-
 `{indent, N}`: <br />
 `{indent, N}`: <br />
 - Inserts a newline and `N` spaces for each level of indentation <br />
 - Inserts a newline and `N` spaces for each level of indentation <br />
 - default: `0` <br />
 - default: `0` <br />
@@ -72,29 +58,19 @@ encode_option() = native_utf8 | {float_format, [<a href="#type-float_format_opti
 ### <a name="type-float_format_option">float_format_option()</a> ###
 ### <a name="type-float_format_option">float_format_option()</a> ###
 
 
 
 
-
 <pre><code>
 <pre><code>
 float_format_option() = {scientific, Decimals::0..249} | {decimals, Decimals::0..253} | compact
 float_format_option() = {scientific, Decimals::0..249} | {decimals, Decimals::0..253} | compact
 </code></pre>
 </code></pre>
 
 
-
-
-
 `scientific`: <br />
 `scientific`: <br />
 - The float will be formatted using scientific notation with `Decimals` digits of precision. <br />
 - The float will be formatted using scientific notation with `Decimals` digits of precision. <br />
 
 
-
-
 `decimals`: <br />
 `decimals`: <br />
 - The encoded string will contain at most `Decimals` number of digits past the decimal point. <br />
 - The encoded string will contain at most `Decimals` number of digits past the decimal point. <br />
 - If `compact` is provided the trailing zeros at the end of the string are truncated. <br />
 - If `compact` is provided the trailing zeros at the end of the string are truncated. <br />
 
 
-
-
 For more details, see [erlang:flaot_to_list/2](http://erlang.org/doc/man/erlang.md#float_to_list-2).
 For more details, see [erlang:flaot_to_list/2](http://erlang.org/doc/man/erlang.md#float_to_list-2).
 
 
-
-
 ```
 ```
   > jsone:encode(1.23).
   > jsone:encode(1.23).
   <<"1.22999999999999998224e+00">>
   <<"1.22999999999999998224e+00">>
@@ -110,11 +86,9 @@ For more details, see [erlang:flaot_to_list/2](http://erlang.org/doc/man/erlang.
 
 
 
 
 
 
-
 ### <a name="type-json_array">json_array()</a> ###
 ### <a name="type-json_array">json_array()</a> ###
 
 
 
 
-
 <pre><code>
 <pre><code>
 json_array() = [<a href="#type-json_value">json_value()</a>]
 json_array() = [<a href="#type-json_value">json_value()</a>]
 </code></pre>
 </code></pre>
@@ -122,11 +96,9 @@ json_array() = [<a href="#type-json_value">json_value()</a>]
 
 
 
 
 
 
-
 ### <a name="type-json_boolean">json_boolean()</a> ###
 ### <a name="type-json_boolean">json_boolean()</a> ###
 
 
 
 
-
 <pre><code>
 <pre><code>
 json_boolean() = boolean()
 json_boolean() = boolean()
 </code></pre>
 </code></pre>
@@ -134,11 +106,9 @@ json_boolean() = boolean()
 
 
 
 
 
 
-
 ### <a name="type-json_number">json_number()</a> ###
 ### <a name="type-json_number">json_number()</a> ###
 
 
 
 
-
 <pre><code>
 <pre><code>
 json_number() = number()
 json_number() = number()
 </code></pre>
 </code></pre>
@@ -146,11 +116,9 @@ json_number() = number()
 
 
 
 
 
 
-
 ### <a name="type-json_object">json_object()</a> ###
 ### <a name="type-json_object">json_object()</a> ###
 
 
 
 
-
 <pre><code>
 <pre><code>
 json_object() = <a href="#type-json_object_format_tuple">json_object_format_tuple()</a> | <a href="#type-json_object_format_proplist">json_object_format_proplist()</a> | <a href="#type-json_object_format_map">json_object_format_map()</a>
 json_object() = <a href="#type-json_object_format_tuple">json_object_format_tuple()</a> | <a href="#type-json_object_format_proplist">json_object_format_proplist()</a> | <a href="#type-json_object_format_map">json_object_format_map()</a>
 </code></pre>
 </code></pre>
@@ -158,11 +126,9 @@ json_object() = <a href="#type-json_object_format_tuple">json_object_format_tupl
 
 
 
 
 
 
-
 ### <a name="type-json_object_format_map">json_object_format_map()</a> ###
 ### <a name="type-json_object_format_map">json_object_format_map()</a> ###
 
 
 
 
-
 <pre><code>
 <pre><code>
 json_object_format_map() = #{}
 json_object_format_map() = #{}
 </code></pre>
 </code></pre>
@@ -170,11 +136,9 @@ json_object_format_map() = #{}
 
 
 
 
 
 
-
 ### <a name="type-json_object_format_proplist">json_object_format_proplist()</a> ###
 ### <a name="type-json_object_format_proplist">json_object_format_proplist()</a> ###
 
 
 
 
-
 <pre><code>
 <pre><code>
 json_object_format_proplist() = [{}] | <a href="#type-json_object_members">json_object_members()</a>
 json_object_format_proplist() = [{}] | <a href="#type-json_object_members">json_object_members()</a>
 </code></pre>
 </code></pre>
@@ -182,11 +146,9 @@ json_object_format_proplist() = [{}] | <a href="#type-json_object_members">json_
 
 
 
 
 
 
-
 ### <a name="type-json_object_format_tuple">json_object_format_tuple()</a> ###
 ### <a name="type-json_object_format_tuple">json_object_format_tuple()</a> ###
 
 
 
 
-
 <pre><code>
 <pre><code>
 json_object_format_tuple() = {<a href="#type-json_object_members">json_object_members()</a>}
 json_object_format_tuple() = {<a href="#type-json_object_members">json_object_members()</a>}
 </code></pre>
 </code></pre>
@@ -194,11 +156,9 @@ json_object_format_tuple() = {<a href="#type-json_object_members">json_object_me
 
 
 
 
 
 
-
 ### <a name="type-json_object_members">json_object_members()</a> ###
 ### <a name="type-json_object_members">json_object_members()</a> ###
 
 
 
 
-
 <pre><code>
 <pre><code>
 json_object_members() = [{<a href="#type-json_string">json_string()</a>, <a href="#type-json_value">json_value()</a>}]
 json_object_members() = [{<a href="#type-json_string">json_string()</a>, <a href="#type-json_value">json_value()</a>}]
 </code></pre>
 </code></pre>
@@ -206,30 +166,24 @@ json_object_members() = [{<a href="#type-json_string">json_string()</a>, <a href
 
 
 
 
 
 
-
 ### <a name="type-json_string">json_string()</a> ###
 ### <a name="type-json_string">json_string()</a> ###
 
 
 
 
-
 <pre><code>
 <pre><code>
 json_string() = binary() | atom()
 json_string() = binary() | atom()
 </code></pre>
 </code></pre>
 
 
-
-
- NOTE: `decode/1` always returns `binary()` value
+NOTE: `decode/1` always returns `binary()` value
 
 
 
 
 
 
 ### <a name="type-json_value">json_value()</a> ###
 ### <a name="type-json_value">json_value()</a> ###
 
 
 
 
-
 <pre><code>
 <pre><code>
 json_value() = <a href="#type-json_number">json_number()</a> | <a href="#type-json_string">json_string()</a> | <a href="#type-json_array">json_array()</a> | <a href="#type-json_object">json_object()</a> | <a href="#type-json_boolean">json_boolean()</a> | null
 json_value() = <a href="#type-json_number">json_number()</a> | <a href="#type-json_string">json_string()</a> | <a href="#type-json_array">json_array()</a> | <a href="#type-json_object">json_object()</a> | <a href="#type-json_boolean">json_boolean()</a> | null
 </code></pre>
 </code></pre>
 
 
-
 <a name="index"></a>
 <a name="index"></a>
 
 
 ## Function Index ##
 ## Function Index ##
@@ -246,32 +200,26 @@ json_value() = <a href="#type-json_number">json_number()</a> | <a href="#type-js
 
 
 ### decode/1 ###
 ### decode/1 ###
 
 
-
 <pre><code>
 <pre><code>
 decode(Json::binary()) -&gt; <a href="#type-json_value">json_value()</a>
 decode(Json::binary()) -&gt; <a href="#type-json_value">json_value()</a>
 </code></pre>
 </code></pre>
 <br />
 <br />
 
 
 Equivalent to [`decode(Json, [])`](#decode-2).
 Equivalent to [`decode(Json, [])`](#decode-2).
+
 <a name="decode-2"></a>
 <a name="decode-2"></a>
 
 
 ### decode/2 ###
 ### decode/2 ###
 
 
-
 <pre><code>
 <pre><code>
 decode(Json::binary(), Options::[<a href="#type-decode_option">decode_option()</a>]) -&gt; <a href="#type-json_value">json_value()</a>
 decode(Json::binary(), Options::[<a href="#type-decode_option">decode_option()</a>]) -&gt; <a href="#type-json_value">json_value()</a>
 </code></pre>
 </code></pre>
 <br />
 <br />
 
 
-
 Decodes an erlang term from json text (a utf8 encoded binary)
 Decodes an erlang term from json text (a utf8 encoded binary)
 
 
-
-
 Raises an error exception if input is not valid json
 Raises an error exception if input is not valid json
 
 
-
-
 ```
 ```
   > jsone:decode(<<"1">>, []).
   > jsone:decode(<<"1">>, []).
   1
   1
@@ -286,32 +234,26 @@ Raises an error exception if input is not valid json
 
 
 ### encode/1 ###
 ### encode/1 ###
 
 
-
 <pre><code>
 <pre><code>
 encode(JsonValue::<a href="#type-json_value">json_value()</a>) -&gt; binary()
 encode(JsonValue::<a href="#type-json_value">json_value()</a>) -&gt; binary()
 </code></pre>
 </code></pre>
 <br />
 <br />
 
 
 Equivalent to [`encode(JsonValue, [])`](#encode-2).
 Equivalent to [`encode(JsonValue, [])`](#encode-2).
+
 <a name="encode-2"></a>
 <a name="encode-2"></a>
 
 
 ### encode/2 ###
 ### encode/2 ###
 
 
-
 <pre><code>
 <pre><code>
 encode(JsonValue::<a href="#type-json_value">json_value()</a>, Options::[<a href="#type-encode_option">encode_option()</a>]) -&gt; binary()
 encode(JsonValue::<a href="#type-json_value">json_value()</a>, Options::[<a href="#type-encode_option">encode_option()</a>]) -&gt; binary()
 </code></pre>
 </code></pre>
 <br />
 <br />
 
 
-
 Encodes an erlang term into json text (a utf8 encoded binary)
 Encodes an erlang term into json text (a utf8 encoded binary)
 
 
-
-
 Raises an error exception if input is not an instance of type `json_value()`
 Raises an error exception if input is not an instance of type `json_value()`
 
 
-
-
 ```
 ```
   > jsone:encode([1, null, 2]).
   > jsone:encode([1, null, 2]).
   <<"[1,null,2]">>
   <<"[1,null,2]">>
@@ -326,28 +268,24 @@ Raises an error exception if input is not an instance of type `json_value()`
 
 
 ### try_decode/1 ###
 ### try_decode/1 ###
 
 
-
 <pre><code>
 <pre><code>
 try_decode(Json::binary()) -&gt; {ok, <a href="#type-json_value">json_value()</a>, Remainings::binary()} | {error, {Reason::term(), [<a href="erlang.md#type-stack_item">erlang:stack_item()</a>]}}
 try_decode(Json::binary()) -&gt; {ok, <a href="#type-json_value">json_value()</a>, Remainings::binary()} | {error, {Reason::term(), [<a href="erlang.md#type-stack_item">erlang:stack_item()</a>]}}
 </code></pre>
 </code></pre>
 <br />
 <br />
 
 
 Equivalent to [`try_decode(Json, [])`](#try_decode-2).
 Equivalent to [`try_decode(Json, [])`](#try_decode-2).
+
 <a name="try_decode-2"></a>
 <a name="try_decode-2"></a>
 
 
 ### try_decode/2 ###
 ### try_decode/2 ###
 
 
-
 <pre><code>
 <pre><code>
 try_decode(Json::binary(), Options::[<a href="#type-decode_option">decode_option()</a>]) -&gt; {ok, <a href="#type-json_value">json_value()</a>, Remainings::binary()} | {error, {Reason::term(), [<a href="erlang.md#type-stack_item">erlang:stack_item()</a>]}}
 try_decode(Json::binary(), Options::[<a href="#type-decode_option">decode_option()</a>]) -&gt; {ok, <a href="#type-json_value">json_value()</a>, Remainings::binary()} | {error, {Reason::term(), [<a href="erlang.md#type-stack_item">erlang:stack_item()</a>]}}
 </code></pre>
 </code></pre>
 <br />
 <br />
 
 
-
 Decodes an erlang term from json text (a utf8 encoded binary)
 Decodes an erlang term from json text (a utf8 encoded binary)
 
 
-
-
 ```
 ```
   > jsone:try_decode(<<"[1,2,3] \"next value\"">>, []).
   > jsone:try_decode(<<"[1,2,3] \"next value\"">>, []).
   {ok,[1,2,3],<<" \"next value\"">>}
   {ok,[1,2,3],<<" \"next value\"">>}
@@ -361,28 +299,24 @@ Decodes an erlang term from json text (a utf8 encoded binary)
 
 
 ### try_encode/1 ###
 ### try_encode/1 ###
 
 
-
 <pre><code>
 <pre><code>
 try_encode(JsonValue::<a href="#type-json_value">json_value()</a>) -&gt; {ok, binary()} | {error, {Reason::term(), [<a href="erlang.md#type-stack_item">erlang:stack_item()</a>]}}
 try_encode(JsonValue::<a href="#type-json_value">json_value()</a>) -&gt; {ok, binary()} | {error, {Reason::term(), [<a href="erlang.md#type-stack_item">erlang:stack_item()</a>]}}
 </code></pre>
 </code></pre>
 <br />
 <br />
 
 
 Equivalent to [`try_encode(JsonValue, [])`](#try_encode-2).
 Equivalent to [`try_encode(JsonValue, [])`](#try_encode-2).
+
 <a name="try_encode-2"></a>
 <a name="try_encode-2"></a>
 
 
 ### try_encode/2 ###
 ### try_encode/2 ###
 
 
-
 <pre><code>
 <pre><code>
 try_encode(JsonValue::<a href="#type-json_value">json_value()</a>, Options::[<a href="#type-encode_option">encode_option()</a>]) -&gt; {ok, binary()} | {error, {Reason::term(), [<a href="erlang.md#type-stack_item">erlang:stack_item()</a>]}}
 try_encode(JsonValue::<a href="#type-json_value">json_value()</a>, Options::[<a href="#type-encode_option">encode_option()</a>]) -&gt; {ok, binary()} | {error, {Reason::term(), [<a href="erlang.md#type-stack_item">erlang:stack_item()</a>]}}
 </code></pre>
 </code></pre>
 <br />
 <br />
 
 
-
 Encodes an erlang term into json text (a utf8 encoded binary)
 Encodes an erlang term into json text (a utf8 encoded binary)
 
 
-
-
 ```
 ```
   > jsone:try_encode([1, null, 2]).
   > jsone:try_encode([1, null, 2]).
   {ok,<<"[1,null,2]">>}
   {ok,<<"[1,null,2]">>}

BIN
rebar


+ 17 - 0
rebar.config

@@ -26,3 +26,20 @@
              {preprocess, true}
              {preprocess, true}
             ]}.
             ]}.
 {validate_app_modules, true}.
 {validate_app_modules, true}.
+
+{dialyzer,
+ [
+  {warnings, [error_handling, unmatched_returns]},
+  {get_warnings, true}
+ ]}.
+
+{profiles,
+ [
+  {doc,
+   [
+    {deps,
+     [
+      {edown, {git, "git://github.com/uwiger/edown.git", {branch, "master"}}}
+     ]}
+   ]}
+ ]}.

+ 1 - 0
rebar.lock

@@ -0,0 +1 @@
+[].

BIN
rebar3