mix.exs (1061B)
1 defmodule NimbleParsec.MixProject do 2 use Mix.Project 3 4 @version "1.2.3" 5 @url "https://github.com/dashbitco/nimble_parsec" 6 7 def project do 8 [ 9 app: :nimble_parsec, 10 version: @version, 11 elixir: "~> 1.6", 12 name: "NimbleParsec", 13 description: "A simple and fast library for text-based parser combinators", 14 aliases: [docs: &build_docs/1], 15 package: package() 16 ] 17 end 18 19 def application do 20 [] 21 end 22 23 defp package do 24 %{ 25 licenses: ["Apache-2.0"], 26 maintainers: ["José Valim"], 27 links: %{"GitHub" => @url} 28 } 29 end 30 31 defp build_docs(_) do 32 Mix.Task.run("compile") 33 ex_doc = Path.join(Mix.path_for(:escripts), "ex_doc") 34 35 unless File.exists?(ex_doc) do 36 raise "cannot build docs because escript for ex_doc is not installed" 37 end 38 39 args = ["NimbleParsec", @version, Mix.Project.compile_path()] 40 opts = ~w[--main NimbleParsec --source-ref v#{@version} --source-url #{@url}] 41 System.cmd(ex_doc, args ++ opts) 42 Mix.shell().info("Docs built successfully") 43 end 44 end