Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
Migrate to rebar3
Browse files Browse the repository at this point in the history
  • Loading branch information
g-andrade committed Apr 30, 2017
1 parent 772fa4f commit aa1a100
Show file tree
Hide file tree
Showing 23 changed files with 194 additions and 172 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ rel/example_project
*.swp
test.app.config
variables-ct*
_build/
63 changes: 29 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,43 +1,38 @@
REBAR = $(shell command -v rebar || echo ./rebar)
DEPS_PLT=./.deps_plt
DEPS=erts kernel stdlib
REBAR3_URL=https://s3.amazonaws.com/rebar3/rebar3

.PHONY: all compile test qc clean get-deps build-plt dialyze
ifeq ($(wildcard rebar3),rebar3)
REBAR3 = $(CURDIR)/rebar3
endif

all: compile
REBAR3 ?= $(shell test -e `which rebar3` 2>/dev/null && which rebar3 || echo "./rebar3")

deps:
@$(REBAR) get-deps
@$(REBAR) compile
ifeq ($(REBAR3),)
REBAR3 = $(CURDIR)/rebar3
endif

compile:
@$(REBAR) compile
.PHONY: deps build dialyzer xref doc publish

#test: compile
# @ERL_AFLAGS="-config test/erlquad_tests.app.config" $(REBAR) eunit skip_deps=true
all: build

build: $(REBAR3)
@$(REBAR3) compile

$(REBAR3):
wget $(REBAR3_URL) || curl -Lo rebar3 $(REBAR3_URL)
@chmod a+x rebar3

clean:
@$(REBAR) clean

get-deps:
@$(REBAR) get-deps

$(DEPS_PLT):
@echo Building $(DEPS_PLT)
dialyzer --build_plt \
--output_plt $(DEPS_PLT) \
--apps $(DEPS)
#-r deps \
dialyze: compile $(DEPS_PLT)
dialyzer --fullpath \
--src src \
-Wunmatched_returns \
-Werror_handling \
-Wrace_conditions \
-Wunderspecs \
-r ebin \
--plt $(DEPS_PLT)
@$(REBAR3) clean

dialyzer:
@$(REBAR3) dialyzer

xref:
@$(REBAR) xref
@$(REBAR3) xref

doc: build
./scripts/hackish_inject_version_in_docs.sh
./scripts/hackish_make_docs.sh

publish:
@$(REBAR3) as publish hex publish
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

Copyright (c) 2016 Guilherme Andrade

__Version:__ 1.1.0
__Version:__ 1.1.1

__Authors:__ Guilherme Andrade ([`erlquad(at)gandrade(dot)net`](mailto:erlquad(at)gandrade(dot)net)).

`erlquad`: A simple Erlang quadtree implementation


---------

