You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2015/09/23 14:28:55 UTC

[01/50] rebar commit: updated refs/heads/import to 5dea85d

Repository: couchdb-rebar
Updated Branches:
  refs/heads/import e9f62c458 -> 5dea85db1


Merge branch 'lrascao-feature/add_gpb_proto_error_test_case'


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/ecf46555
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/ecf46555
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/ecf46555

Branch: refs/heads/import
Commit: ecf46555a1f603f2405e8f82ec09954c0972d068
Parents: dec5bed 37e0cce
Author: Fred Hebert <mo...@ferd.ca>
Authored: Sat May 9 09:09:49 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Sat May 9 09:09:49 2015 -0400

----------------------------------------------------------------------
 inttest/proto_gpb/mock/gpb/src/gpb_compile.erl |  5 +++++
 inttest/proto_gpb/proto.bad/a/b/test3.proto    | 19 +++++++++++++++++
 inttest/proto_gpb/proto.bad/a/test2.proto      | 19 +++++++++++++++++
 inttest/proto_gpb/proto.bad/bad.proto          | 19 +++++++++++++++++
 inttest/proto_gpb/proto.bad/c/d/test5.proto    | 19 +++++++++++++++++
 inttest/proto_gpb/proto.bad/c/test4.proto      | 19 +++++++++++++++++
 inttest/proto_gpb/proto.bad/test.proto         | 19 +++++++++++++++++
 inttest/proto_gpb/proto_gpb_rt.erl             | 23 +++++++++++++++++----
 inttest/proto_gpb/rebar.bad.config             | 23 +++++++++++++++++++++
 src/rebar_base_compiler.erl                    |  2 +-
 10 files changed, 162 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[32/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
 Drop support for `shared` plt


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/643f0453
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/643f0453
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/643f0453

Branch: refs/heads/import
Commit: 643f04531c005b80dcef61038a6626ceedfb6337
Parents: 6e7ec60
Author: James Fish <ja...@fishcakez.com>
Authored: Thu Jun 4 11:03:44 2015 +0100
Committer: James Fish <ja...@fishcakez.com>
Committed: Sat Jun 6 11:06:09 2015 +0100

----------------------------------------------------------------------
 THANKS                 | 1 +
 rebar.config.sample    | 4 +---
 src/rebar_dialyzer.erl | 6 +-----
 3 files changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/643f0453/THANKS
----------------------------------------------------------------------
diff --git a/THANKS b/THANKS
index 2422310..042bb30 100644
--- a/THANKS
+++ b/THANKS
@@ -141,3 +141,4 @@ Paulo F. Oliveira
 Derek Brown
 Danil Onishchenko
 Stavros Aronis
+James Fish

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/643f0453/rebar.config.sample
----------------------------------------------------------------------
diff --git a/rebar.config.sample b/rebar.config.sample
index da1e929..916e47c 100644
--- a/rebar.config.sample
+++ b/rebar.config.sample
@@ -271,9 +271,7 @@
 
 {dialyzer,
  [
-  %% Store PLT in ~/.rebar/plt (Default)
-  {plt_location, shared},
-  %% Store PLT locally inside the project in .rebar
+  %% Store PLT locally inside the project in .rebar (Default)
   {plt_location, local},
   %% Store PLT in custom directory
   {plt_location, "custom_dir"},

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/643f0453/src/rebar_dialyzer.erl
----------------------------------------------------------------------
diff --git a/src/rebar_dialyzer.erl b/src/rebar_dialyzer.erl
index 0e44592..5dec614 100644
--- a/src/rebar_dialyzer.erl
+++ b/src/rebar_dialyzer.erl
@@ -144,7 +144,6 @@ info_help(Description) ->
         {dialyzer,
          [
           {plt_location, local},
-          {plt_location, shared},
           {plt_location, "custom_dir"},
           {plt_extra_apps, [app1, app2]},
           {warnings, [unmatched_returns, error_handling]}
@@ -176,10 +175,7 @@ plt_dir1(_Config, Location) when is_list(Location) ->
     end;
 plt_dir1(Config, local) ->
     BaseDir = rebar_utils:base_dir(Config),
-    filename:join([BaseDir, ".rebar"]);
-plt_dir1(_Config, shared) ->
-    {ok, Home} = init:get_argument(home),
-    filename:join([Home, ".rebar", "plt"]).
+    filename:join([BaseDir, ".rebar"]).
 
 check_plt_existence(Plt) ->
     case filelib:is_regular(Plt) of


[25/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #460 from tuncer/dialyzer

Add Dialyzer plugin

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/b0a8a114
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/b0a8a114
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/b0a8a114

Branch: refs/heads/import
Commit: b0a8a11414f5b839b9431e3a9ca5edae4550f569
Parents: ccf9adc 17477b5
Author: Fred Hebert <mo...@ferd.ca>
Authored: Fri May 29 07:55:45 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Fri May 29 07:55:45 2015 -0400

----------------------------------------------------------------------
 .gitignore                       |   1 -
 CONTRIBUTING.md                  |   7 -
 Makefile                         |  41 +-----
 dialyzer_reference               |   3 -
 ebin/rebar.app                   |  25 +++-
 priv/shell-completion/bash/rebar |   6 +-
 priv/shell-completion/zsh/_rebar |   5 +-
 rebar.config                     |  11 ++
 rebar.config.sample              |  21 ++-
 src/rebar.erl                    |  10 ++
 src/rebar_dialyzer.erl           | 250 ++++++++++++++++++++++++++++++++++
 src/rebar_eunit.erl              |   2 +
 src/rebar_utils.erl              |   2 +
 13 files changed, 325 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/b0a8a114/src/rebar.erl
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/b0a8a114/src/rebar_utils.erl
----------------------------------------------------------------------


[49/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #513 from rebar/jem-pr-release-tool

Add pr2relnotes tool to generate release notes

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/e568e321
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/e568e321
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/e568e321

Branch: refs/heads/import
Commit: e568e321c6e5acafa4faebd591fe001d6c3e8561
Parents: 547f143 420a982
Author: Fred Hebert <mo...@ferd.ca>
Authored: Fri Jun 19 12:05:55 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Fri Jun 19 12:05:55 2015 -0400

----------------------------------------------------------------------
 .gitignore     |   1 +
 pr2relnotes.py | 188 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 189 insertions(+)
----------------------------------------------------------------------



[48/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Add pr2relnotes tool to generate release notes


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/420a9823
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/420a9823
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/420a9823

Branch: refs/heads/import
Commit: 420a98232c83e8cf97fe5d2e064bcafb1c7a0b3d
Parents: 547f143
Author: Jared Morrow <ja...@helium.co>
Authored: Fri Jun 19 09:53:17 2015 -0600
Committer: Jared Morrow <ja...@helium.co>
Committed: Fri Jun 19 09:53:17 2015 -0600

----------------------------------------------------------------------
 .gitignore     |   1 +
 pr2relnotes.py | 188 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 189 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/420a9823/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 671ac10..2b937bb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@
 /.eunit
 /deps
 /.rebar
+env

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/420a9823/pr2relnotes.py
----------------------------------------------------------------------
diff --git a/pr2relnotes.py b/pr2relnotes.py
new file mode 100755
index 0000000..6e9a4f4
--- /dev/null
+++ b/pr2relnotes.py
@@ -0,0 +1,188 @@
+#!/usr/bin/env python
+
+## Install info
+##   $ virtualenv env
+##   $ source env/bin/activate
+##   $ pip install PyGithub
+##
+## Examples:
+##   Find the differences from last tag to current
+##   $ pr2relnotes.py alpha-6 HEAD
+
+import argparse
+import re
+import os
+import subprocess
+from github import Github
+from github import GithubException
+
+
+def dprint(*args):
+    if VERBOSE:
+        print str(args)
+
+def get_args():
+    """
+    Get command line arguments
+    """
+    parser = argparse.ArgumentParser(description="Find the PR's between two versions")
+    parser.add_argument("old", help = "old version to use")
+    parser.add_argument("new", help = "new version to use")
+    parser.add_argument("-v", "--verbose", help="Enable debug output",
+                        default=False,
+                        action="store_true")
+    parser.add_argument("-f", "--file",
+                        help="Output file to store results (default: tagdiff.md)",
+                        default="tagdiff.md")
+    return parser.parse_args()
+
+def search_prs(log):
+    """
+    Search lines of text for PR numbers
+    """
+    # Find all matches using regex iterator, using the PR # as the group match
+    resultlist = [str(m.group(1)) for m in re.finditer(r"erge pull request #(\d+)", log)]
+    return sorted(resultlist)
+
+def get_env(env):
+    return os.environ[env]
+
+def get_formatted_issue(repo, issue, title, url):
+    """
+    Single place to adjust formatting output of PR data
+    """
+    # Newline support writelines() call which doesn't add newlines
+    # on its own
+    return("* {}/{}: [{}]({})\n".format(repo, issue, title, url))
+
+def gh_get_issue_output(org, repo, issuenum):
+    """
+    Look up PR information using the GitHub api
+    """
+    # Attempt to look up the PR, and don't take down the whole
+    # shebang if a API call fails
+    # This will fail often on forks who don't have the
+    # PRs numbers associated with the forked account
+    # Return empty string on error
+    try:
+        repoObj = gh.get_repo(org + "/" + repo)
+        issue = repoObj.get_issue(int(issuenum))
+        title = issue.title
+        html_url = issue.html_url
+    except GithubException as e:
+        print "Github error({0}): {1}".format(e.status, e.data)
+        return ""
+    except:
+        print "Some github error"
+        return ""
+
+    return(get_formatted_issue(repo, issuenum, title, html_url))
+
+
+def get_org(repourl):
+    """
+    Simple function to parse the organization out of a GitHub URL
+    """
+    dprint("Current repourl to search: " + repourl)
+    # GitHub URLs can be:
+    #    http[s]://www.github.com/org/repo
+    # or           git@github.com:/org/repo
+    pattern = re.compile(r"github.com[/:]+(\w+)/")
+    m = re.search(pattern, repourl)
+    # Fail fast if this is wrong so we can add a pattern to the search
+    if m:
+        return m.group(1)
+    else:
+        raise Exception("Incorrect regex pattern finding repo org")
+
+def get_name(repourl):
+    """
+    Simple function to parse the repository name out of a GitHub URL
+    """
+    dprint("Current repourl to search: " + repourl)
+    repo_pattern = re.compile(r"github.com[/:]\w+/(\w+)")
+    m = re.search(repo_pattern, repourl)
+    if m:
+        return m.group(1)
+    else:
+        raise Exception("Incorrect rexex pattern finding repo url")
+
+def get_repo_url_from_remote():
+    """
+    Function that gets the repository URL from the `git remote` listing
+    """
+    git_remote_bytes = subprocess.check_output(["git", "remote", "-v"])
+    # check_output returns the command results in raw byte format
+    remote_string = git_remote_bytes.decode('utf-8')
+
+    pattern = re.compile(r"github.com[/:]\w+/\w+")
+    m = re.search(pattern, remote_string)
+    if m:
+        return m.group(0)
+    else:
+        raise Exception("Incorrect rexex pattern finding repo url")
+
+def process_log(gitlog, repo_url):
+    """
+    Handles the processing of the gitlog and returns a list
+    of PRs already formatted for output
+    """
+    pr_list = search_prs(gitlog)
+    repoorg = get_org(repo_url)
+    reponame = get_name(repo_url)
+    pr_buffer = []
+    for issue in pr_list:
+            pr_buffer.append(gh_get_issue_output(repoorg, reponame, issue))
+
+    return pr_buffer
+
+def fetch_log(old_ver, new_ver):
+    """
+    Function that processes the git log between the old and new versions
+    """
+    dprint("Current working directory", os.getcwd())
+    gitlogbytes = subprocess.check_output(["git", "log",
+                                           str(old_ver + ".." + new_ver)])
+    return gitlogbytes.decode('utf-8')
+
+
+def compare_versions(repo_url, old_ver, new_ver):
+    # Formatted list of all PRs for all repos
+    pr_out = []
+    gitlog = fetch_log(old_ver, new_ver)
+    pr_out.extend(process_log(gitlog, repo_url))
+    return pr_out
+
+def main():
+    args = get_args()
+
+    # Setup the GitHub object for later use
+    global gh
+    gh = Github(get_env("GHAUTH"))
+
+    if gh == "":
+        raise Exception("Env var GHAUTH must be set to a valid GitHub API key")
+
+    if args.verbose:
+        global VERBOSE
+        VERBOSE=True
+
+    dprint("Inspecting difference in between: ", args.old, " and ", args.new)
+
+    # Find the github URL of the repo we are operating on
+    repo_url = get_repo_url_from_remote()
+
+    # Compare old and new versions
+    pr_list = compare_versions(repo_url, args.old, args.new)
+
+    # Writeout PR listing
+    print "Writing output to file %s" % args.file
+    with open(args.file, 'w') as output:
+        output.writelines(pr_list)
+
+
+if __name__ == "__main__":
+    VERBOSE=False
+    gh=None
+    topdir=os.getcwd()
+    main()


[11/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Update PLT detail for make build_plt

The PLT that rebar will have dialyzer use is now created with make
build_plt - this commit explains that.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/65ac13bf
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/65ac13bf
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/65ac13bf

Branch: refs/heads/import
Commit: 65ac13bf13243c76210a2604b6a5f2f6aea441e9
Parents: 791db71
Author: Derek Brown <de...@gmail.com>
Authored: Tue May 12 12:00:27 2015 -0400
Committer: Derek Brown <de...@gmail.com>
Committed: Tue May 12 12:14:57 2015 -0400

----------------------------------------------------------------------
 CONTRIBUTING.md | 7 +------
 THANKS          | 1 +
 2 files changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/65ac13bf/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 9c88baf..968153e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -77,12 +77,7 @@ and [Dialyzer](http://www.erlang.org/doc/man/dialyzer.html), causing a test
 failure.  
 If that happens, running `make clean` before running `make check` could solve the problem.  
 
-Dialyzer requires a PLT (Persitent Lookup Table) to work with. By default, it will look for  
-`$HOME/.dialyzer.plt` (alternatively, the `DIALYZER_PLT` environment variable can be set  
-to point to a different location). If a PLT file cannot be found, Dialyzer (via `make check`) will  
-fail- the output will indicate `"Could not read PLT file"`, including the path it tried to use.  
-See the [Dialyzer man page](http://www.erlang.org/doc/man/dialyzer.html) or [this further explanation](http://www.erlang.org/doc/apps/dialyzer/dialyzer_chapter.html) for details on creating the initial  
-PLT file.
+Dialyzer requires a PLT (Persitent Lookup Table) to work with, and `make check` will fail without it. The PLT that rebar uses needs to initially be created with `make build_plt`, and is named based on the version of Erlang/OTP in use. See the [Dialyzer man page](http://www.erlang.org/doc/man/dialyzer.html) or [this further explanation](http://www.erlang.org/doc/apps/dialyzer/dialyzer_chapter.html) for additional information.
 
 If you change any of the files with known but safe to ignore Dialyzer warnings, you may  
 have to adapt the line number(s) in [dialyzer_reference](dialyzer_reference). If you do that, 

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/65ac13bf/THANKS
----------------------------------------------------------------------
diff --git a/THANKS b/THANKS
index 6365b66..d9b9984 100644
--- a/THANKS
+++ b/THANKS
@@ -138,3 +138,4 @@ Brian H. Ward
 David Kubecka
 Carlos Eduardo de Paula
 Paulo F. Oliveira
+Derek Brown


[04/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge branch 'dia_first_files' of https://github.com/fholzhauser/rebar into fholzhauser-dia_first_files


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/e200ca1a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/e200ca1a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/e200ca1a

Branch: refs/heads/import
Commit: e200ca1ae3f338bf324f387ee6771de7ffe74a4b
Parents: bb92ba9 b22487d
Author: Fred Hebert <mo...@ferd.ca>
Authored: Sat May 9 14:03:30 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Sat May 9 14:03:30 2015 -0400

----------------------------------------------------------------------
 rebar.config.sample        |  8 +++++++
 src/rebar_dia_compiler.erl | 47 ++++++++++++++++++++++++++++++++++-------
 2 files changed, 47 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/e200ca1a/rebar.config.sample
----------------------------------------------------------------------
diff --cc rebar.config.sample
index 91d3dff,726dbed..90ea6ee
--- a/rebar.config.sample
+++ b/rebar.config.sample
@@@ -89,21 -89,14 +89,29 @@@
  %% Options for the ErlyDTL compiler
  {erlydtl_opts, []}.
  
 +%% == Proto compiler ==
 +{proto_opts, [
 +    {compiler, protobuffs},
 +    {src_dirs, ["src"]}
 +]}.
 +%% Available compilers for protocol buffer files (*.proto):
 +%%   protobuffs  (default)
 +%%   gpb
 +%% Optional src_dirs which is a list of directories where
 +%% to look for .proto files, default is src
 +
 +%% Options for the gpb protocol buffer compiler,
 +%% if selected by the proto_compiler option
 +{gpb_opts, []}.
 +
+ %% == Diameter compiler ==
+ 
+ %% Diameter files to compile before the rest
+ {dia_first_files, []}.
+ 
+ %% Options for the diameter compiler
+ {dia_opts, []}.
+ 
  %% == EUnit ==
  
  %% Options for eunit:test()

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/e200ca1a/src/rebar_dia_compiler.erl
----------------------------------------------------------------------


[15/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
dialyzer: consistent warning formatting


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/0223f1e4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/0223f1e4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/0223f1e4

Branch: refs/heads/import
Commit: 0223f1e4342e906c90a1d8724c1fa917f69e1fca
Parents: 850a8a3
Author: James Fish <ja...@fishcakez.com>
Authored: Sun Mar 29 18:49:09 2015 +0100
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Fri May 22 09:53:09 2015 +0200

----------------------------------------------------------------------
 src/rebar_dialyzer.erl | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/0223f1e4/src/rebar_dialyzer.erl
----------------------------------------------------------------------
diff --git a/src/rebar_dialyzer.erl b/src/rebar_dialyzer.erl
index 5f0cb1e..1685b99 100644
--- a/src/rebar_dialyzer.erl
+++ b/src/rebar_dialyzer.erl
@@ -63,7 +63,7 @@ dialyze(Config, AppFile) ->
         [] ->
             {ok, NewConfig};
         Ws ->
-            print_warnings(Ws),
+            print_warnings(Ws, fullpath),
             ?FAIL
     end.
 
@@ -83,7 +83,7 @@ dialyze(Config, AppFile) ->
             %% As plt_build may raise warnings but still successfully
             %% create the PLT, we cannot interpret this as failure,
             %% and therefore all we can do is report warnings.
-            print_warnings(Ws)
+            print_warnings(Ws, basename)
     end.
 
 'check-plt'(Config, AppFile) ->
@@ -104,7 +104,7 @@ dialyze(Config, AppFile) ->
         [] ->
             {ok, NewConfig};
         Ws ->
-            print_warnings(Ws),
+            print_warnings(Ws, basename),
             ?FAIL
     end.
 
@@ -195,15 +195,24 @@ run(Opts) ->
 warnings(Config) ->
     rebar_config:get_local(Config, dialyzer_warnings, []).
 
-print_warnings(Ws) ->
+print_warnings(Ws, Option) ->
     lists:foreach(
       fun(W) ->
-              ?CONSOLE("~s~n", [format_warning(W)])
+              ?CONSOLE("~s~n", [format_warning(W, Option)])
       end,
       Ws).
 
-format_warning(W) ->
-    dialyzer:format_warning(W, fullpath).
+format_warning(W, Option) ->
+    case dialyzer:format_warning(W, Option) of
+        ":0: " ++ Unknown ->
+            strip_newline(Unknown);
+        Warning ->
+            strip_newline(Warning)
+    end.
+
+%% Warning may or may not have trailing \n.
+strip_newline(Warning) ->
+    string:strip(Warning, right, $\n).
 
 app_dirs(Config, AppFile) ->
     {NewConfig, AppFileApps} = app_file_apps(Config, AppFile),


[36/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
erlc: do not crash if dep file cannot be found


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/ded3be6e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/ded3be6e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/ded3be6e

Branch: refs/heads/import
Commit: ded3be6e519b3192bc19671f2b44efe2dc004573
Parents: a371387
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Wed Jun 3 21:42:11 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Mon Jun 8 01:05:12 2015 +0200

----------------------------------------------------------------------
 src/rebar_erlc_compiler.erl | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/ded3be6e/src/rebar_erlc_compiler.erl
----------------------------------------------------------------------
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index 937fe5f..5c33239 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -410,6 +410,8 @@ update_erlcinfo(G, Dirs, Source) ->
                     %% The file doesn't exist anymore,
                     %% erase it from the graph.
                     %% All the edges will be erased automatically.
+                    ?WARN("File missing. Remove from dep graph:~n~s~n",
+                          [Source]),
                     digraph:del_vertex(G, Source),
                     modified;
                 LastModified when LastUpdated < LastModified ->
@@ -439,6 +441,9 @@ update_max_modified_deps(G, Source) ->
     digraph:add_vertex(G, Source, MaxModified),
     MaxModified.
 
+modify_erlcinfo(_G, Source, 0, _Dirs) ->
+    ?WARN("modify_erlcinfo: failed to open file:~n~s~n", [Source]),
+    unmodified;
 modify_erlcinfo(G, Source, LastModified, Dirs) ->
     {ok, Fd} = file:open(Source, [read]),
     Incls = parse_attrs(Fd, []),


[09/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #494 from derek121/dialyzer-warnings-addition

Update line number of allowed dialyzer error

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/d054ad6c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/d054ad6c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/d054ad6c

Branch: refs/heads/import
Commit: d054ad6ca3333228e8ff7fefdf1455a039eb35a9
Parents: de94c20 2055a53
Author: Fred Hebert <mo...@ferd.ca>
Authored: Tue May 12 08:36:33 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Tue May 12 08:36:33 2015 -0400

----------------------------------------------------------------------
 dialyzer_reference | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[21/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge branch 'ct-groups-and-cases' of https://github.com/RubberCthulhu/rebar into RubberCthulhu-ct-groups-and-cases

Conflicts:
	THANKS


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/388ed045
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/388ed045
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/388ed045

Branch: refs/heads/import
Commit: 388ed045d44359142d8ba9e964e5fc3c4bbcc5ab
Parents: 881df99 b041bd9
Author: Fred Hebert <mo...@ferd.ca>
Authored: Wed May 27 08:27:09 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Wed May 27 08:27:09 2015 -0400

----------------------------------------------------------------------
 THANKS           |  1 +
 src/rebar.erl    |  2 +-
 src/rebar_ct.erl | 72 +++++++++++++++++++++++++++++++++++++++++----------
 3 files changed, 61 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/388ed045/THANKS
----------------------------------------------------------------------
diff --cc THANKS
index d9b9984,13e1cd7..a205df7
--- a/THANKS
+++ b/THANKS
@@@ -135,7 -135,4 +135,8 @@@ Pavel Baturk
  Igor Savchuk
  Mark Anderson
  Brian H. Ward
 +David Kubecka
 +Carlos Eduardo de Paula
 +Paulo F. Oliveira
 +Derek Brown
+ Danil Onishchenko


[14/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Suppress missing calls Dialyzer warnings


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/72d2bf50
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/72d2bf50
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/72d2bf50

Branch: refs/heads/import
Commit: 72d2bf506d3e3f8011c43f7d8e40cdeac892ac34
Parents: 0223f1e
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Fri Apr 10 00:41:23 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Fri May 22 09:53:09 2015 +0200

----------------------------------------------------------------------
 src/rebar_eunit.erl | 2 ++
 src/rebar_utils.erl | 2 ++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/72d2bf50/src/rebar_eunit.erl
----------------------------------------------------------------------
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl
index 17ee62e..913f2f9 100644
--- a/src/rebar_eunit.erl
+++ b/src/rebar_eunit.erl
@@ -72,6 +72,8 @@
 %% for internal use only
 -export([info/2]).
 
+-dialyzer({no_missing_calls, pre15b02_eunit_primitive/3}).
+
 -include("rebar.hrl").
 
 -define(EUNIT_DIR, ".eunit").

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/72d2bf50/src/rebar_utils.erl
----------------------------------------------------------------------
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index 62446e3..9765171 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -72,6 +72,8 @@
 %% for internal use only
 -export([otp_release/0]).
 
+-dialyzer({no_missing_calls, escript_foldl/3}).
+
 -include("rebar.hrl").
 
 %% ====================================================================


[44/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
rebar_utils: rename internal function


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/54a72423
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/54a72423
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/54a72423

Branch: refs/heads/import
Commit: 54a724238f63aeaf59542c7dc7baeaf569e3fd0d
Parents: 8ec3a55
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Fri Jun 12 12:56:20 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Fri Jun 12 12:56:20 2015 +0200

----------------------------------------------------------------------
 src/rebar_utils.erl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/54a72423/src/rebar_utils.erl
----------------------------------------------------------------------
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index b250671..9681756 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -405,15 +405,15 @@ patch_env(Config, [E | Rest]) ->
 %% ====================================================================
 
 otp_release() ->
-    rmemo:call(fun otp_release1/1, [(erlang:system_info(otp_release))]).
+    rmemo:call(fun otp_release_1/1, [(erlang:system_info(otp_release))]).
 
 %% If OTP <= R16, otp_release is already what we want.
-otp_release1([$R,N|_]=Rel) when is_integer(N) ->
+otp_release_1([$R,N|_]=Rel) when is_integer(N) ->
     Rel;
 %% If OTP >= 17.x, erlang:system_info(otp_release) returns just the
 %% major version number, we have to read the full version from
 %% a file. See http://www.erlang.org/doc/system_principles/versions.html
-otp_release1(Rel) ->
+otp_release_1(Rel) ->
     Files = [
              filename:join([code:root_dir(), "releases", Rel, "OTP_VERSION"]),
              filename:join([code:root_dir(), "OTP_VERSION"])


[33/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #504 from fishcakez/plt_name

Drop `shared` PLTs support and change PLT name to <OTP-VSN>.plt

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/3f0ead5d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/3f0ead5d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/3f0ead5d

Branch: refs/heads/import
Commit: 3f0ead5dc5c110d30f7a04f6dce044eba2be8282
Parents: cfe4b63 643f045
Author: Fred Hebert <mo...@ferd.ca>
Authored: Sun Jun 7 11:10:26 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Sun Jun 7 11:10:26 2015 -0400

----------------------------------------------------------------------
 THANKS                 | 1 +
 rebar.config.sample    | 4 +---
 src/rebar_dialyzer.erl | 6 +-----
 3 files changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------



[05/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge branch 'fholzhaut push origin masterser-dia_first_files'


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/9455bc5f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/9455bc5f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/9455bc5f

Branch: refs/heads/import
Commit: 9455bc5f5e168a869acae731cea5368602d95b4e
Parents: bb92ba9 e200ca1
Author: Fred Hebert <mo...@ferd.ca>
Authored: Sat May 9 14:03:42 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Sat May 9 14:03:42 2015 -0400

----------------------------------------------------------------------
 rebar.config.sample        |  8 +++++++
 src/rebar_dia_compiler.erl | 47 ++++++++++++++++++++++++++++++++++-------
 2 files changed, 47 insertions(+), 8 deletions(-)
----------------------------------------------------------------------



[19/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
CONTRIBUTING: update Dialyzer bits


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/5dfdd906
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/5dfdd906
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/5dfdd906

Branch: refs/heads/import
Commit: 5dfdd9066f04f3e3c3123f061bb073eaf22f91c8
Parents: 46869da
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Tue May 12 15:08:21 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Fri May 22 09:53:38 2015 +0200

----------------------------------------------------------------------
 CONTRIBUTING.md | 7 -------
 1 file changed, 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/5dfdd906/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 968153e..1ef5594 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -77,13 +77,6 @@ and [Dialyzer](http://www.erlang.org/doc/man/dialyzer.html), causing a test
 failure.  
 If that happens, running `make clean` before running `make check` could solve the problem.  
 
-Dialyzer requires a PLT (Persitent Lookup Table) to work with, and `make check` will fail without it. The PLT that rebar uses needs to initially be created with `make build_plt`, and is named based on the version of Erlang/OTP in use. See the [Dialyzer man page](http://www.erlang.org/doc/man/dialyzer.html) or [this further explanation](http://www.erlang.org/doc/apps/dialyzer/dialyzer_chapter.html) for additional information.
-
-If you change any of the files with known but safe to ignore Dialyzer warnings, you may  
-have to adapt the line number(s) in [dialyzer_reference](dialyzer_reference). If you do that, 
-do not remove the  
-leading blank line.
-
 #### Structuring your commits
 
 Fixing a bug is one commit.  


[45/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #511 from tuncer/memo

Add and use memoization server

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/02623325
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/02623325
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/02623325

Branch: refs/heads/import
Commit: 0262332565b8b29ff0fb8f7ed0aad0ff9c9b1839
Parents: a3ab9cd 54a7242
Author: Fred Hebert <mo...@ferd.ca>
Authored: Fri Jun 19 10:30:28 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Fri Jun 19 10:30:28 2015 -0400

----------------------------------------------------------------------
 ebin/rebar.app      |   3 +-
 src/rebar.erl       |   6 +
 src/rebar_utils.erl |  29 ++---
 src/rmemo.erl       | 294 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 310 insertions(+), 22 deletions(-)
----------------------------------------------------------------------



[50/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
bump to 2.6.0


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/5dea85db
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/5dea85db
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/5dea85db

Branch: refs/heads/import
Commit: 5dea85db1b697466586877bed133748bd80fa180
Parents: e568e32
Author: Fred Hebert <mo...@ferd.ca>
Authored: Fri Jun 19 12:14:28 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Fri Jun 19 12:14:28 2015 -0400

----------------------------------------------------------------------
 RELEASE-NOTES.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++
 ebin/rebar.app   |  2 +-
 2 files changed, 88 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/5dea85db/RELEASE-NOTES.md
----------------------------------------------------------------------
diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index b0037b9..aa69555 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -1,3 +1,90 @@
+# 2.6.0
+
+* rebar/203: [Pluggable proto compilers gpb](https://github.com/rebar/rebar/pull/203)
+* rebar/273: [Use target_dir as source of new version in generate-appups](https://github.com/rebar/rebar/pull/273)
+* rebar/293: [Check C source dependencies in needs_compile](https://github.com/rebar/rebar/pull/293)
+* rebar/305: [Fix compiler invocation on multiarch Linux](https://github.com/rebar/rebar/pull/305)
+* rebar/322: [Treat vsn mismatch as warning if -k/--keep-going](https://github.com/rebar/rebar/pull/322)
+* rebar/336: [Add details on Dialyzer with "make check"](https://github.com/rebar/rebar/pull/336)
+* rebar/337: [Implement eflame -p/--profile support](https://github.com/rebar/rebar/pull/337)
+* rebar/338: [Processing .app.src.script expects a single value to be returned.](https://github.com/rebar/rebar/pull/338)
+* rebar/344: [Manually clean up paths.](https://github.com/rebar/rebar/pull/344)
+* rebar/351: [fish shell completions for rebar](https://github.com/rebar/rebar/pull/351)
+* rebar/352: [Add typer target (rebase of #309)](https://github.com/rebar/rebar/pull/352)
+* rebar/354: [compiler respects 'keep_going' flag](https://github.com/rebar/rebar/pull/354)
+* rebar/355: [Fix 'make build_plt'](https://github.com/rebar/rebar/pull/355)
+* rebar/356: [Fix minor typo in CONTRIBUTING.md](https://github.com/rebar/rebar/pull/356)
+* rebar/360: [Minor follow-up fixes for #293](https://github.com/rebar/rebar/pull/360)
+* rebar/368: [Escape more characters in path (fix #367)](https://github.com/rebar/rebar/pull/368)
+* rebar/371: [Fix cover print truncation when coverage is 100%](https://github.com/rebar/rebar/pull/371)
+* rebar/372: [Implement eval command via nodetool](https://github.com/rebar/rebar/pull/372)
+* rebar/376: [Remove check adding ebin to path for edoc target](https://github.com/rebar/rebar/pull/376)
+* rebar/378: [deps: fix delete-deps if deps_dir ends with dot](https://github.com/rebar/rebar/pull/378)
+* rebar/382: [Adapt dialyzer_reference to ba466e2d changes](https://github.com/rebar/rebar/pull/382)
+* rebar/385: [Fix Dialyzer warning introduced in 0caf047f](https://github.com/rebar/rebar/pull/385)
+* rebar/386: [Recompile .proto files with gpb also with prefix/suffix](https://github.com/rebar/rebar/pull/386)
+* rebar/386: [Recompile .proto files with gpb also with prefix/suffix](https://github.com/rebar/rebar/pull/386)
+* rebar/386: [Recompile .proto files with gpb also with prefix/suffix](https://github.com/rebar/rebar/pull/386)
+* rebar/399: [Increase the timeout for the inttest/proto_gpb](https://github.com/rebar/rebar/pull/399)
+* rebar/400: [add Emacs/vi header to non-dummy test modules](https://github.com/rebar/rebar/pull/400)
+* rebar/403: [Update reference to installation notes](https://github.com/rebar/rebar/pull/403)
+* rebar/404: [Consistently format export attributes](https://github.com/rebar/rebar/pull/404)
+* rebar/405: [Generate cachegrind file if erlgrind is available](https://github.com/rebar/rebar/pull/405)
+* rebar/406: [Fix deps path check in rebar_ct:collect_glob/3](https://github.com/rebar/rebar/pull/406)
+* rebar/408: [Fix/remove duplicate console message](https://github.com/rebar/rebar/pull/408)
+* rebar/411: [Fix app.config argument passing when using ct_run (take 2)](https://github.com/rebar/rebar/pull/411)
+* rebar/413: [Revert "Merge pull request #386 ... gpb-recompilation...detection"](https://github.com/rebar/rebar/pull/413)
+* rebar/418: [Fix #415 (reltool vsn check)](https://github.com/rebar/rebar/pull/418)
+* rebar/420: [Mock gpb and protobuffs, in inttest, replacing external dependencies](https://github.com/rebar/rebar/pull/420)
+* rebar/421: [inttest/ct3: fix travis-ci breakage](https://github.com/rebar/rebar/pull/421)
+* rebar/424: [Gpb recompilation detection (using base compiler)](https://github.com/rebar/rebar/pull/424)
+* rebar/425: [Copy instead of rsync gpb and protobuffs inttest mocks](https://github.com/rebar/rebar/pull/425)
+* rebar/426: [Fixed #133. Release upgrade now handle long and short names properly.](https://github.com/rebar/rebar/pull/426)
+* rebar/428: [Remove a git url in gpb and protobuffs inttest configs](https://github.com/rebar/rebar/pull/428)
+* rebar/430: [Exit with proper status code if 'eval' fails](https://github.com/rebar/rebar/pull/430)
+* rebar/432: [Document recursive_cmds in -r help string as well](https://github.com/rebar/rebar/pull/432)
+* rebar/433: [inttest/ct3: fix overlong line](https://github.com/rebar/rebar/pull/433)
+* rebar/437: [Fix .app.src.script bug introduced in b44b4f4](https://github.com/rebar/rebar/pull/437)
+* rebar/440: [Delete obsolete file](https://github.com/rebar/rebar/pull/440)
+* rebar/442: [.travis.yml: print information before running script](https://github.com/rebar/rebar/pull/442)
+* rebar/444: [Fix incorrect "not an app dir" warning](https://github.com/rebar/rebar/pull/444)
+* rebar/445: [rebar doesn't respect the order of erl_first_files given in the rebar.conf file](https://github.com/rebar/rebar/pull/445)
+* rebar/447: [Support custom protobuf directory](https://github.com/rebar/rebar/pull/447)
+* rebar/449: [Support .appup.src files](https://github.com/rebar/rebar/pull/449)
+* rebar/452: [added 'shell' command to bash-completion](https://github.com/rebar/rebar/pull/452)
+* rebar/456: [Generate json output from cover](https://github.com/rebar/rebar/pull/456)
+* rebar/458: [Change env var delimiter to match non-word](https://github.com/rebar/rebar/pull/458)
+* rebar/459: [Remove -m64 flag.](https://github.com/rebar/rebar/pull/459)
+* rebar/460: [Add Dialyzer plugin](https://github.com/rebar/rebar/pull/460)
+* rebar/461: [Fix OTP .appup.src processing on empty lists](https://github.com/rebar/rebar/pull/461)
+* rebar/463: [Print more info when profiling](https://github.com/rebar/rebar/pull/463)
+* rebar/466: [Improve test targets in Makefile](https://github.com/rebar/rebar/pull/466)
+* rebar/467: [Refactor logic and optimizations in rebar_erlc_compiler:doterl_compile/4](https://github.com/rebar/rebar/pull/467)
+* rebar/469: [Fix dialyzer warnings](https://github.com/rebar/rebar/pull/469)
+* rebar/470: [Fix whitespace errors](https://github.com/rebar/rebar/pull/470)
+* rebar/471: [Fix whitespace errors](https://github.com/rebar/rebar/pull/471)
+* rebar/475: [Adapt to 18.x time api changes](https://github.com/rebar/rebar/pull/475)
+* rebar/477: [Enable parse transformations in rebar config](https://github.com/rebar/rebar/pull/477)
+* rebar/478: [bootstrap: better warning fix (Thanks James Fish)](https://github.com/rebar/rebar/pull/478)
+* rebar/482: [Windows runner - CD to node root](https://github.com/rebar/rebar/pull/482)
+* rebar/484: [/me added to THANKS](https://github.com/rebar/rebar/pull/484)
+* rebar/485: [avoid pre-compile time errors in expand_include_lib_path](https://github.com/rebar/rebar/pull/485)
+* rebar/487: [erlc: fix recently introduced whitespace errors](https://github.com/rebar/rebar/pull/487)
+* rebar/489: [Fix crash on failed build console output](https://github.com/rebar/rebar/pull/489)
+* rebar/494: [Update line number of allowed dialyzer error](https://github.com/rebar/rebar/pull/494)
+* rebar/496: [Update PLT detail for make build_plt](https://github.com/rebar/rebar/pull/496)
+* rebar/499: [Try one more location for the OTP_VERSION file](https://github.com/rebar/rebar/pull/499)
+* rebar/500: [Makefile: clean only .rebar/erlcinfo](https://github.com/rebar/rebar/pull/500)
+* rebar/502: [Don't crash if missing OTP_VERSION file (fix #350)](https://github.com/rebar/rebar/pull/502)
+* rebar/504: [Drop `shared` PLTs support and change PLT name to <OTP-VSN>.plt](https://github.com/rebar/rebar/pull/504)
+* rebar/505: [rebar_utils: explain pdict use](https://github.com/rebar/rebar/pull/505)
+* rebar/508: [rebar_core: add missing newline in log msg](https://github.com/rebar/rebar/pull/508)
+* rebar/509: [erlc: do not crash if dep file cannot be found](https://github.com/rebar/rebar/pull/509)
+* rebar/510: [Fix 'make deps'](https://github.com/rebar/rebar/pull/510)
+* rebar/511: [Add and use memoization server](https://github.com/rebar/rebar/pull/511)
+* rebar/512: [rmemo: properly handle unsupported call](https://github.com/rebar/rebar/pull/512)
+
+
 # Rebar 2.5.1
 
 * rebar/299: [Fix OS X resource fork handling (Reported-by: Richard O'Keefe)](https://github.com/rebar/rebar/pull/299)

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/5dea85db/ebin/rebar.app
----------------------------------------------------------------------
diff --git a/ebin/rebar.app b/ebin/rebar.app
index 975fabc..152829d 100644
--- a/ebin/rebar.app
+++ b/ebin/rebar.app
@@ -3,7 +3,7 @@
 
 {application, rebar,
  [{description, "Rebar: Erlang Build Tool"},
-  {vsn, "2.5.1"},
+  {vsn, "2.6.0"},
   {modules, [ rebar,
               rebar_abnfc_compiler,
               rebar_app_utils,


[17/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Fix rebar.config.sample formatting


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/094b74e4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/094b74e4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/094b74e4

Branch: refs/heads/import
Commit: 094b74e488291156cda8d12fffa6f62750d44f47
Parents: 881df99
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Fri May 15 11:56:00 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Fri May 22 09:53:09 2015 +0200

----------------------------------------------------------------------
 rebar.config.sample | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/094b74e4/rebar.config.sample
----------------------------------------------------------------------
diff --git a/rebar.config.sample b/rebar.config.sample
index 90ea6ee..b650bc9 100644
--- a/rebar.config.sample
+++ b/rebar.config.sample
@@ -91,9 +91,9 @@
 
 %% == Proto compiler ==
 {proto_opts, [
-    {compiler, protobuffs},
-    {src_dirs, ["src"]}
-]}.
+              {compiler, protobuffs},
+              {src_dirs, ["src"]}
+             ]}.
 %% Available compilers for protocol buffer files (*.proto):
 %%   protobuffs  (default)
 %%   gpb


[47/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #512 from tuncer/fix-rememo-handle_call

rmemo: properly handle unsupported call

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/547f1436
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/547f1436
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/547f1436

Branch: refs/heads/import
Commit: 547f14363a387e5958520f8270350f4b6ebd0bb9
Parents: 0262332 e3a2917
Author: Fred Hebert <mo...@ferd.ca>
Authored: Fri Jun 19 10:39:47 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Fri Jun 19 10:39:47 2015 -0400

----------------------------------------------------------------------
 src/rmemo.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[31/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #505 from tuncer/pdict-comment

rebar_utils: explain pdict use

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/cfe4b635
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/cfe4b635
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/cfe4b635

Branch: refs/heads/import
Commit: cfe4b63507c7614441abb0c6971fcb50b342ac87
Parents: 6e7ec60 8559c5f
Author: Fred Hebert <mo...@ferd.ca>
Authored: Wed Jun 3 14:04:48 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Wed Jun 3 14:04:48 2015 -0400

----------------------------------------------------------------------
 src/rebar_utils.erl | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[02/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge branch 'fix/xref_behavior' of https://github.com/paulo-ferraz-oliveira/rebar into paulo-ferraz-oliveira-fix/xref_behavior


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/1e25a3b0
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/1e25a3b0
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/1e25a3b0

Branch: refs/heads/import
Commit: 1e25a3b0e087b8cd260ca3cd1dda4f43f411e960
Parents: ecf4655 88678ea
Author: Fred Hebert <mo...@ferd.ca>
Authored: Sat May 9 14:01:30 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Sat May 9 14:01:30 2015 -0400

----------------------------------------------------------------------
 THANKS             | 1 +
 src/rebar_xref.erl | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/1e25a3b0/THANKS
----------------------------------------------------------------------
diff --cc THANKS
index 9ab5e03,ba63300..6365b66
--- a/THANKS
+++ b/THANKS
@@@ -133,7 -133,4 +133,8 @@@ Vlad Dumitresc
  stwind
  Pavel Baturko
  Igor Savchuk
 +Mark Anderson
 +Brian H. Ward
 +David Kubecka
 +Carlos Eduardo de Paula
+ Paulo F. Oliveira

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/1e25a3b0/src/rebar_xref.erl
----------------------------------------------------------------------


[34/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
rebar_core: add missing newline in log msg


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/fa6de2a1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/fa6de2a1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/fa6de2a1

Branch: refs/heads/import
Commit: fa6de2a17296e9b50677d6161fb8b34dd1c3dc3d
Parents: 3f0ead5
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Sun Jun 7 20:48:22 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Sun Jun 7 20:49:28 2015 +0200

----------------------------------------------------------------------
 src/rebar_core.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/fa6de2a1/src/rebar_core.erl
----------------------------------------------------------------------
diff --git a/src/rebar_core.erl b/src/rebar_core.erl
index 8d5d8a0..0650430 100644
--- a/src/rebar_core.erl
+++ b/src/rebar_core.erl
@@ -318,7 +318,7 @@ remember_cwd_predirs(Cwd, Predirs) ->
                         {ok, Existing} ->
                             ?ABORT("Internal consistency assertion failed.~n"
                                    "sub_dir ~s already associated with ~s.~n"
-                                   "Duplicate sub_dirs or deps entries?",
+                                   "Duplicate sub_dirs or deps entries?~n",
                                    [Dir, Existing])
                     end
             end,


[35/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #508 from tuncer/missing-newline

rebar_core: add missing newline in log msg

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/a3713879
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/a3713879
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/a3713879

Branch: refs/heads/import
Commit: a3713879b401a39b37505499e1a43ab164420354
Parents: 3f0ead5 fa6de2a
Author: Fred Hebert <mo...@ferd.ca>
Authored: Sun Jun 7 15:19:37 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Sun Jun 7 15:19:37 2015 -0400

----------------------------------------------------------------------
 src/rebar_core.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[43/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
rmemo: document rebar-specific modifications


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/8ec3a55b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/8ec3a55b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/8ec3a55b

Branch: refs/heads/import
Commit: 8ec3a55bd5240adef9ae0527509d6a77beb8a37e
Parents: 242b52b
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Thu Jun 11 22:05:33 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Fri Jun 12 12:52:24 2015 +0200

----------------------------------------------------------------------
 src/rmemo.erl | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/8ec3a55b/src/rmemo.erl
----------------------------------------------------------------------
diff --git a/src/rmemo.erl b/src/rmemo.erl
index 1d872fc..54a8626 100644
--- a/src/rmemo.erl
+++ b/src/rmemo.erl
@@ -25,6 +25,10 @@
 %%% NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 %%% CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
+%% rebar-specific modifications:
+%% 1. rename to rmemo.erl
+%% 2. add support for R13 (see ets_tab/0)
+
 -module(rmemo).
 
 -behaviour(gen_server).


[40/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Add memoization server

Copy memo.erl from https://github.com/tuncer/memo and rename to
rmemo.erl for use in rebar. We rename it to avoid collisions.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/02c43007
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/02c43007
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/02c43007

Branch: refs/heads/import
Commit: 02c43007b4500018b4bc028d4ddff6f11001b4a8
Parents: a3ab9cd
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Thu Jun 11 20:03:14 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Thu Jun 11 20:22:22 2015 +0200

----------------------------------------------------------------------
 ebin/rebar.app |   3 +-
 src/rmemo.erl  | 277 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 279 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/02c43007/ebin/rebar.app
----------------------------------------------------------------------
diff --git a/ebin/rebar.app b/ebin/rebar.app
index 9ebc83c..975fabc 100644
--- a/ebin/rebar.app
+++ b/ebin/rebar.app
@@ -45,7 +45,8 @@
               rebar_xref,
               rebar_metacmds,
               rebar_getopt,
-              rebar_mustache ]},
+              rebar_mustache,
+              rmemo ]},
   {registered, []},
   {applications,
    [

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/02c43007/src/rmemo.erl
----------------------------------------------------------------------
diff --git a/src/rmemo.erl b/src/rmemo.erl
new file mode 100644
index 0000000..752c811
--- /dev/null
+++ b/src/rmemo.erl
@@ -0,0 +1,277 @@
+%%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%%% ex: ft=erlang ts=4 sw=4 et
+%%%
+%%%-------------------------------------------------------------------
+%%% @author Tuncer Ayaz
+%%% @copyright 2015, Tuncer Ayaz
+%%% @doc
+%%% memoization server
+%%% @end
+%%%-------------------------------------------------------------------
+%%%
+%%% Copyright (c) 2015 Tuncer Ayaz
+%%%
+%%% Permission to use, copy, modify, and/or distribute this software
+%%% for any purpose with or without fee is hereby granted, provided
+%%% that the above copyright notice and this permission notice appear
+%%% in all copies.
+%%%
+%%% THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+%%% WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+%%% WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+%%% AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
+%%% CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+%%% LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+%%% NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+%%% CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+-module(rmemo).
+
+-behaviour(gen_server).
+
+%% API
+-export(
+   [
+    start/0,
+    start_link/0,
+    stop/0,
+    call/2,
+    call/3
+   ]).
+
+%% gen_server callbacks
+-export(
+   [
+    init/1,
+    handle_call/3,
+    handle_cast/2,
+    handle_info/2,
+    terminate/2,
+    code_change/3
+   ]).
+
+-define(SERVER, ?MODULE).
+-define(TABLE, ?MODULE).
+
+-record(state,
+        {
+          ets_tab :: ets:tab()
+        }).
+
+%%%===================================================================
+%%% API
+%%%===================================================================
+
+
+%%--------------------------------------------------------------------
+%% @doc
+%% Start the server
+%% @end
+%%--------------------------------------------------------------------
+-type reason() :: term().
+-type error() :: {error, reason()}.
+-type start_res() :: {ok, pid()} | 'ignore' | error().
+-spec start() -> start_res().
+start() ->
+    gen_server:start({local, ?SERVER}, ?MODULE, [], []).
+
+%%--------------------------------------------------------------------
+%% @doc
+%% Start the server
+%% @end
+%%--------------------------------------------------------------------
+-type start_link_res() :: start_res().
+-spec start_link() -> start_link_res().
+start_link() ->
+    gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
+
+%%--------------------------------------------------------------------
+%% @doc
+%% Stop the server
+%% @end
+%%--------------------------------------------------------------------
+stop() ->
+    gen_server:cast(?SERVER, stop).
+
+%%--------------------------------------------------------------------
+%% @doc
+%% Call function and memoize result
+%%
+%% Instead of
+%%
+%% <code>Res = Fun(A1, A2, [List1])</code>
+%%
+%% you call
+%%
+%% <code>Res = memo:call(Fun, [A1, A2, [List1]])</code>
+%%
+%% or instead of
+%%
+%% <code>
+%% Res = mod:expensive_function(A1, A2, [List1])
+%% </code>
+%%
+%% you call
+%%
+%% <code>
+%% Res = memo:call(fun mod:expensive_function/3, [A1, A2, [List1]])
+%% </code>
+%%
+%% and any subsequent call will fetch the cached result and avoid the
+%% computation.
+%%
+%% This is of course only useful for expensive computations that are
+%% known to produce the same result given same arguments. It's worth
+%% mentioning that your call should be side-effect free, as naturally
+%% those won't be replayed.
+%%
+%% @end
+%%--------------------------------------------------------------------
+-type fun_args() :: list().
+-spec call(fun(), fun_args()) -> term().
+call(F, A) ->
+    call_1({F, A}).
+
+%%--------------------------------------------------------------------
+%% @doc
+%% Call function and memoize result
+%%
+%% Instead of
+%%
+%% <code>Res = mod:expensive_function(A1, A2, [List1])</code>
+%%
+%% you call
+%%
+%% <code>Res = memo:call(mod, expensive_function, [A1, A2, [List1]])</code>
+%%
+%% and any subsequent call will fetch the cached result and avoid the
+%% computation.
+%%
+%% This is of course only useful for expensive computations that are
+%% known to produce the same result given same arguments. It's worth
+%% mentioning that your call should be side-effect free, as naturally
+%% those won't be replayed.%%
+%%
+%% @end
+%%--------------------------------------------------------------------
+%% fun() is not just the name of a fun, so we define an alias for
+%% atom() for call(M, F, A).
+-type fun_name() :: atom().
+-spec call(module(), fun_name(), fun_args()) -> term().
+call(M, F, A) when is_list(A) ->
+    call_1({M, F, A}).
+
+%%%===================================================================
+%%% gen_server callbacks
+%%%===================================================================
+
+%%--------------------------------------------------------------------
+%% @private
+%% @doc
+%% Initialize the server
+%% @end
+%%--------------------------------------------------------------------
+init(_) ->
+    {ok,
+     #state{
+        ets_tab = ets_tab()
+       }
+    }.
+
+-spec ets_tab() -> ets:tab().
+ets_tab() ->
+    ets:new(
+      ?TABLE,
+      [
+       named_table,
+       protected,
+       set,
+       {read_concurrency, true}
+      ]
+     ).
+
+%%--------------------------------------------------------------------
+%% @private
+%% @doc
+%% Handle call messages
+%% @end
+%%--------------------------------------------------------------------
+handle_call({save, Key, Res}, _From, State) ->
+    {reply, save(Key, Res), State};
+handle_call(_Request, _From, State) ->
+    {reply, {error, undefined_call}, State}.
+
+%%--------------------------------------------------------------------
+%% @private
+%% @doc
+%% Handle cast messages
+%% @end
+%%--------------------------------------------------------------------
+handle_cast(stop, State) ->
+    {stop, normal, State};
+handle_cast(_Msg, State) ->
+    {noreply, State}.
+
+%%--------------------------------------------------------------------
+%% @private
+%% @doc
+%% Handle all non call/cast messages
+%% @end
+%%--------------------------------------------------------------------
+handle_info(_Info, State) ->
+    {noreply, State}.
+
+%%--------------------------------------------------------------------
+%% @private
+%% @doc
+%% This function is called by a gen_server when it is about to
+%% terminate. It should be the opposite of Module:init/1 and do any
+%% necessary cleaning up. When it returns, the gen_server terminates
+%% with Reason. The return value is ignored.
+%% @end
+%%--------------------------------------------------------------------
+terminate(_Reason, _State) ->
+    ok.
+
+%%--------------------------------------------------------------------
+%% @private
+%% @doc
+%% Convert process state when code is changed
+%% @end
+%%--------------------------------------------------------------------
+code_change(_OldVsn, State, _Extra) ->
+    {ok, State}.
+
+%%%===================================================================
+%%% Internal functions
+%%%===================================================================
+
+-type call() :: {module(), fun_name(), fun_args()} | {fun(), fun_args()}.
+-spec call_1(call()) -> term().
+call_1(Call) ->
+    Key = key(Call),
+    case ets:lookup(?TABLE, Key) of
+        [] ->
+            Res = apply(Call),
+            true = gen_server:call(?SERVER, {save, Key, Res}, infinity),
+            Res;
+        [{Key, Mem}] ->
+            Mem
+    end.
+
+-type key_args() :: call().
+-type key() :: non_neg_integer().
+-spec key(key_args()) -> key().
+key(Call) ->
+    erlang:phash2(Call).
+
+-spec apply(call()) -> term().
+apply({F, A}) ->
+    erlang:apply(F, A);
+apply({M, F, A}) ->
+    erlang:apply(M, F, A).
+
+-type val() :: term().
+-spec save(key(), val()) -> true.
+save(K, V) ->
+    ets:insert(?TABLE, {K, V}).


[06/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Add details on Dialyzer with "make check"

If Dialyzer hasn't been used on an account before, there won't be a PLT
file and "make check" will fail. Added info on that fact.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/1420a856
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/1420a856
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/1420a856

Branch: refs/heads/import
Commit: 1420a85670d959c95ca51eb8ad8d90f9e2bc11b7
Parents: 9455bc5
Author: Derek Brown <de...@gmail.com>
Authored: Thu Aug 7 13:27:12 2014 -0400
Committer: Derek Brown <de...@gmail.com>
Committed: Mon May 11 16:50:28 2015 -0400

----------------------------------------------------------------------
 CONTRIBUTING.md | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/1420a856/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 78ebf09..9c88baf 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -76,6 +76,14 @@ To do that, run `make check`. If you didn't build via `make debug` at first, the
 and [Dialyzer](http://www.erlang.org/doc/man/dialyzer.html), causing a test 
 failure.  
 If that happens, running `make clean` before running `make check` could solve the problem.  
+
+Dialyzer requires a PLT (Persitent Lookup Table) to work with. By default, it will look for  
+`$HOME/.dialyzer.plt` (alternatively, the `DIALYZER_PLT` environment variable can be set  
+to point to a different location). If a PLT file cannot be found, Dialyzer (via `make check`) will  
+fail- the output will indicate `"Could not read PLT file"`, including the path it tried to use.  
+See the [Dialyzer man page](http://www.erlang.org/doc/man/dialyzer.html) or [this further explanation](http://www.erlang.org/doc/apps/dialyzer/dialyzer_chapter.html) for details on creating the initial  
+PLT file.
+
 If you change any of the files with known but safe to ignore Dialyzer warnings, you may  
 have to adapt the line number(s) in [dialyzer_reference](dialyzer_reference). If you do that, 
 do not remove the  


[39/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #510 from tuncer/fix-make-deps

Fix 'make deps'

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/a3ab9cd8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/a3ab9cd8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/a3ab9cd8

Branch: refs/heads/import
Commit: a3ab9cd83d6dd872c109d502a54f8d125b42d539
Parents: b2147de bcb6a4e
Author: Fred Hebert <mo...@ferd.ca>
Authored: Mon Jun 8 10:27:47 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Mon Jun 8 10:27:47 2015 -0400

----------------------------------------------------------------------
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[28/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Don't crash if missing OTP_VERSION file (fix #350)


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/7fa50061
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/7fa50061
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/7fa50061

Branch: refs/heads/import
Commit: 7fa50061aa26e3ad683dec0a2c2f329a99102708
Parents: 9ab9157
Author: Jesse Gumm <gu...@sigma-star.com>
Authored: Mon Jun 1 21:03:59 2015 -0500
Committer: Jesse Gumm <gu...@sigma-star.com>
Committed: Tue Jun 2 10:54:15 2015 -0500

----------------------------------------------------------------------
 src/rebar_utils.erl | 55 +++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 43 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/7fa50061/src/rebar_utils.erl
----------------------------------------------------------------------
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index f4e0830..c9f3f5d 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -403,7 +403,17 @@ patch_env(Config, [E | Rest]) ->
 %% ====================================================================
 
 otp_release() ->
-    otp_release1(erlang:system_info(otp_release)).
+    %% We cache the return of otp_release1, since otherwise, we're repeatedly
+    %% reading the same file off the hard drive and generating warnings if they
+    %% aren't there.
+    case erlang:get(otp_release_cache) of
+        undefined ->
+            Vsn = otp_release1(erlang:system_info(otp_release)),
+            erlang:put(otp_release_cache, Vsn),
+            Vsn;
+        Vsn ->
+            Vsn
+    end.
 
 %% If OTP <= R16, otp_release is already what we want.
 otp_release1([$R,N|_]=Rel) when is_integer(N) ->
@@ -411,18 +421,39 @@ otp_release1([$R,N|_]=Rel) when is_integer(N) ->
 %% If OTP >= 17.x, erlang:system_info(otp_release) returns just the
 %% major version number, we have to read the full version from
 %% a file. See http://www.erlang.org/doc/system_principles/versions.html
-%% Read vsn string from the 'OTP_VERSION' file and return as list without
-%% the "\n".
 otp_release1(Rel) ->
-    File = filename:join([code:root_dir(), "releases", Rel, "OTP_VERSION"]),
-    Vsn = case file:read_file(File) of
-              {ok, V} -> V;
-              {error, enoent} ->
-                  FileNotInstalled = filename:join([code:root_dir(),
-                                                    "OTP_VERSION"]),
-                  {ok, V} = file:read_file(FileNotInstalled),
-                  V
-          end,
+    Files = [
+             filename:join([code:root_dir(), "releases", Rel, "OTP_VERSION"]),
+             filename:join([code:root_dir(), "OTP_VERSION"])
+            ],
+
+    %% It's possible that none of the above files exist on the filesystem, in
+    %% which case, we're just going to rely on the provided "Rel" (which should
+    %% just be the value of `erlang:system_info(otp_release)`).
+    case read_otp_version_files(Files) of
+        undefined ->
+            warn_missing_otp_version_file(Rel),
+            Rel;
+        Vsn ->
+            Vsn
+    end.
+
+warn_missing_otp_version_file(Rel) ->
+    ?WARN("No OTP_VERSION file found. Using version string ~p.~n", [Rel]).
+
+%% Try to open each file path provided, and if any of them exist on the
+%% filesystem, read their contents and return the value of the first one found.
+read_otp_version_files([]) ->
+    undefined;
+read_otp_version_files([File | Rest]) ->
+    case file:read_file(File) of
+        {ok, Vsn} -> normalize_otp_version(Vsn);
+        {error, enoent} -> read_otp_version_files(Rest)
+    end.
+
+%% Takes the Version binary as read from the OTP_VERSION file and strips any
+%% trailing "**" and trailing "\n", returning the string as a list.
+normalize_otp_version(Vsn) ->
     %% It's fine to rely on the binary module here because we can
     %% be sure that it's available when the otp_release string does
     %% not begin with $R.


[26/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Makefile: clean only .rebar/erlcinfo

Do not delete PLT file in .rebar/.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/18f835e9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/18f835e9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/18f835e9

Branch: refs/heads/import
Commit: 18f835e9c4b68980020bf3ac16068ec5689fb43c
Parents: b0a8a11
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Sat May 30 22:23:04 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Sat May 30 22:24:11 2015 +0200

----------------------------------------------------------------------
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/18f835e9/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index 9f8ea7a..c0a2818 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ all:
 	./bootstrap
 
 clean:
-	@rm -rf rebar .rebar ebin/*.beam inttest/rt.work rt.work .eunit
+	@rm -rf rebar .rebar/erlcinfo ebin/*.beam inttest/rt.work rt.work .eunit
 
 distclean: clean
 	@rm -rf deps


[24/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #499 from aronisstav/otp_version_fix

Try one more location for the OTP_VERSION file

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/ccf9adcb
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/ccf9adcb
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/ccf9adcb

Branch: refs/heads/import
Commit: ccf9adcb2c8cc7a94ba0895c96b8a8fc29599772
Parents: cb004d2 161c317
Author: Fred Hebert <mo...@ferd.ca>
Authored: Fri May 29 07:20:23 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Fri May 29 07:20:23 2015 -0400

----------------------------------------------------------------------
 THANKS              |  1 +
 src/rebar_utils.erl | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[30/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
rebar_utils: explain pdict use


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/8559c5f1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/8559c5f1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/8559c5f1

Branch: refs/heads/import
Commit: 8559c5f1c5f2093bf8c36c0f32fb1f477c4e6905
Parents: 6e7ec60
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Wed Jun 3 19:58:32 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Wed Jun 3 20:04:30 2015 +0200

----------------------------------------------------------------------
 src/rebar_utils.erl | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/8559c5f1/src/rebar_utils.erl
----------------------------------------------------------------------
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index c9f3f5d..f1aeef0 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -403,9 +403,14 @@ patch_env(Config, [E | Rest]) ->
 %% ====================================================================
 
 otp_release() ->
-    %% We cache the return of otp_release1, since otherwise, we're repeatedly
-    %% reading the same file off the hard drive and generating warnings if they
-    %% aren't there.
+    %% NOTE: All and any pdict use has been erased from rebar a long
+    %% time ago in a big refactoring, and while extra processes (think
+    %% base_compiler) may have to re-cache the vsn string, this is
+    %% tolerable as an exception. After all, it's a write-once value.
+    %%
+    %% We cache the return of otp_release1, since otherwise, we're
+    %% repeatedly reading the same file off the hard drive and
+    %% generating warnings if they aren't there.
     case erlang:get(otp_release_cache) of
         undefined ->
             Vsn = otp_release1(erlang:system_info(otp_release)),


[29/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #502 from choptastic/fix_otp_version2

Don't crash if missing OTP_VERSION file (fix #350)

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/6e7ec606
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/6e7ec606
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/6e7ec606

Branch: refs/heads/import
Commit: 6e7ec606e222ed42f9f71669a54ee15ec588d0aa
Parents: 9ab9157 7fa5006
Author: Fred Hebert <mo...@ferd.ca>
Authored: Tue Jun 2 12:35:11 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Tue Jun 2 12:35:11 2015 -0400

----------------------------------------------------------------------
 src/rebar_utils.erl | 55 +++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 43 insertions(+), 12 deletions(-)
----------------------------------------------------------------------



[13/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
dialyzer: nest dialyzer options to match rebar3

{dialyzer,
 [
  %% Store PLT in ~/.rebar/plt (Default)
  {plt_location, shared},
  %% Store PLT locally inside the project in .rebar
  {plt_location, local},
  %% Store PLT in custom directory
  {plt_location, "custom_dir"},
  %% Extra apps to include in the PLT
  {plt_extra_apps, [app1, app2]},
  {warnings, [unmatched_returns, error_handling]}
 ]}.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/46869dab
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/46869dab
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/46869dab

Branch: refs/heads/import
Commit: 46869dabbe96481db5d8f17f449cbdc40b387409
Parents: 72d2bf5
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Fri May 15 11:56:31 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Fri May 22 09:53:09 2015 +0200

----------------------------------------------------------------------
 rebar.config           | 17 +++++------
 rebar.config.sample    | 25 ++++++++--------
 src/rebar_dialyzer.erl | 71 +++++++++++++++++++++++++--------------------
 3 files changed, 59 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/46869dab/rebar.config
----------------------------------------------------------------------
diff --git a/rebar.config b/rebar.config
index 370bc8f..a3849ec 100644
--- a/rebar.config
+++ b/rebar.config
@@ -32,14 +32,13 @@
       - (\"diameter_dict_util\":\"parse\"/\"2\"))",
          []}]}.
 
-{dialyzer_plt_extra_apps,
+{dialyzer,
  [
-  diameter
- ]}.
-
-{dialyzer_warnings,
- [
-  unmatched_returns,
-  error_handling,
-  race_conditions
+  {plt_extra_apps, [diameter]},
+  {warnings,
+   [
+    unmatched_returns,
+    error_handling,
+    race_conditions
+   ]}
  ]}.

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/46869dab/rebar.config.sample
----------------------------------------------------------------------
diff --git a/rebar.config.sample b/rebar.config.sample
index 41a96a4..da1e929 100644
--- a/rebar.config.sample
+++ b/rebar.config.sample
@@ -269,16 +269,15 @@
 
 %% == Dialyzer ==
 
-%% Store PLT in ~/.rebar/plt (Default)
-{dialyzer_plt_location, shared}.
-
-%% Store PLT locally inside the project in .rebar
-{dialyzer_plt_location, local}.
-
-%% Store PLT in custom directory
-{dialyzer_plt_location, "custom_path"}.
-
-%% Extra apps to include in the PLT
-{dialyzer_plt_extra_apps, [app1, app2]}.
-
-{dialyzer_warnings, [unmatched_returns, error_handling]}.
+{dialyzer,
+ [
+  %% Store PLT in ~/.rebar/plt (Default)
+  {plt_location, shared},
+  %% Store PLT locally inside the project in .rebar
+  {plt_location, local},
+  %% Store PLT in custom directory
+  {plt_location, "custom_dir"},
+  %% Extra apps to include in the PLT
+  {plt_extra_apps, [app1, app2]},
+  {warnings, [unmatched_returns, error_handling]}
+ ]}.

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/46869dab/src/rebar_dialyzer.erl
----------------------------------------------------------------------
diff --git a/src/rebar_dialyzer.erl b/src/rebar_dialyzer.erl
index 1685b99..982cc7e 100644
--- a/src/rebar_dialyzer.erl
+++ b/src/rebar_dialyzer.erl
@@ -43,10 +43,11 @@
 %% ===================================================================
 
 dialyze(Config, AppFile) ->
-    {NewConfig, Plt} = plt(Config, AppFile),
+    Opts = opts(Config),
+    {NewConfig, Plt} = plt(Config, AppFile, Opts),
     ok = check_plt_existence(Plt),
 
-    Opts = [
+    Args = [
             {analysis_type, succ_typings},
             %% http://erlang.org/pipermail/erlang-bugs/2015-February/004781.html
             %% TODO: remove once the minimum required Erlang/OTP release
@@ -56,10 +57,10 @@ dialyze(Config, AppFile) ->
             {check_plt, false},
             {init_plt, Plt},
             {files_rec, ["ebin"]},
-            {warnings, warnings(Config)}
+            {warnings, warnings(Opts)}
            ],
-    ?DEBUG("dialyze opts:~n~p~n", [Opts]),
-    case run(Opts) of
+    ?DEBUG("dialyze opts:~n~p~n", [Args]),
+    case run(Args) of
         [] ->
             {ok, NewConfig};
         Ws ->
@@ -68,15 +69,17 @@ dialyze(Config, AppFile) ->
     end.
 
 'build-plt'(Config, AppFile) ->
-    {Config1, AppDirs} = app_dirs(Config, AppFile),
-    {NewConfig, Plt} = plt(Config1, AppFile),
-    Opts = [
+    Opts = opts(Config),
+    {Config1, AppDirs} = app_dirs(Config, AppFile, Opts),
+    {NewConfig, Plt} = plt(Config1, AppFile, Opts),
+
+    Args = [
             {analysis_type, plt_build},
             {output_plt, Plt},
             {files_rec, AppDirs}
            ],
-    ?DEBUG("build-plt opts:~n~p~n", [Opts]),
-    case run(Opts) of
+    ?DEBUG("build-plt opts:~n~p~n", [Args]),
+    case run(Args) of
         [] ->
             {ok, NewConfig};
         Ws ->
@@ -87,10 +90,11 @@ dialyze(Config, AppFile) ->
     end.
 
 'check-plt'(Config, AppFile) ->
-    {NewConfig, Plt} = plt(Config, AppFile),
+    Opts = opts(Config),
+    {NewConfig, Plt} = plt(Config, AppFile, Opts),
     ok = check_plt_existence(Plt),
 
-    Opts = [
+    Args = [
             {analysis_type, plt_check},
             %% http://erlang.org/pipermail/erlang-bugs/2015-February/004781.html
             %% Without this, the PLT will be checked twice.
@@ -99,8 +103,8 @@ dialyze(Config, AppFile) ->
             {check_plt, false},
             {init_plt, Plt}
            ],
-    ?DEBUG("build-plt opts:~n~p~n", [Opts]),
-    case run(Opts) of
+    ?DEBUG("build-plt opts:~n~p~n", [Args]),
+    case run(Args) of
         [] ->
             {ok, NewConfig};
         Ws ->
@@ -109,7 +113,8 @@ dialyze(Config, AppFile) ->
     end.
 
 'delete-plt'(Config, AppFile) ->
-    {NewConfig, Plt} = plt(Config, AppFile),
+    Opts = opts(Config),
+    {NewConfig, Plt} = plt(Config, AppFile, Opts),
     ?DEBUG("Delete PLT '~s'~n", [Plt]),
     ok = rebar_file_utils:delete_each([Plt]),
     {ok, NewConfig}.
@@ -133,22 +138,24 @@ info_help(Description) ->
        "~s.~n"
        "~n"
        "Valid rebar.config options:~n"
-       "  ~p~n"
-       "  ~p~n"
-       "  ~p~n"
-       "  ~p~n"
        "  ~p~n",
        [
         Description,
-        {dialyzer_plt_location, shared},
-        {dialyzer_plt_location, local},
-        {dialyzer_plt_location, "custom_path"},
-        {dialyzer_plt_extra_apps, [app1, app2]},
-        {dialyzer_warnings, [unmatched_returns, error_handling]}
+        {dialyzer,
+         [
+          {plt_location, shared},
+          {plt_location, local},
+          {plt_location, "custom_dir"},
+          {plt_extra_apps, [app1, app2]},
+          {warnings, [unmatched_returns, error_handling]}
+         ]}
        ]).
 
-plt(Config, AppFile) ->
-    PltDir = plt_dir(Config),
+opts(Config) ->
+    rebar_config:get_local(Config, dialyzer, []).
+
+plt(Config, AppFile, Opts) ->
+    PltDir = plt_dir(Config, Opts),
     {NewConfig, RawAppName} = rebar_app_utils:app_name(Config, AppFile),
     AppName = atom_to_list(RawAppName),
     OtpRel = rebar_utils:otp_release(),
@@ -156,8 +163,8 @@ plt(Config, AppFile) ->
     ok = filelib:ensure_dir(Plt),
     {NewConfig, Plt}.
 
-plt_dir(Config) ->
-    Location = rebar_config:get_local(Config, dialyzer_plt_location, shared),
+plt_dir(Config, Opts) ->
+    Location = proplists:get_value(plt_location, Opts, shared),
     plt_dir1(Config, Location).
 
 plt_dir1(_Config, Location) when is_list(Location) ->
@@ -192,8 +199,8 @@ run(Opts) ->
             ?ABORT("Dialyzer error:~n~s~n", [Reason])
     end.
 
-warnings(Config) ->
-    rebar_config:get_local(Config, dialyzer_warnings, []).
+warnings(Opts) ->
+    proplists:get_value(warnings, Opts, []).
 
 print_warnings(Ws, Option) ->
     lists:foreach(
@@ -214,12 +221,12 @@ format_warning(W, Option) ->
 strip_newline(Warning) ->
     string:strip(Warning, right, $\n).
 
-app_dirs(Config, AppFile) ->
+app_dirs(Config, AppFile, Opts) ->
     {NewConfig, AppFileApps} = app_file_apps(Config, AppFile),
     ?DEBUG("app file apps:~n~p~n", [AppFileApps]),
     Deps = deps_apps(Config),
     ?DEBUG("deps apps:~n~p~n", [Deps]),
-    ExtraApps = rebar_config:get_local(Config, dialyzer_plt_extra_apps, []),
+    ExtraApps = proplists:get_value(plt_extra_apps, Opts, []),
     ?DEBUG("extra apps:~n~p~n", [ExtraApps]),
     %% erts is assumed, and has to be present unconditionally.
     Erts = [erts],


[22/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge branch 'RubberCthulhu-ct-groups-and-cases'


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/cb004d28
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/cb004d28
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/cb004d28

Branch: refs/heads/import
Commit: cb004d28a98641fa1025e4749f268bf9117aac7d
Parents: 881df99 388ed04
Author: Fred Hebert <mo...@ferd.ca>
Authored: Wed May 27 08:27:15 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Wed May 27 08:27:15 2015 -0400

----------------------------------------------------------------------
 THANKS           |  1 +
 src/rebar.erl    |  2 +-
 src/rebar_ct.erl | 72 +++++++++++++++++++++++++++++++++++++++++----------
 3 files changed, 61 insertions(+), 14 deletions(-)
----------------------------------------------------------------------



[16/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Add Dialyzer plugin

Build project-specific PLT
$ rebar build-plt

Check the PLT for consistency and rebuild it if it is not up-to-date
$ rebar check-plt

Analyze the code for discrepancies
$ rebar dialyze

Delete project-specific PLT
$ rebar delete-plt

Valid rebar.config options:
  %% Store PLT in ~/.rebar/plt (Default)
  {dialyzer_plt_location,shared}
  %% Store PLT locally inside the project in .rebar
  {dialyzer_plt_location,local}
  %% Store PLT in custom directory
  {dialyzer_plt_location,"custom_path"}
  {dialyzer_plt_extra_apps,[app1,app2]}
  {dialyzer_warnings,[unmatched_returns,error_handling]}


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/850a8a3d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/850a8a3d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/850a8a3d

Branch: refs/heads/import
Commit: 850a8a3dcedaf400a2e9d1afa67c80ebfd370a60
Parents: 094b74e
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Fri Feb 27 23:17:24 2015 +0100
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Fri May 22 09:53:09 2015 +0200

----------------------------------------------------------------------
 .gitignore                       |   1 -
 Makefile                         |  41 +-----
 dialyzer_reference               |   3 -
 ebin/rebar.app                   |  25 +++-
 priv/shell-completion/bash/rebar |   6 +-
 priv/shell-completion/zsh/_rebar |   5 +-
 rebar.config                     |  12 ++
 rebar.config.sample              |  16 +++
 src/rebar.erl                    |  10 ++
 src/rebar_dialyzer.erl           | 234 ++++++++++++++++++++++++++++++++++
 10 files changed, 304 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/850a8a3d/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 15668a7..671ac10 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,7 +4,6 @@
 *.orig
 .*.swp
 /rt.work
-/dialyzer_warnings
 /rebar.cmd
 /.eunit
 /deps

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/850a8a3d/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index ed8dd48..9f8ea7a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,7 @@
-.PHONY: clean dialyzer_warnings xref_warnings deps test test_eunit test_inttest
+.PHONY: clean xref_warnings deps test test_eunit test_inttest
 
 REBAR=$(PWD)/rebar
 RETEST=$(PWD)/deps/retest/retest
-OTPVSNCMD='io:fwrite("~s",[rebar_utils:otp_release()]), halt().'
-OTPVSN=$(shell erl -pa ebin/ -noshell -eval $(OTPVSNCMD))
-PLT_FILENAME=~/.dialyzer_rebar_$(OTPVSN)_plt
 LOG_LEVEL?=debug
 RT_TARGETS?=inttest
 
@@ -12,11 +9,9 @@ all:
 	./bootstrap
 
 clean:
-	@rm -rf rebar ebin/*.beam inttest/rt.work rt.work .eunit
-	@rm -f .rebarinfo
+	@rm -rf rebar .rebar ebin/*.beam inttest/rt.work rt.work .eunit
 
 distclean: clean
-	@rm -f dialyzer_warnings
 	@rm -rf deps
 
 debug:
@@ -28,36 +23,10 @@ xref:
 	@./rebar xref
 
 build_plt:
-	-dialyzer --build_plt --output_plt $(PLT_FILENAME) --apps \
-		erts \
-		kernel \
-		stdlib \
-		crypto \
-		compiler \
-		asn1 \
-		eunit \
-		tools \
-		ssl \
-		edoc \
-		reltool \
-		snmp \
-		sasl
-	-dialyzer --add_to_plt --plt $(PLT_FILENAME) \
-		--output_plt $(PLT_FILENAME) \
-		--apps diameter
+	@./rebar build-plt
 
-dialyzer: dialyzer_warnings
-	@diff -U0 dialyzer_reference dialyzer_warnings
-
-dialyzer_warnings:
-	-@dialyzer --plt $(PLT_FILENAME) -q -nn -n ebin \
-		-Wunmatched_returns \
-		-Werror_handling \
-		-Wrace_conditions \
-		> dialyzer_warnings
-
-typer:
-	typer -r --plt $(PLT_FILENAME) ./src -I ./include
+dialyzer:
+	@./rebar dialyze
 
 binary: VSN = $(shell ./rebar -V)
 binary: clean all

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/850a8a3d/dialyzer_reference
----------------------------------------------------------------------
diff --git a/dialyzer_reference b/dialyzer_reference
deleted file mode 100644
index 41b1cff..0000000
--- a/dialyzer_reference
+++ /dev/null
@@ -1,3 +0,0 @@
-
-rebar_eunit.erl:471: Call to missing or unexported function eunit_test:function_wrapper/2
-rebar_utils.erl:222: Call to missing or unexported function escript:foldl/3

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/850a8a3d/ebin/rebar.app
----------------------------------------------------------------------
diff --git a/ebin/rebar.app b/ebin/rebar.app
index 1f3a895..9ebc83c 100644
--- a/ebin/rebar.app
+++ b/ebin/rebar.app
@@ -17,6 +17,7 @@
               rebar_cover_utils,
               rebar_ct,
               rebar_deps,
+              rebar_dialyzer,
               rebar_edoc,
               rebar_erlc_compiler,
               rebar_erlydtl_compiler,
@@ -46,13 +47,22 @@
               rebar_getopt,
               rebar_mustache ]},
   {registered, []},
-  {applications, [kernel,
-                  stdlib,
-                  sasl,
-                  compiler,
-                  crypto,
-                  syntax_tools,
-                  tools]},
+  {applications,
+   [
+    kernel,
+    stdlib,
+    sasl,
+    compiler,
+    crypto,
+    syntax_tools,
+    tools,
+    eunit,
+    reltool,
+    dialyzer,
+    asn1,
+    snmp,
+    edoc
+   ]},
   {env, [
          %% Default log level
          {log_level, warn},
@@ -76,6 +86,7 @@
                                rebar_neotoma_compiler,
                                rebar_asn1_compiler,
                                rebar_dia_compiler,
+                               rebar_dialyzer,
                                rebar_erlc_compiler,
                                rebar_lfe_compiler,
                                rebar_erlydtl_compiler,

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/850a8a3d/priv/shell-completion/bash/rebar
----------------------------------------------------------------------
diff --git a/priv/shell-completion/bash/rebar b/priv/shell-completion/bash/rebar
index 0baf389..c017d20 100644
--- a/priv/shell-completion/bash/rebar
+++ b/priv/shell-completion/bash/rebar
@@ -17,14 +17,18 @@ _rebar()
         --keep-going \
         --recursive \
         --version"
-    cmdsnvars="check-deps \
+    cmdsnvars=" \
+        build-plt \
+        check-deps \
         clean \
         compile \
+        check-plt \
         create \
         create-app \
         create-lib \
         create-node \
         ct \
+        dialyze \
         doc \
         delete-deps \
         escriptize \

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/850a8a3d/priv/shell-completion/zsh/_rebar
----------------------------------------------------------------------
diff --git a/priv/shell-completion/zsh/_rebar b/priv/shell-completion/zsh/_rebar
index 0390881..2ba7cdc 100644
--- a/priv/shell-completion/zsh/_rebar
+++ b/priv/shell-completion/zsh/_rebar
@@ -28,13 +28,16 @@ _rebar () {
   case $state in
     cmd_and_var)
       _values -S = 'variables' \
+        'dialyze[Analyze the code for discrepancies]' \
+        'build-plt[Build project-specific PLT]' \
+        'check-plt[Check the plt for consistency and rebuild it if it is not up-to-date]' \
         'clean[Clean]' \
         'compile[Compile sources]' \
         'create[Create skel based on template and vars]' \
         'create-app[Create simple app skel]' \
         'create-lib[Create simple lib skel]' \
         'create-node[Create simple node skel]' \
-        'list-template[List avaiavle templates]' \
+        'list-template[List available templates]' \
         'doc[Generate Erlang program documentation]' \
         'check-deps[Display to be fetched dependencies]' \
         'prepare-deps[Fetch and build dependencies]' \

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/850a8a3d/rebar.config
----------------------------------------------------------------------
diff --git a/rebar.config b/rebar.config
index 33d2aea..370bc8f 100644
--- a/rebar.config
+++ b/rebar.config
@@ -31,3 +31,15 @@
       - (\"diameter_dict_util\":\"format_error\"/\"1\")
       - (\"diameter_dict_util\":\"parse\"/\"2\"))",
          []}]}.
+
+{dialyzer_plt_extra_apps,
+ [
+  diameter
+ ]}.
+
+{dialyzer_warnings,
+ [
+  unmatched_returns,
+  error_handling,
+  race_conditions
+ ]}.

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/850a8a3d/rebar.config.sample
----------------------------------------------------------------------
diff --git a/rebar.config.sample b/rebar.config.sample
index b650bc9..41a96a4 100644
--- a/rebar.config.sample
+++ b/rebar.config.sample
@@ -266,3 +266,19 @@
 {xref_queries,
  [{"(XC - UC) || (XU - X - B"
    " - (\"mod\":\".*foo\"/\"4\"))",[]}]}.
+
+%% == Dialyzer ==
+
+%% Store PLT in ~/.rebar/plt (Default)
+{dialyzer_plt_location, shared}.
+
+%% Store PLT locally inside the project in .rebar
+{dialyzer_plt_location, local}.
+
+%% Store PLT in custom directory
+{dialyzer_plt_location, "custom_path"}.
+
+%% Extra apps to include in the PLT
+{dialyzer_plt_extra_apps, [app1, app2]}.
+
+{dialyzer_warnings, [unmatched_returns, error_handling]}.

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/850a8a3d/src/rebar.erl
----------------------------------------------------------------------
diff --git a/src/rebar.erl b/src/rebar.erl
index 2d356dd..9a5fc28 100644
--- a/src/rebar.erl
+++ b/src/rebar.erl
@@ -456,6 +456,12 @@ qc                                       Test QuickCheck properties
 
 xref                                     Run cross reference analysis
 
+dialyze                                  Analyze the code for discrepancies
+build-plt                                Build project-specific PLT
+check-plt                                Check the PLT for consistency and
+                                         rebuild it if it is not up-to-date
+delete-plt                               Delete project-specific PLT
+
 shell                                    Start a shell similar to
                                          'erl -pa ebin -pa deps/*/ebin'
 
@@ -527,7 +533,9 @@ filter_flags(Config, [Item | Rest], Commands) ->
 
 command_names() ->
     [
+     "build-plt",
      "check-deps",
+     "check-plt",
      "clean",
      "compile",
      "create",
@@ -535,7 +543,9 @@ command_names() ->
      "create-lib",
      "create-node",
      "ct",
+     "delete-plt",
      "delete-deps",
+     "dialyze",
      "doc",
      "eunit",
      "escriptize",

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/850a8a3d/src/rebar_dialyzer.erl
----------------------------------------------------------------------
diff --git a/src/rebar_dialyzer.erl b/src/rebar_dialyzer.erl
new file mode 100644
index 0000000..5f0cb1e
--- /dev/null
+++ b/src/rebar_dialyzer.erl
@@ -0,0 +1,234 @@
+%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ts=4 sw=4 et
+%% -------------------------------------------------------------------
+%%
+%% rebar: Erlang Build Tools
+%%
+%% Copyright (c) 2014-2015 Tuncer Ayaz
+%%
+%% Permission is hereby granted, free of charge, to any person obtaining a copy
+%% of this software and associated documentation files (the "Software"), to deal
+%% in the Software without restriction, including without limitation the rights
+%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+%% copies of the Software, and to permit persons to whom the Software is
+%% furnished to do so, subject to the following conditions:
+%%
+%% The above copyright notice and this permission notice shall be included in
+%% all copies or substantial portions of the Software.
+%%
+%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+%% THE SOFTWARE.
+%% -------------------------------------------------------------------
+-module(rebar_dialyzer).
+
+-export([
+         dialyze/2,
+         'build-plt'/2,
+         'check-plt'/2,
+         'delete-plt'/2
+        ]).
+
+%% for internal use only
+-export([info/2]).
+
+-include("rebar.hrl").
+
+%% ===================================================================
+%% Public API
+%% ===================================================================
+
+dialyze(Config, AppFile) ->
+    {NewConfig, Plt} = plt(Config, AppFile),
+    ok = check_plt_existence(Plt),
+
+    Opts = [
+            {analysis_type, succ_typings},
+            %% http://erlang.org/pipermail/erlang-bugs/2015-February/004781.html
+            %% TODO: remove once the minimum required Erlang/OTP release
+            %% includes a Dialyzer version without the bug, or alternatively
+            %% add a config option to always check the PLT, as this may be
+            %% needed by some users.
+            {check_plt, false},
+            {init_plt, Plt},
+            {files_rec, ["ebin"]},
+            {warnings, warnings(Config)}
+           ],
+    ?DEBUG("dialyze opts:~n~p~n", [Opts]),
+    case run(Opts) of
+        [] ->
+            {ok, NewConfig};
+        Ws ->
+            print_warnings(Ws),
+            ?FAIL
+    end.
+
+'build-plt'(Config, AppFile) ->
+    {Config1, AppDirs} = app_dirs(Config, AppFile),
+    {NewConfig, Plt} = plt(Config1, AppFile),
+    Opts = [
+            {analysis_type, plt_build},
+            {output_plt, Plt},
+            {files_rec, AppDirs}
+           ],
+    ?DEBUG("build-plt opts:~n~p~n", [Opts]),
+    case run(Opts) of
+        [] ->
+            {ok, NewConfig};
+        Ws ->
+            %% As plt_build may raise warnings but still successfully
+            %% create the PLT, we cannot interpret this as failure,
+            %% and therefore all we can do is report warnings.
+            print_warnings(Ws)
+    end.
+
+'check-plt'(Config, AppFile) ->
+    {NewConfig, Plt} = plt(Config, AppFile),
+    ok = check_plt_existence(Plt),
+
+    Opts = [
+            {analysis_type, plt_check},
+            %% http://erlang.org/pipermail/erlang-bugs/2015-February/004781.html
+            %% Without this, the PLT will be checked twice.
+            %% TODO: remove once the minimum required Erlang/OTP release
+            %% includes a Dialyzer version without the bug.
+            {check_plt, false},
+            {init_plt, Plt}
+           ],
+    ?DEBUG("build-plt opts:~n~p~n", [Opts]),
+    case run(Opts) of
+        [] ->
+            {ok, NewConfig};
+        Ws ->
+            print_warnings(Ws),
+            ?FAIL
+    end.
+
+'delete-plt'(Config, AppFile) ->
+    {NewConfig, Plt} = plt(Config, AppFile),
+    ?DEBUG("Delete PLT '~s'~n", [Plt]),
+    ok = rebar_file_utils:delete_each([Plt]),
+    {ok, NewConfig}.
+
+%% ===================================================================
+%% Internal functions
+%% ===================================================================
+
+info(help, dialyze) ->
+    info_help("Analyze the code for discrepancies");
+info(help, 'build-plt') ->
+    info_help("Build project-specific PLT");
+info(help, 'check-plt') ->
+    info_help("Check the PLT for consistency and rebuild it if it"
+              " is not up-to-date");
+info(help, 'delete-plt') ->
+    info_help("Delete project-specific PLT").
+
+info_help(Description) ->
+    ?CONSOLE(
+       "~s.~n"
+       "~n"
+       "Valid rebar.config options:~n"
+       "  ~p~n"
+       "  ~p~n"
+       "  ~p~n"
+       "  ~p~n"
+       "  ~p~n",
+       [
+        Description,
+        {dialyzer_plt_location, shared},
+        {dialyzer_plt_location, local},
+        {dialyzer_plt_location, "custom_path"},
+        {dialyzer_plt_extra_apps, [app1, app2]},
+        {dialyzer_warnings, [unmatched_returns, error_handling]}
+       ]).
+
+plt(Config, AppFile) ->
+    PltDir = plt_dir(Config),
+    {NewConfig, RawAppName} = rebar_app_utils:app_name(Config, AppFile),
+    AppName = atom_to_list(RawAppName),
+    OtpRel = rebar_utils:otp_release(),
+    Plt = filename:join([PltDir, AppName ++ "_" ++ OtpRel ++ "_plt"]),
+    ok = filelib:ensure_dir(Plt),
+    {NewConfig, Plt}.
+
+plt_dir(Config) ->
+    Location = rebar_config:get_local(Config, dialyzer_plt_location, shared),
+    plt_dir1(Config, Location).
+
+plt_dir1(_Config, Location) when is_list(Location) ->
+    case filelib:is_dir(Location) of
+        false ->
+            ?ABORT("PLT directory does not exist: ~s~n", [Location]);
+        true ->
+            Location
+    end;
+plt_dir1(_Config, shared) ->
+    {ok, Home} = init:get_argument(home),
+    filename:join([Home, ".rebar", "plt"]);
+plt_dir1(Config, local) ->
+    BaseDir = rebar_utils:base_dir(Config),
+    filename:join([BaseDir, ".rebar"]).
+
+check_plt_existence(Plt) ->
+    case filelib:is_regular(Plt) of
+        true ->
+            ok;
+        false ->
+            ?ABORT("PLT '~s' does not exist.~n"
+                   "Please run 'rebar build-plt' first.~n", [Plt])
+    end.
+
+%% dialyzer:run/1 wrapper to gracefully fail in case of Dialyzer errors
+run(Opts) ->
+    try dialyzer:run(Opts) of
+        Ws -> Ws
+    catch
+        throw:{dialyzer_error, Reason} ->
+            ?ABORT("Dialyzer error:~n~s~n", [Reason])
+    end.
+
+warnings(Config) ->
+    rebar_config:get_local(Config, dialyzer_warnings, []).
+
+print_warnings(Ws) ->
+    lists:foreach(
+      fun(W) ->
+              ?CONSOLE("~s~n", [format_warning(W)])
+      end,
+      Ws).
+
+format_warning(W) ->
+    dialyzer:format_warning(W, fullpath).
+
+app_dirs(Config, AppFile) ->
+    {NewConfig, AppFileApps} = app_file_apps(Config, AppFile),
+    ?DEBUG("app file apps:~n~p~n", [AppFileApps]),
+    Deps = deps_apps(Config),
+    ?DEBUG("deps apps:~n~p~n", [Deps]),
+    ExtraApps = rebar_config:get_local(Config, dialyzer_plt_extra_apps, []),
+    ?DEBUG("extra apps:~n~p~n", [ExtraApps]),
+    %% erts is assumed, and has to be present unconditionally.
+    Erts = [erts],
+    Apps = ordsets:from_list(Erts ++ AppFileApps ++ Deps ++ ExtraApps),
+    AppDirs = [app_lib_dir(App) || App <- ordsets:to_list(Apps)],
+    ?DEBUG("app dirs:~n~p~n", [AppDirs]),
+    {NewConfig, AppDirs}.
+
+app_file_apps(Config, AppFile) ->
+    rebar_app_utils:app_applications(Config, AppFile).
+
+deps_apps(Config) ->
+    [element(1, Dep) || Dep <- rebar_config:get_local(Config, deps, [])].
+
+app_lib_dir(App) ->
+    case code:lib_dir(App, ebin) of
+        {error, _}=Err ->
+            ?ABORT("Failed to get ebin dir for app: ~p~n~p~n", [App, Err]);
+        Dir ->
+            Dir
+    end.


[37/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #509 from tuncer/dep-open-crash

erlc: do not crash if dep file cannot be found

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/b2147de6
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/b2147de6
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/b2147de6

Branch: refs/heads/import
Commit: b2147de614732c3da33e0fc4c4ad0a28394f43d7
Parents: a371387 ded3be6
Author: Fred Hebert <mo...@ferd.ca>
Authored: Mon Jun 8 09:54:04 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Mon Jun 8 09:54:04 2015 -0400

----------------------------------------------------------------------
 src/rebar_erlc_compiler.erl | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------



[12/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #496 from derek121/contributing-dialyzer-2

Update PLT detail for make build_plt

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/881df99b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/881df99b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/881df99b

Branch: refs/heads/import
Commit: 881df99b436cee78865db2c0115928c1105359b0
Parents: 791db71 65ac13b
Author: Fred Hebert <mo...@ferd.ca>
Authored: Tue May 19 08:52:53 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Tue May 19 08:52:53 2015 -0400

----------------------------------------------------------------------
 CONTRIBUTING.md | 7 +------
 THANKS          | 1 +
 2 files changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------



[46/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
rmemo: properly handle unsupported call


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/e3a2917a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/e3a2917a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/e3a2917a

Branch: refs/heads/import
Commit: e3a2917afc13d220a0d0a3daca40f0693c6cc94d
Parents: 0262332
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Fri Jun 19 16:38:36 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Fri Jun 19 16:38:36 2015 +0200

----------------------------------------------------------------------
 src/rmemo.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/e3a2917a/src/rmemo.erl
----------------------------------------------------------------------
diff --git a/src/rmemo.erl b/src/rmemo.erl
index 54a8626..dd3642f 100644
--- a/src/rmemo.erl
+++ b/src/rmemo.erl
@@ -216,7 +216,7 @@ ets_tab() ->
 handle_call({save, Key, Res}, _From, State) ->
     {reply, save(Key, Res), State};
 handle_call(_Request, _From, State) ->
-    {reply, {error, undefined_call}, State}.
+    {noreply, State}.
 
 %%--------------------------------------------------------------------
 %% @private


[23/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Try one more location for the OTP_VERSION file

If one is building Erlang from sources without making a proper release,
there may be an OTP_VERSION file in the root directory.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/161c3173
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/161c3173
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/161c3173

Branch: refs/heads/import
Commit: 161c3173266a2d3b588cb688a2e231ce523c20d2
Parents: cb004d2
Author: Stavros Aronis <ar...@gmail.com>
Authored: Fri May 29 10:57:27 2015 +0200
Committer: Stavros Aronis <ar...@gmail.com>
Committed: Fri May 29 11:59:33 2015 +0200

----------------------------------------------------------------------
 THANKS              |  1 +
 src/rebar_utils.erl | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/161c3173/THANKS
----------------------------------------------------------------------
diff --git a/THANKS b/THANKS
index a205df7..2422310 100644
--- a/THANKS
+++ b/THANKS
@@ -140,3 +140,4 @@ Carlos Eduardo de Paula
 Paulo F. Oliveira
 Derek Brown
 Danil Onishchenko
+Stavros Aronis

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/161c3173/src/rebar_utils.erl
----------------------------------------------------------------------
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index 62446e3..dd5650e 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -413,8 +413,14 @@ otp_release1([$R,N|_]=Rel) when is_integer(N) ->
 %% the "\n".
 otp_release1(Rel) ->
     File = filename:join([code:root_dir(), "releases", Rel, "OTP_VERSION"]),
-    {ok, Vsn} = file:read_file(File),
-
+    Vsn = case file:read_file(File) of
+              {ok, V} -> V;
+              {error, enoent} ->
+                  FileNotInstalled = filename:join([code:root_dir(),
+                                                    "OTP_VERSION"]),
+                  {ok, V} = file:read_file(FileNotInstalled),
+                  V
+          end,
     %% It's fine to rely on the binary module here because we can
     %% be sure that it's available when the otp_release string does
     %% not begin with $R.


[27/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #500 from tuncer/fix-makefile

Makefile: clean only .rebar/erlcinfo

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/9ab9157c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/9ab9157c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/9ab9157c

Branch: refs/heads/import
Commit: 9ab9157c9e50cdc894966678311e46602275f3de
Parents: b0a8a11 18f835e
Author: Tristan Sloughter <tr...@gmail.com>
Authored: Sat May 30 15:30:02 2015 -0500
Committer: Tristan Sloughter <tr...@gmail.com>
Committed: Sat May 30 15:30:02 2015 -0500

----------------------------------------------------------------------
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[10/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #273 from cybergrind/appups_fix

Use target_dir as source of new version in generate-appups

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/791db716
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/791db716
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/791db716

Branch: refs/heads/import
Commit: 791db716b5a3a7671e0b351f95ddf24b848ee173
Parents: d054ad6 edfe818
Author: Fred Hebert <mo...@ferd.ca>
Authored: Tue May 12 10:00:59 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Tue May 12 10:00:59 2015 -0400

----------------------------------------------------------------------
 src/rebar_appups.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/791db716/src/rebar_appups.erl
----------------------------------------------------------------------


[03/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge branch 'paulo-ferraz-oliveira-fix/xref_behavior'


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/bb92ba93
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/bb92ba93
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/bb92ba93

Branch: refs/heads/import
Commit: bb92ba9352a21054090ff79f5f6ddd516e76b994
Parents: ecf4655 1e25a3b
Author: Fred Hebert <mo...@ferd.ca>
Authored: Sat May 9 14:01:36 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Sat May 9 14:01:36 2015 -0400

----------------------------------------------------------------------
 THANKS             | 1 +
 src/rebar_xref.erl | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[08/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Merge pull request #336 from derek121/contributing-dialyzer

Add details on Dialyzer with "make check"

Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/de94c20f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/de94c20f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/de94c20f

Branch: refs/heads/import
Commit: de94c20faeaa211ef41cdf0ac0ac8170c4f2b24a
Parents: 9455bc5 1420a85
Author: Fred Hebert <mo...@ferd.ca>
Authored: Tue May 12 08:36:18 2015 -0400
Committer: Fred Hebert <mo...@ferd.ca>
Committed: Tue May 12 08:36:18 2015 -0400

----------------------------------------------------------------------
 CONTRIBUTING.md | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------



[42/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
rmemo: support R13 for rebar only

ets read_concurrency has been available since R14, but rebar supports
R13B03 (and newer). As a workaround we check that erts/ebin/erts.app
exists as another pre-R14 characteristic to determine whether we can
assume read_concurrency is supported.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/242b52b8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/242b52b8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/242b52b8

Branch: refs/heads/import
Commit: 242b52b8d2d1b343a25cfbf1ff56aa9c7e32a56f
Parents: ec018cf
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Thu Jun 11 20:38:43 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Fri Jun 12 12:52:24 2015 +0200

----------------------------------------------------------------------
 src/rmemo.erl | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/242b52b8/src/rmemo.erl
----------------------------------------------------------------------
diff --git a/src/rmemo.erl b/src/rmemo.erl
index 752c811..1d872fc 100644
--- a/src/rmemo.erl
+++ b/src/rmemo.erl
@@ -180,14 +180,27 @@ init(_) ->
 
 -spec ets_tab() -> ets:tab().
 ets_tab() ->
+    ErtsApp = filename:join(code:lib_dir(erts, ebin), "erts.app"),
+    Concurrency =
+        %% If erts.app exists, we run on at least R14. That means we
+        %% can use ets read_concurrency.
+        %% TODO: Remove and revert to vanilla memo.erl from
+        %% https://github.com/tuncer/memo once we require at least
+        %% R14B and drop support for R13.
+        case filelib:is_regular(ErtsApp) of
+            true ->
+                [{read_concurrency, true}];
+            false ->
+                []
+        end,
     ets:new(
       ?TABLE,
       [
        named_table,
        protected,
-       set,
-       {read_concurrency, true}
+       set
       ]
+      ++ Concurrency
      ).
 
 %%--------------------------------------------------------------------


[07/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Update line number of allowed dialyzer error

Running make check after make debug gives an error due to the
following:

make: [dialyzer_warnings] Error 2 (ignored)
--- dialyzer_reference  2015-05-11 17:21:38.000000000 -0400
+++ dialyzer_warnings   2015-05-11 17:31:42.000000000 -0400
@@ -3 +3 @@
-rebar_utils.erl:198: Call to missing or unexported function
escript:foldl/3
+rebar_utils.erl:222: Call to missing or unexported function
escript:foldl/3

Indeed that call to escript:foldl/3 changed from line 198 to 222 via
https://github.com/rebar/rebar/commit/a04530124ffa16c50205695d35f9274107e2fa42

This update makes the corresponding change to the line number in
dialyzer_reference.

This was noticed while working on
https://github.com/rebar/rebar/pull/336


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/2055a532
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/2055a532
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/2055a532

Branch: refs/heads/import
Commit: 2055a532114e64395c2d323ec2d1fdc8bae974c9
Parents: 9455bc5
Author: Derek Brown <de...@gmail.com>
Authored: Mon May 11 17:38:34 2015 -0400
Committer: Derek Brown <de...@gmail.com>
Committed: Mon May 11 17:38:34 2015 -0400

----------------------------------------------------------------------
 dialyzer_reference | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/2055a532/dialyzer_reference
----------------------------------------------------------------------
diff --git a/dialyzer_reference b/dialyzer_reference
index 9b7f093..41b1cff 100644
--- a/dialyzer_reference
+++ b/dialyzer_reference
@@ -1,3 +1,3 @@
 
 rebar_eunit.erl:471: Call to missing or unexported function eunit_test:function_wrapper/2
-rebar_utils.erl:198: Call to missing or unexported function escript:foldl/3
+rebar_utils.erl:222: Call to missing or unexported function escript:foldl/3


[41/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Start using memoization server

1. memoize otp release vsn string function call

2. memoize expensive filename:absname/1 call which happens
   to be called quite frequently


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/ec018cf5
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/ec018cf5
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/ec018cf5

Branch: refs/heads/import
Commit: ec018cf5a5f102eb96c0972a0175f74f2016f77c
Parents: 02c4300
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Thu Jun 11 20:10:27 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Fri Jun 12 12:52:24 2015 +0200

----------------------------------------------------------------------
 src/rebar.erl       |  6 ++++++
 src/rebar_utils.erl | 25 ++++++-------------------
 2 files changed, 12 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/ec018cf5/src/rebar.erl
----------------------------------------------------------------------
diff --git a/src/rebar.erl b/src/rebar.erl
index b2358c7..dcfb353 100644
--- a/src/rebar.erl
+++ b/src/rebar.erl
@@ -214,6 +214,12 @@ run_aux(BaseConfig, Commands) ->
         {error,{already_started,crypto}} -> ok
     end,
 
+    %% Make sure memoization server is running
+    case rmemo:start() of
+        {ok, _} -> ok;
+        {error, {already_started, _}} -> ok
+    end,
+
     %% Convert command strings to atoms
     CommandAtoms = [list_to_atom(C) || C <- Commands],
 

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/ec018cf5/src/rebar_utils.erl
----------------------------------------------------------------------
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index f1aeef0..b250671 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -237,9 +237,11 @@ prop_check(false, Msg, Args) -> ?ABORT(Msg, Args).
 
 %% Convert all the entries in the code path to absolute paths.
 expand_code_path() ->
-    CodePath = lists:foldl(fun(Path, Acc) ->
-                                   [filename:absname(Path) | Acc]
-                           end, [], code:get_path()),
+    CodePath = lists:foldl(
+                 fun(Path, Acc) ->
+                         Path1 = rmemo:call(filename, absname, [Path]),
+                         [Path1 | Acc]
+                 end, [], code:get_path()),
     code:set_path(lists:reverse(CodePath)).
 
 %%
@@ -403,22 +405,7 @@ patch_env(Config, [E | Rest]) ->
 %% ====================================================================
 
 otp_release() ->
-    %% NOTE: All and any pdict use has been erased from rebar a long
-    %% time ago in a big refactoring, and while extra processes (think
-    %% base_compiler) may have to re-cache the vsn string, this is
-    %% tolerable as an exception. After all, it's a write-once value.
-    %%
-    %% We cache the return of otp_release1, since otherwise, we're
-    %% repeatedly reading the same file off the hard drive and
-    %% generating warnings if they aren't there.
-    case erlang:get(otp_release_cache) of
-        undefined ->
-            Vsn = otp_release1(erlang:system_info(otp_release)),
-            erlang:put(otp_release_cache, Vsn),
-            Vsn;
-        Vsn ->
-            Vsn
-    end.
+    rmemo:call(fun otp_release1/1, [(erlang:system_info(otp_release))]).
 
 %% If OTP <= R16, otp_release is already what we want.
 otp_release1([$R,N|_]=Rel) when is_integer(N) ->


[18/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
dialyzer: change plt_location to rebar3 default

To match rebar3, change plt_location's default to 'local'.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/17477b54
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/17477b54
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/17477b54

Branch: refs/heads/import
Commit: 17477b54f83b4fbf22aad1435182d05d35c11991
Parents: 5dfdd90
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Fri May 22 09:46:56 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Fri May 22 09:53:38 2015 +0200

----------------------------------------------------------------------
 src/rebar_dialyzer.erl | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/17477b54/src/rebar_dialyzer.erl
----------------------------------------------------------------------
diff --git a/src/rebar_dialyzer.erl b/src/rebar_dialyzer.erl
index 982cc7e..0e44592 100644
--- a/src/rebar_dialyzer.erl
+++ b/src/rebar_dialyzer.erl
@@ -143,8 +143,8 @@ info_help(Description) ->
         Description,
         {dialyzer,
          [
-          {plt_location, shared},
           {plt_location, local},
+          {plt_location, shared},
           {plt_location, "custom_dir"},
           {plt_extra_apps, [app1, app2]},
           {warnings, [unmatched_returns, error_handling]}
@@ -164,7 +164,7 @@ plt(Config, AppFile, Opts) ->
     {NewConfig, Plt}.
 
 plt_dir(Config, Opts) ->
-    Location = proplists:get_value(plt_location, Opts, shared),
+    Location = proplists:get_value(plt_location, Opts, local),
     plt_dir1(Config, Location).
 
 plt_dir1(_Config, Location) when is_list(Location) ->
@@ -174,12 +174,12 @@ plt_dir1(_Config, Location) when is_list(Location) ->
         true ->
             Location
     end;
-plt_dir1(_Config, shared) ->
-    {ok, Home} = init:get_argument(home),
-    filename:join([Home, ".rebar", "plt"]);
 plt_dir1(Config, local) ->
     BaseDir = rebar_utils:base_dir(Config),
-    filename:join([BaseDir, ".rebar"]).
+    filename:join([BaseDir, ".rebar"]);
+plt_dir1(_Config, shared) ->
+    {ok, Home} = init:get_argument(home),
+    filename:join([Home, ".rebar", "plt"]).
 
 check_plt_existence(Plt) ->
     case filelib:is_regular(Plt) of


[38/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Fix 'make deps'

We have to partially revert f3f8f29920ace62. The reason for not running
"make -C deps/retest" is to avoid a dependency on rebar in $PATH.

While at it, change one ./rebar to $(REBAR).


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/bcb6a4ea
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/bcb6a4ea
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/bcb6a4ea

Branch: refs/heads/import
Commit: bcb6a4ea45635f0ee96315ead077676ca062f3b5
Parents: b2147de
Author: Tuncer Ayaz <tu...@gmail.com>
Authored: Mon Jun 8 16:22:00 2015 +0200
Committer: Tuncer Ayaz <tu...@gmail.com>
Committed: Mon Jun 8 16:26:52 2015 +0200

----------------------------------------------------------------------
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/bcb6a4ea/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index c0a2818..d0d16f8 100644
--- a/Makefile
+++ b/Makefile
@@ -34,8 +34,8 @@ binary: clean all
 	(cd ../rebar.wiki && git commit -m "Update $(VSN)" rebar)
 
 deps:
-	@REBAR_EXTRA_DEPS=1 ./rebar get-deps
-	$(MAKE) -C deps/retest
+	@REBAR_EXTRA_DEPS=1 $(REBAR) get-deps
+	@(cd deps/retest && $(REBAR) compile escriptize)
 
 test: test_eunit test_inttest
 


[20/50] rebar commit: updated refs/heads/import to 5dea85d

Posted by kx...@apache.org.
Add options 'groups' and 'cases' to 'ct' command

Add option 'groups' to 'rebar ct' command. So the command "rebar ct suites=Suite1 groups=Group1,Group2,...,GroupN" is equal to "ct_run -suite Suite1_SUITE -group Group1 Group2 ... GroupN". It allows to run specified test groups in specified test suite with Common Test tool. Besides it is absolutely necessary to specify groups for running test cases which are included in these groups, otherwise init_per_group/2 and end_per_group/1 callbacks are not called by ct_run.
Add option 'cases' to 'rebar ct' command. So the command "rebar ct suites=Suite1 cases=Case1,Case2,...,CaseN" is equal to "ct_run -suite Suite1_SUITE -case Case1 Case2 ... CaseN". It allows to run one or more test cases in specified test suite. Currently rebar has an option 'case' which allows to run only one test case. The option case is remained for backward compability. It's suggested to consider the option 'case' as deprecaed and recommended to use 'cases' instead.
Updated help messages according to new command line options.
Add warning message when used deprecated options 'case', 'group', 'suite' in command "rebar ct".


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/b041bd99
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/b041bd99
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/b041bd99

Branch: refs/heads/import
Commit: b041bd990d1c5db2a4d6f8bed6897528d467c743
Parents: c3b09ba
Author: Danil Onishchenko <al...@gmail.com>
Authored: Sun Apr 5 19:28:36 2015 +0700
Committer: Danil Onishchenko <al...@gmail.com>
Committed: Wed May 27 17:17:26 2015 +0700

----------------------------------------------------------------------
 THANKS           |  1 +
 src/rebar.erl    |  2 +-
 src/rebar_ct.erl | 72 +++++++++++++++++++++++++++++++++++++++++----------
 3 files changed, 61 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/b041bd99/THANKS
----------------------------------------------------------------------
diff --git a/THANKS b/THANKS
index 4032fd9..13e1cd7 100644
--- a/THANKS
+++ b/THANKS
@@ -135,3 +135,4 @@ Pavel Baturko
 Igor Savchuk
 Mark Anderson
 Brian H. Ward
+Danil Onishchenko

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/b041bd99/src/rebar.erl
----------------------------------------------------------------------
diff --git a/src/rebar.erl b/src/rebar.erl
index 2d356dd..6033297 100644
--- a/src/rebar.erl
+++ b/src/rebar.erl
@@ -450,7 +450,7 @@ eunit       [suite[s]=foo]               Run EUnit tests in foo.erl and
             [random_suite_order=Seed]    with a random seed for the PRNG, or a
                                          specific one.
 
-ct          [suite[s]=] [case=]          Run common_test suites
+ct          [suite[s]= [group[s]= [case[s]=]]] Run common_test suites
 
 qc                                       Test QuickCheck properties
 

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/b041bd99/src/rebar_ct.erl
----------------------------------------------------------------------
diff --git a/src/rebar_ct.erl b/src/rebar_ct.erl
index 480f7f0..022dfc4 100644
--- a/src/rebar_ct.erl
+++ b/src/rebar_ct.erl
@@ -67,8 +67,16 @@ info(help, ct) ->
        "  ~p~n"
        "  ~p~n"
        "Valid command line options:~n"
-       "  suites=foo,bar - run <test>/foo_SUITE and <test>/bar_SUITE~n"
-       "  case=\"mycase\" - run individual test case foo_SUITE:mycase~n",
+       "  suites=Suite1,Suite2,...,SuiteN~n"
+       "      - run Suite1_SUITE, Suite2_SUITE, ..., SuiteN_SUITE~n"
+       "      in the test folder.~n"
+       "  groups=Group1,Group2,...,GroupN~n"
+       "      - run test groups Group1, Group2, ..., GroupN of specified suites.~n"
+       "  cases=Case1,Case2,...,CaseM~n"
+       "      - run test cases Case1, Case2, ..., CaseN of specified suites.~n"
+       "  case=\"mycase\" - run individual test case Suite1_SUITE:mycase.~n"
+       "      This option is deprecated and remains for backward compability.~n"
+       "      It is recommended to use 'cases' instead.~n",
        [
         {ct_dir, "itest"},
         {ct_log_dir, "test/logs"},
@@ -227,7 +235,8 @@ make_cmd(TestDir, RawLogDir, Config) ->
                       get_cover_config(Config, Cwd) ++
                       get_ct_config_file(TestDir) ++
                       get_suites(Config, TestDir) ++
-                      get_case(Config) ++
+                      get_groups(Config) ++
+                      get_cases(Config) ++
                       get_extra_params(Config) ++
                       get_config_file(TestDir);
               SpecFlags ->
@@ -343,17 +352,24 @@ get_suites(Config, TestDir) ->
         undefined ->
             " -dir " ++ TestDir;
         Suites ->
-            Suites1 = string:tokens(Suites, ","),
-            Suites2 = [find_suite_path(Suite, TestDir) || Suite <- Suites1],
-            string:join([" -suite"] ++ Suites2, " ")
+            Suites1 = [find_suite_path(Suite, TestDir) || Suite <- Suites],
+            string:join([" -suite"] ++ Suites1, " ")
     end.
 
 get_suites(Config) ->
     case rebar_config:get_global(Config, suites, undefined) of
         undefined ->
-            rebar_config:get_global(Config, suite, undefined);
+            %% The option 'suite' is deprecated and remains
+            %% for backward compatibility.
+            %% It is recommended to use 'suites' instead.
+            case get_deprecated_global(Config, suite, suites) of
+                undefined ->
+                    undefined;
+                Suite ->
+                    [Suite]
+            end;
         Suites ->
-            Suites
+            string:tokens(Suites, ",")
     end.
 
 find_suite_path(Suite, TestDir) ->
@@ -368,10 +384,40 @@ find_suite_path(Suite, TestDir) ->
             Path
     end.
 
-get_case(Config) ->
-    case rebar_config:get_global(Config, 'case', undefined) of
+get_groups(Config) ->
+    case rebar_config:get_global(Config, groups, undefined) of
         undefined ->
-            "";
-        Case ->
-            " -case " ++ Case
+            %% The option 'group' was added only for consistency
+            %% because there are options 'suite' and 'case'.
+            case get_deprecated_global(Config, group, groups) of
+                undefined ->
+                    "";
+                Group ->
+                    " -group " ++ Group
+            end;
+        Groups ->
+            Groups1 = string:tokens(Groups, ","),
+            string:join([" -group"] ++ Groups1, " ")
+    end.
+
+get_cases(Config) ->
+    case rebar_config:get_global(Config, cases, undefined) of
+        undefined ->
+            %% The option 'case' is deprecated and remains
+            %% for backward compatibility.
+            %% It is recommended to use 'cases' instead.
+            case get_deprecated_global(Config, 'case', cases) of
+                undefined ->
+                    "";
+                Case ->
+                    " -case " ++ Case
+            end;
+        Cases ->
+            Cases1 = string:tokens(Cases, ","),
+            string:join([" -case"] ++ Cases1, " ")
     end.
+
+get_deprecated_global(Config, OldOpt, NewOpt) ->
+    rebar_utils:get_deprecated_global(
+      Config, OldOpt, NewOpt, undefined, "in the future").
+