Rebar3 has the concept of "Checkout Dependencies" 
(https://www.rebar3.org/docs/dependencies#checkout-dependencies) in which 
the dependency is specified normally in your rebar.config (git repo, hex 
package, etc.), but *if* you create a copy of that project in a _checkouts 
directory, that copy winds up being used.

So, it's not exactly flexible per-environment, but it's quite useful for 
what I would assume are two very common use cases: Working on a local copy 
of a dependency for debugging, or temporarily using a "fixed" version of a 
dependency while waiting for the "official" version to get updated in 
hex/PR merged in the repo/etc.

I personally like the idea of "checkout dependencies" because it's very 
simple and doesn't try to do too much, while covering what I would assume 
to be the most common reasons for wanting local copies of a dependency.

On Friday, May 20, 2016 at 9:06:19 PM UTC-5, Chris Keele wrote:
>
> While I love the local git repo feature of bundler 
> <http://bundler.io/v1.5/git.html#local>, maintaining the invisible 
> bundler configuration and having both local and global options is awful 
> <https://github.com/christhekeele/gem-local>.
>
> I noticed that mix doesn't have this ability and I thought maybe we could 
> get it right.
>
> Currently, there are two mix dep sources that don't go through hex, git and 
> path sources.
>
> The goal would be to come up with a way of specifying a dependency such 
> that mix will use a path source to a dep under certain toggleable 
> conditions, but the git source by default. Additionally, it would be 
> great to somehow avoid having the actual local path source provided 
> appear in the mix.exs config. This requires some sort of hidden state, 
> obviously, but lets package developers transition smoothly between 
> developing and testing packages without risking bad commits or deploys.
>
> My thoughts were to perhaps have a new key in mix.exs project configs, 
> similar to other environmental ones:
>
> def project do
>  [build_embedded: Mix.env == :prod,
>  use_local_deps: Mix.env == :dev,
>  deps: deps]
> end
>
> defp deps do
>  [{:mydep, git: "https://github.com/elixir-lang/mydep.git";, tag: "0.1.0"}]
> end
>
> Then notice the following sort of application configuration in some 
> config/local.exs type file that could be git ignored or avoided being 
> loaded at developer discretion:
>
> config :mix, local: [
>  mydep: "~/Projects/oss/elixir/mydep" 
> ]
>
> When use_local_deps is true then every dep found in the :mix, :local 
> configuration would act like a path source instead of a git one, provided 
> that a tag or branch is set in the git source and is currently true of 
> the local path.
>
> Do we want to support this feature? Is this the best way to configure it? 
> I don't know. I've just started to get tired of toggling alternate 
> commented-out path and git versions of deps, and either accidentally 
> deploying with a path dep, or forgetting to properly update a git dep 
> that I'm also developing locally and pushing frequently.
>
> Depending on how people feel about this feature and its implementation 
> syntax I'd love to work towards a PR for this.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/062385f5-9ee3-4920-8ba4-9991e93dacb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to