`erlquad` is a straightforward Erlang implementation of [quadtrees](https://en.wikipedia.org/wiki/Quadtree), supporting both bounding-box outlines as well as precise coordinates for small enough objects.
Expand Down Expand Up @@ -63,7 +64,6 @@ erlquad:objects_all(Q2), % [#big_square{...}, #tiny_circle{...}, #tiny_circle{..
erlquad:objects_deep_all(Q2), % [[], [[#big_square{...}, [[], [], ...]], [[[], ...[]]]]]

```

Define 'COMPILE_NATIVE_ERLQUAD' (e.g. "rebar compile -DCOMPILE_NATIVE_ERLQUAD") for HiPE compilation.


Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

3 changes: 2 additions & 1 deletion doc/utf8/README.md → doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

Copyright (c) 2016 Guilherme Andrade

__Version:__ 1.1.0
__Version:__ 1.1.1

__Authors:__ Guilherme Andrade ([`erlquad(at)gandrade(dot)net`](mailto:erlquad(at)gandrade(dot)net)).

`erlquad`: A simple Erlang quadtree implementation

---------

`erlquad` is a straightforward Erlang implementation of [quadtrees](https://en.wikipedia.org/wiki/Quadtree), supporting both bounding-box outlines as well as precise coordinates for small enough objects.
Expand Down
2 changes: 1 addition & 1 deletion doc/edoc-info
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
%% encoding: UTF-8
{packages,[]}.
{application,erlquad}.
{modules,[erlquad]}.
4 changes: 2 additions & 2 deletions doc/erlquad.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h3 class="typedecl"><a name="type-coordinates">coordinates()</a></h3>


<h3 class="typedecl"><a name="type-erlquad_node">erlquad_node()</a></h3>
<p><tt>erlquad_node() = #erlquad_node{}</tt></p>
<p><tt>erlquad_node() = #erlquad_node{split_x = number(), split_y = number(), children = {<a href="#type-erlquad_node">erlquad_node()</a>, <a href="#type-erlquad_node">erlquad_node()</a>, <a href="#type-erlquad_node">erlquad_node()</a>, <a href="#type-erlquad_node">erlquad_node()</a>} | undefined, bucket = [term()]}</tt></p>


<h3 class="typedecl"><a name="type-fold_fun">fold_fun()</a></h3>
Expand Down Expand Up @@ -110,6 +110,6 @@ <h3 class="function"><a name="objects_fold-3">objects_fold/3</a></h3>
<hr>

<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, Apr 23 2016, 21:57:16.</i></p>
<p><i>Generated by EDoc, Apr 30 2017, 18:52:11.</i></p>
</body>
</html>
78 changes: 11 additions & 67 deletions doc/erlquad.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* [Function Index](#index)
* [Function Details](#functions)



<a name="types"></a>

## Data Types ##
Expand All @@ -17,84 +15,70 @@
### <a name="type-box">box()</a> ###



<pre><code>
box() = {Left::number(), Bottom::number(), Right::number(), Top::number()}
</code></pre>





### <a name="type-coordinates">coordinates()</a> ###



<pre><code>
coordinates() = {X::number(), Y::number()}
</code></pre>





### <a name="type-erlquad_node">erlquad_node()</a> ###



<pre><code>
erlquad_node() = #erlquad_node{}
erlquad_node() = #erlquad_node{split_x = number(), split_y = number(), children = {<a href="#type-erlquad_node">erlquad_node()</a>, <a href="#type-erlquad_node">erlquad_node()</a>, <a href="#type-erlquad_node">erlquad_node()</a>, <a href="#type-erlquad_node">erlquad_node()</a>} | undefined, bucket = [term()]}
</code></pre>





### <a name="type-fold_fun">fold_fun()</a> ###



<pre><code>
fold_fun() = fun((Object::term(), Acc::term()) -&gt; NewAcc::term())
</code></pre>





### <a name="type-object_outline_fun">object_outline_fun()</a> ###



<pre><code>
object_outline_fun() = fun((Object::term()) -&gt; <a href="#type-outline">outline()</a>)
</code></pre>





### <a name="type-outline">outline()</a> ###



<pre><code>
outline() = <a href="#type-box">box()</a> | <a href="#type-coordinates">coordinates()</a>
</code></pre>





### <a name="type-predicate">predicate()</a> ###



<pre><code>
predicate() = fun((Object::term()) -&gt; boolean())
</code></pre>


<a name="index"></a>

## Function Index ##
Expand All @@ -111,129 +95,89 @@ predicate() = fun((Object::term()) -&gt; boolean())

### area_query/5 ###


<pre><code>
area_query(Left::number(), Bottom::number(), Right::number(), Top::number(), QNode::<a href="#type-erlquad_node">erlquad_node()</a>) -&gt; Objects::[term()]
</code></pre>

<br></br>


<br />

<a name="area_query_any-6"></a>

### area_query_any/6 ###


<pre><code>
area_query_any(Predicate::<a href="#type-predicate">predicate()</a>, Left::number(), Bottom::number(), Right::number(), Top::number(), QNode::<a href="#type-erlquad_node">erlquad_node()</a>) -&gt; boolean()
</code></pre>

<br></br>


<br />

<a name="area_query_deep-5"></a>

### area_query_deep/5 ###


<pre><code>
area_query_deep(Left::number(), Bottom::number(), Right::number(), Top::number(), QNode::<a href="#type-erlquad_node">erlquad_node()</a>) -&gt; DeepObjectList::[term(), ...]
</code></pre>

<br></br>


<br />

<a name="area_query_fold-7"></a>

### area_query_fold/7 ###


<pre><code>
area_query_fold(FoldFun::<a href="#type-fold_fun">fold_fun()</a>, FoldAcc0::term(), Left::number(), Bottom::number(), Right::number(), Top::number(), QNode::<a href="#type-erlquad_node">erlquad_node()</a>) -&gt; FoldAccN::term()
</code></pre>

<br></br>


<br />

<a name="new-5"></a>

### new/5 ###


<pre><code>
new(Left::number(), Bottom::number(), Right::number(), Top::number(), Depth::non_neg_integer()) -&gt; <a href="#type-erlquad_node">erlquad_node()</a>
</code></pre>

<br></br>


<br />

<a name="objects_add-3"></a>

### objects_add/3 ###


<pre><code>
objects_add(Objects::[term()], GetOutlineFun::<a href="#type-object_outline_fun">object_outline_fun()</a>, QNode::<a href="#type-erlquad_node">erlquad_node()</a>) -&gt; <a href="#type-erlquad_node">erlquad_node()</a>
</code></pre>

<br></br>


<br />

<a name="objects_all-1"></a>

### objects_all/1 ###


<pre><code>
objects_all(QNode::<a href="#type-erlquad_node">erlquad_node()</a>) -&gt; Objects::[term()]
</code></pre>

<br></br>


<br />

<a name="objects_any-2"></a>

### objects_any/2 ###


<pre><code>
objects_any(Precicate::<a href="#type-predicate">predicate()</a>, QNode::<a href="#type-erlquad_node">erlquad_node()</a>) -&gt; boolean()
</code></pre>

<br></br>


<br />

<a name="objects_deep_all-1"></a>

### objects_deep_all/1 ###


<pre><code>
objects_deep_all(QNode::<a href="#type-erlquad_node">erlquad_node()</a>) -&gt; ObjectsDeepList::[term(), ...]
</code></pre>

<br></br>


<br />

<a name="objects_fold-3"></a>

### objects_fold/3 ###


<pre><code>
objects_fold(FoldFun::<a href="#type-fold_fun">fold_fun()</a>, FoldAcc0::term(), QNode::<a href="#type-erlquad_node">erlquad_node()</a>) -&gt; FoldAccN::term()
</code></pre>

<br></br>


<br />

2 changes: 1 addition & 1 deletion doc/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Overview</title>
<title>The erlquad application</title>
</head>
<frameset cols="20%,80%">
<frame src="modules-frame.html" name="modulesFrame" title="">
Expand Down
2 changes: 1 addition & 1 deletion doc/modules-frame.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Overview</title>
<title>The erlquad application</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
Expand Down
Loading

0 comments on commit aa1a100

Please sign in to comment.