Commit graph

85 commits

Author SHA1 Message Date
Andrew Thompson
e74de95eeb Address review comments and add inttest for update-deps 2013-09-30 16:57:50 -04:00
Andrew Thompson
eae26a5c43 Fix skip check for deps not present 2013-09-24 12:07:41 -04:00
Andrew Thompson
d9aa65f118 Make update-deps honor apps= and skip_apps=
Because rebar_core handles skipping apps, we had to specialcase the
handling in the case of update-deps because it has to do its own dep
handling. The way this was done is not particularly clean, but there
currently does not exist another way for a command to signal rebar_core
that it doesn't want rebar_core to pay attention to skip_apps.

With this change, however, you can update-deps even with local
conflicting changes/commits by simply skipping the deps you don't wish
to update, or whitelisting he ones you do wish to update.
2013-09-23 15:19:51 -04:00
Andrew Thompson
f46e7b2e5c Change how update-deps updates a git branch
Previously, update-deps on a dep tagged as {branch, ...} would do the
following:

  git fetch
  git checkout -q origin/<branch>

If you were already on that branch, the repo would end up in detached
head state. This is kind of annoying if you're doing local development.

This patch changes the behaviour to be

  git fetch
  git checkout -q <branch>
  git pull --ff-only --no-rebase -q <branch>

The intent of this is to move the branch's HEAD forward to match
upstream without destroying any local commits or changes, and without
accidentally causing merges or rebases. It will fail if the operation
can not be performed without losing history, merging or rebasing.

The previous behaviour has been around a very long time:

064195dc5a (L0R308)

It also exactly mirrors the download_source case, which is not really
true. With git tags and SHAs, one can assume that they don't change, but
branches move all the time.
2013-09-23 15:13:26 -04:00
Andrew Thompson
0977d58361 Ignore skip_deps during update-deps as it has no meaning 2013-09-23 15:11:11 -04:00
Andrew Thompson
cb4599f828 Make update-deps traverse deps breadth-first, top-down
This ensures that deps of deps are updated AFTER the dep listing them
is, so that a complicated project with many layers of deps will be
updated correctly. Any new deps encountered along the way are also
cloned, and THEIR deps are also evaluated.

Also added was conflict detection, if a dep has differing versions or
source information, inherited from different places, that will be logged
at the end of update-deps, along with the origin of each conflicting
dep.
2013-09-20 01:24:07 -04:00
Dave Smith
620c4b01c6 Use REBAR_DEPS_DIR if set as location of DEPS dir 2013-07-02 10:59:26 -06:00
Tuncer Ayaz
2faabf460d rebar_deps: fix overlong line introduced in 0b83339 2013-06-27 21:02:16 +02:00
José Valim
e467642476 External deps_dir should have higher priority than the config one
The external deps_dir should have higher priority because
it is used by scripts and other build tools to set up the
location of the dependencies. This commit ensures that,
even if a project has set deps_dir in its config file has
lower preference than the command line one.
2013-06-18 00:28:52 +03:00
Tuncer Ayaz
dc2f5c8c7b Update rebar repo urls 2013-03-02 14:16:33 +01:00
Tuncer Ayaz
4b8c81fb53 Implement 'rebar help CMD1 CMD2' and extend common 'rebar help' msg
* allow plugins to print help message for implemented commands
* append core rebar.config options to common 'rebar help' message
2012-12-31 20:45:11 +01:00
Dave Smith
6eb7c08499 Merge pull request #293 from Motiejus/skip_deps
Add skip_deps=AppListSeparatedByCommas feature.

I agree it's a bit of a weird thing, but it's a reasonable and safe extension. When time comes to properly overhaul stuff, skip_deps should disappear entirely.
2012-10-31 19:47:13 -07:00
Anton Lavrik
0b833391ed Add support for non-Erlang/OTP (raw) dependencies
Introduce a new 'raw' option for dependency specs in rebar.config file.
For example:

{deps,
    {dependency_name, "1.0.*",
	 {git, "<...>", {branch, "master"}},
	 [raw]
    }
]}.

When this option is specified, rebar does not require the dependency to
have a standard Erlang/OTP layout which assumes presence of either
"src/dependency_name.app.src" or "ebin/dependency_name.app" files.

'raw' dependencies can still contain 'rebar.config' and even can have
the proper OTP directory layout, but they won't be compiled.

Only a subset of rebar commands will be executed on the 'raw'
subdirectories:

	get-deps, update-deps, check-deps, list-deps and delete-deps.
2012-10-11 02:06:08 -05:00
Tuncer Ayaz
2829741a38 Fix whitespace errors 2012-09-28 23:37:18 +02:00
Martin Schut
fbbeb360a5 deps: add fossil scm support 2012-09-28 23:34:53 +02:00
Tuncer Ayaz
9521586bdd rebar_deps: fix whitespace errors 2012-09-15 19:05:15 +02:00
Yurii Rashkovskii
9a57e06015 Restore ability to specify deps_dir on the command line
It was previously possible to run `rebar compile deps_dir=/path/to/deps`,
but as of 70d27c5720, it was nixed.
2012-09-15 18:58:02 +02:00
Motiejus Jakštys
8f01d0de60 Add skip_deps=AppListSeparatedByCommas feature 2012-08-09 09:48:16 +02:00
Tuncer Ayaz
636c02f0be Fix R13B03 build (Reported-by: Sergey Nartimov) 2012-07-28 19:51:57 +02:00
Tuncer Ayaz
70d27c5720 rebar_deps: use xconf for deps_dir 2012-07-23 20:53:43 +02:00
Tuncer Ayaz
252757c753 Do not use application:set_env 2012-07-23 13:17:11 +02:00
Tuncer Ayaz
e185e86bff Remove shared state 2012-07-13 15:21:56 +02:00
Dave Smith
c86c99940d Remove ?FAIL in favor of ?ABORT 2012-06-08 07:06:15 -06:00
Nick Vatamaniuc
8d82330802 Add rsync as another option to fetch dependencies
Newly added syntax:

