Mix v1.1.1 Mix.Archive

Module responsible for managing archives.

An archive is a zip file containing the app and beam files. A valid archive must be named with the name of the application and it should contain the relative paths beginning with the application name, e.g. the root of the zip file should be my_app/ebin/Elixir.My.App.beam.

Summary

Functions

Creates an application archive

Returns the archive internal directory from its path

Returns the ebin directory inside the given archive path

Returns the archive name based on app and version

Functions

create(source, target)

Creates an application archive.

It receives the archive file in the format path/to/archive/app-vsn.ez and the path to the root of the project to be archived. Everything in the ebin and priv directories is archived. Dependencies are not archived.

dir(path)

Returns the archive internal directory from its path.

Examples

iex> Mix.Archive.dir("foo/bar/baz-0.1.0.ez")
"baz-0.1.0"
ebin(path)

Returns the ebin directory inside the given archive path.

Examples

iex> Mix.Archive.ebin("foo/bar/baz-0.1.0.ez")
"foo/bar/baz-0.1.0.ez/baz-0.1.0/ebin"
name(app, vsn)

Returns the archive name based on app and version.

Examples

iex> Mix.Archive.name("foo", nil)
"foo.ez"

iex> Mix.Archive.name("foo", "0.1.0")
"foo-0.1.0.ez"