Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using a package locally with hex.pm

Tags:

elixir

Is it possible to use a local mix project as a hex dependency?

With Bundler I could add a line like:

gem 'action_subscriber', :path => "../action_subscriber" 

so that I could try out using the gem before I published a new version. Is this possible with the hex dependency management tool?

like image 444
mmmries Avatar asked Jan 28 '15 05:01

mmmries


People also ask

How to publish a package on Hex?

Publishing a package to Hex consists of registering a Hex user, adding metadata to the project's mix. exs file, and finally submitting the package with a mix task.

What is Hex elixir?

Hex is a package manager for the BEAM ecosystem, any language that compiles to run on the BEAM VM, such as Elixir and Erlang, can be used to build Hex packages. Hex consists of the HTTP API, this website, the repository serving packages and indexes, HexDocs, the Mix build-tool integration, and other services.


1 Answers

Yes it is. In your mix.exs, you can list the dependency with the :path keyword (very similarly to what you do with gems).

def dependencies do   [{:testing_dep, path: "/Users/me/testing_dep"}] end 

You can read a list of all the supported options (e.g., pulling the dependency from GitHub or from a Git repository) in the documentation for the mix deps task.

like image 127
whatyouhide Avatar answered Oct 18 '22 00:10

whatyouhide