Hello,
I am currently building a Mix archive in Elixir. I have multiple library dependencies. here my mix.exs
defmodule Zenaton.Mixfile do
use Mix.Project
def version, do: "1.0.0"
def project do
[
app: :zenaton,
version: version(),
elixir: "~> 1.4",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
name: "zenaton",
aliases: aliases(),
deps: deps()
]
end
# Configuration for the OTP application
#
# Type "mix help compile.app" for more information
def application do
# Specify extra applications you'll use from Erlang/Elixir
[
extra_applications: [:amqp, :porcelain, :logger, :cowboy, :plug, :httpoison, :dotenv],
mod: {Zenaton.Application, []}
]
end
defp deps do
[
{:amqp, "~> 0.3.0"},
{:cowboy, "~> 1.1"},
{:dotenv, "~> 2.0.0"},
{:httpoison, "~> 0.13.0"},
{:plug, "~> 1.4"},
{:poison, "~> 3.1"},
{:porcelain, "~> 2.0"},
{:uuid, "~> 1.1"}
]
end
defp aliases do
[
build: [ &build_releases/1]
]
end
defp build_releases(_) do
Mix.Tasks.Compile.run([])
Mix.Tasks.Archive.Build.run([])
Mix.Tasks.Archive.Build.run(["--output=zenaton.ez"])
archives = "./zenaton_archives"
File.rename("zenaton.ez", "#{archives}/zenaton.ez")
File.rename("zenaton-#{version()}.ez", "#{archives}/zenaton-#{version()}.ez")
end
end
I can install very easily this archive by doing: mix archive.install zenaton.ez and when Iâm launching my task command with mix zenaton.listen. I have this error:slight_smile:
** (FunctionClauseError) no function clause matching in Mix.raise/1
(mix) lib/mix.ex:275: Mix.raise({:error, {:amqp, {âno such file or directoryâ, âamqp.appâ}}})
(mix) lib/mix/task.ex:294: Mix.Task.run_task/3
(mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2
(elixir) lib/code.ex:370: Code.require_file/2
It seems that the archive is not built with amqp dependencies.
In my run/1 function in mix task, I added Application.ensure_all_started(:zenaton)
to load the dependencies. But it doesnât help