diff options
author | Christophe Romain <christophe.romain@process-one.net> | 2015-05-29 09:30:16 +0200 |
---|---|---|
committer | Christophe Romain <christophe.romain@process-one.net> | 2015-05-29 09:30:16 +0200 |
commit | 6cba7bf83459be24e384e016c017c639ecc8226c (patch) | |
tree | f59ee7fb0dc39d9538e973c546bfeb491eab9130 /mix.exs.in | |
parent | Validate MUC room options from the configuration file (diff) |
Add correct package version for mix (#577)
Diffstat (limited to 'mix.exs.in')
-rw-r--r-- | mix.exs.in | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/mix.exs.in b/mix.exs.in new file mode 100644 index 000000000..d7b236e01 --- /dev/null +++ b/mix.exs.in @@ -0,0 +1,77 @@ +defmodule Ejabberd.Mixfile do + use Mix.Project + + def project do + [app: :ejabberd, + version: "@PACKAGE_VERSION@", + elixir: "~> 1.0", + elixirc_paths: ["lib"], + compile_path: ".", + compilers: [:asn1] ++ Mix.compilers, + erlc_options: erlc_options, + erlc_paths: ["asn1", "src"], + deps: deps] + end + + def application do + [mod: {:ejabberd_app, []}, + applications: [:kernel, :stdlib]] + end + + defp erlc_options do + includes = Path.wildcard(Path.join("..", "/*/include")) + [:debug_info, {:d, :NO_EXT_LIB}] ++ Enum.map(includes, fn(path) -> {:i, path} end) + end + + defp deps do + [ + {:p1_xml, github: "processone/xml"}, + {:p1_logger, github: "processone/p1_logger"}, + {:p1_yaml, github: "processone/p1_yaml"}, + {:p1_tls, github: "processone/tls"}, + {:p1_stringprep, github: "processone/stringprep"}, + {:p1_zlib, github: "processone/zlib"}, + {:p1_cache_tab, github: "processone/cache_tab"}, + {:p1_utils, github: "processone/p1_utils"}, + {:p1_iconv, github: "processone/eiconv"}, + {:esip, github: "processone/p1_sip"}, + {:p1_stun, github: "processone/stun"}, + {:ehyperloglog, github: "vaxelfel/eHyperLogLog"}, + {:p1_mysql, github: "processone/mysql"}, + {:p1_pgsql, github: "processone/pgsql"}, + {:eredis, github: "wooga/eredis"} + ] + end +end + +defmodule Mix.Tasks.Compile.Asn1 do + use Mix.Task + alias Mix.Compilers.Erlang + + @recursive true + @manifest ".compile.asn1" + + def run(args) do + {opts, _, _} = OptionParser.parse(args, switches: [force: :boolean]) + + project = Mix.Project.config + source_paths = project[:asn1_paths] || ["asn1"] + dest_paths = project[:asn1_target] || ["src"] + mappings = Enum.zip(source_paths, dest_paths) + options = project[:asn1_options] || [] + + Erlang.compile(manifest(), mappings, :asn1, :erl, opts[:force], fn + input, output -> + options = options ++ [:noobj, outdir: Erlang.to_erl_file(Path.dirname(output))] + case :asn1ct.compile(Erlang.to_erl_file(input), options) do + :ok -> {:ok, :done} + error -> error + end + end) + end + + def manifests, do: [manifest] + defp manifest, do: Path.join(Mix.Project.manifest_path, @manifest) + + def clean, do: Erlang.clean(manifest()) +end |