-
Notifications
You must be signed in to change notification settings - Fork 9
/
mix.exs
90 lines (81 loc) · 2.57 KB
/
mix.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
defmodule DataSchema.MixProject do
use Mix.Project
@version "0.5.0"
@source_url "https://github.com/Adzz/data_schema"
def project do
[
app: :data_schema,
version: @version,
elixir: "~> 1.13",
package: package(),
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
description: description(),
aliases: aliases(),
source_url: @source_url,
docs: docs(),
deps: deps()
]
end
defp aliases() do
[docs: ["docs", &create_livebook/1]]
end
defp create_livebook(_) do
Mix.Task.run("create_livebook_from_module", ["DataSchema", "livebooks/readme", "[{:data_schema, path: \"./\"}]"])
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
# Because we have this the docs would leak (as they are generated in dev env).
# To avoid that we set ex_docs to only appear in :docs env. That mean to publish
# the library we must first manually generate the docs with MIX_ENV=docs mix hex.publish
defp elixirc_paths(:dev), do: ["lib", "test/support"]
defp elixirc_paths(:docs), do: ["lib"]
defp elixirc_paths(_), do: ["lib"]
def application do
[
extra_applications: [:logger]
]
end
defp description() do
"Declarative descriptions of how to create a struct from different kinds of input data."
end
defp deps do
[
# This is added just so we can test the idea of an XML schema.
{:sweet_xml, ">= 0.0.0", only: [:dev, :test]},
{:benchee, ">= 0.0.0", only: [:dev, :test]},
# This will be used for benchmarking.
{:ecto, ">= 0.0.0", only: [:dev, :test]},
{:livebook_helpers, "~> 0.0.8", only: [:dev, :docs]},
{:ex_doc, ">= 0.0.0", only: :docs, runtime: false}
]
end
defp package() do
[
licenses: ["Apache 2.0"],
links: %{"GitHub" => @source_url}
]
end
# See here for more: https://hexdocs.pm/ex_doc/Mix.Tasks.Docs.html
defp docs do
[
main: DataSchema,
extra_section: "GUIDES",
source_url: @source_url,
skip_undefined_reference_warnings_on: ["CHANGELOG.md"],
extras: [
"guides/introduction/Getting Started.md",
"guides/introduction/XML Schemas.md"
# do this when we implement the other.
# "guides/introduction/Stopping to_struct when there is an error.md"
],
groups_for_extras: [
Introduction: ~r/guides\/introduction\/.?/
],
groups_for_functions: [],
groups_for_modules: [
Accessors: [DataSchema.MapAccessor],
Behaviours: [DataSchema.DataAccessBehaviour]
]
]
end
end