{deps, [ {<depname>, ".*", {rsync, "<rsync_url>"}}, ... ]}

Where rsync_url is any URL accepted by the rsync command.
2012-05-14 10:04:41 +02:00
Tuncer Ayaz
32ddef7158 Remove alt_url support in favor of new features 2012-05-13 19:30:38 +02:00
Tuncer Ayaz
ae178b851b Fix #209 (Reported-by: Bjorn Bylander)
Use correct ERL_LIBS separator on Windows.
2012-04-04 17:44:36 +02:00
Adam Schepis
03a026f38f Add support for alternate dependency urls
This change adds the ability to use alternate urls for downloading
dependencies. To make use of alternate urls run:
rebar get-deps alt_urls=true
2012-03-31 19:21:25 +02:00
Tuncer Ayaz
cab1671ea0 Add missing newline for logging code path update 2012-01-13 18:18:51 +01:00
Bob Ippolito
a54dd53673 Treat HEAD as a branch to fix regressions caused by 3ef7db5 2011-11-16 21:46:18 +01:00
Tuncer Ayaz
147d5e3b56 Remove gratuitous space in debug log 2011-11-09 22:56:54 +01:00
Tim Watson
86325b616d Allow plugins to participate in pre and post processing
This patch modifies rebar_core to allow plugins to participate in the
pre and post processing steps, giving plugin authors more flexibility
and control.
2011-10-20 16:31:08 +02:00
Anton Lavrik
7b90cc4707 Export $REBAR_DEPS_DIR and $ERL_LIBS variables
Export two extra environment variables when executing shell commands.
These variables are useful for rebar hooks that rely on Erlang
applications installed as rebar dependencies.

$REBAR_DEPS_DIR contains a fully-qualified name of the directory where
rebar stores dependencies.

$ERL_LIBS is set to $REBAR_DEPS_DIR or to "$REBAR_DEPS_DIR:$ERL_LIBS",
if $ERL_LIBS was defined before.
2011-09-02 19:21:11 +02:00
Tuncer Ayaz
c3a4ed292e Clean up and fix vcs functions and logging 2011-09-02 14:54:08 +02:00
Ben Ellis
3ef7db59cb Add support for checking out specific git commit 2011-09-01 22:29:55 +02:00
Tuncer Ayaz
45f44c2166 Fix {git,Url} support (Reported-by: Garrett Smith) 2011-07-08 14:04:11 +02:00
Dave Smith
85eb2957c3 Add list-deps command 2011-04-21 06:08:40 -06:00
Tuncer Ayaz
fa38ed64cc Simplify find_dep_in_dir 2011-03-13 15:55:36 +01:00
Tuncer Ayaz
85e820096d Fix comments 2011-03-13 14:11:24 +01:00
Christopher Brown
0a603435f5 honor local deps before code path 2011-03-02 21:06:30 -08:00
David Reid
3241165ced Support 2 forms of implicit HEAD for git
In git origin/HEAD is a pointer to the default branch.  This patch
allows two alternatives to explicitly specifying "HEAD" in git VC specs.

The first is a 2 arity form {git, Url} and the second is {git, Url, ""}
which worked in pre-update-deps rebars.
2011-02-13 16:05:42 +01:00
Tuncer Ayaz
63de05d914 Clean up code 2011-02-06 17:41:04 +01:00
Tuncer Ayaz
c466076ffb Clean up emacs file local variables 2011-01-31 17:55:36 +01:00
Tuncer Ayaz
e4036cbe56 Apply Tidier suggestions 2011-01-13 17:39:14 +01:00
Tuncer Ayaz
422beee324 Return more descriptive dependency errors 2011-01-06 15:50:16 +01:00
Juhani Rankimies
52ca7795fe Unify executable invocation
Add flags to rebar_utils:sh to control output and error handling.
Replace calls to os:cmd with calls to rebar_utils:sh.
2011-01-06 15:02:19 +01:00
Tuncer Ayaz
d8e50e8c2d Implement update-deps and disable auto update 2010-12-17 12:39:50 +01:00
Tuncer Ayaz
07269ebdb9 Add VCS dir check for bzr and svn 2010-12-07 19:32:58 +01:00
Dave Smith
3e12630f23 Check for VCS directory before attempting source update. 2010-12-07 10:38:00 -07:00
Adam Kocoloski
8118083122 Return descriptive errors from is_app_available() 2010-11-30 01:18:48 +01:00
Misha Gorodnitzky
064195dc5a Fix git tag and branch dependency handling
Change git downloads and updates to not create branches and fix git
tag handling.
2010-11-20 23:32:49 +01:00