Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

178 рядки
5.8KB

  1. defmodule Pleroma.Mixfile do
  2. use Mix.Project
  3. def project do
  4. [
  5. app: :pleroma,
  6. version: version("0.9.0"),
  7. elixir: "~> 1.7",
  8. elixirc_paths: elixirc_paths(Mix.env()),
  9. compilers: [:phoenix, :gettext] ++ Mix.compilers(),
  10. elixirc_options: [warnings_as_errors: true],
  11. xref: [exclude: [:eldap]],
  12. start_permanent: Mix.env() == :prod,
  13. aliases: aliases(),
  14. deps: deps(),
  15. # Docs
  16. name: "Pleroma",
  17. source_url: "https://git.pleroma.social/pleroma/pleroma",
  18. source_url_pattern:
  19. "https://git.pleroma.social/pleroma/pleroma/blob/develop/%{path}#L%{line}",
  20. homepage_url: "https://pleroma.social/",
  21. docs: [
  22. logo: "priv/static/static/logo.png",
  23. extras: ["README.md", "CHANGELOG.md"] ++ Path.wildcard("docs/**/*.md"),
  24. groups_for_extras: [
  25. "Installation manuals": Path.wildcard("docs/installation/*.md"),
  26. Configuration: Path.wildcard("docs/config/*.md"),
  27. Administration: Path.wildcard("docs/admin/*.md"),
  28. "Pleroma's APIs and Mastodon API extensions": Path.wildcard("docs/api/*.md")
  29. ],
  30. main: "readme",
  31. output: "priv/static/doc"
  32. ]
  33. ]
  34. end
  35. # Configuration for the OTP application.
  36. #
  37. # Type `mix help compile.app` for more information.
  38. def application do
  39. [
  40. mod: {Pleroma.Application, []},
  41. extra_applications: [:logger, :runtime_tools, :comeonin, :quack],
  42. included_applications: [:ex_syslogger]
  43. ]
  44. end
  45. # Specifies which paths to compile per environment.
  46. defp elixirc_paths(:test), do: ["lib", "test/support"]
  47. defp elixirc_paths(_), do: ["lib"]
  48. # Specifies your project dependencies.
  49. #
  50. # Type `mix help deps` for examples and options.
  51. defp deps do
  52. oauth_strategies = String.split(System.get_env("OAUTH_CONSUMER_STRATEGIES") || "")
  53. oauth_deps =
  54. for s <- oauth_strategies,
  55. do: {String.to_atom("ueberauth_#{s}"), ">= 0.0.0"}
  56. [
  57. {:phoenix, "~> 1.4.1"},
  58. {:plug_cowboy, "~> 2.0"},
  59. {:phoenix_pubsub, "~> 1.1"},
  60. {:phoenix_ecto, "~> 4.0"},
  61. {:ecto_sql, "~>3.0.5"},
  62. {:postgrex, ">= 0.13.5"},
  63. {:gettext, "~> 0.15"},
  64. {:comeonin, "~> 4.1.1"},
  65. {:pbkdf2_elixir, "~> 0.12.3"},
  66. {:trailing_format_plug, "~> 0.0.7"},
  67. {:html_sanitize_ex, "~> 1.3.0"},
  68. {:html_entities, "~> 0.4"},
  69. {:phoenix_html, "~> 2.10"},
  70. {:calendar, "~> 0.17.4"},
  71. {:cachex, "~> 3.0.2"},
  72. {:httpoison, "~> 1.2.0"},
  73. {:poison, "~> 3.0", override: true},
  74. {:tesla, "~> 1.2"},
  75. {:jason, "~> 1.0"},
  76. {:mogrify, "~> 0.6.1"},
  77. {:ex_aws, "~> 2.0"},
  78. {:ex_aws_s3, "~> 2.0"},
  79. {:earmark, "~> 1.3"},
  80. {:ex_machina, "~> 2.3", only: :test},
  81. {:credo, "~> 0.9.3", only: [:dev, :test]},
  82. {:mock, "~> 0.3.1", only: :test},
  83. {:crypt,
  84. git: "https://github.com/msantos/crypt", ref: "1f2b58927ab57e72910191a7ebaeff984382a1d3"},
  85. {:cors_plug, "~> 1.5"},
  86. {:ex_doc, "~> 0.19", only: :dev, runtime: false},
  87. {:web_push_encryption, "~> 0.2.1"},
  88. {:swoosh, "~> 0.20"},
  89. {:gen_smtp, "~> 0.13"},
  90. {:websocket_client, git: "https://github.com/jeremyong/websocket_client.git", only: :test},
  91. {:floki, "~> 0.20.0"},
  92. {:ex_syslogger, github: "slashmili/ex_syslogger", tag: "1.4.0"},
  93. {:timex, "~> 3.5"},
  94. {:ueberauth, "~> 0.4"},
  95. {:auto_linker,
  96. git: "https://git.pleroma.social/pleroma/auto_linker.git",
  97. ref: "90613b4bae875a3610c275b7056b61ffdd53210d"},
  98. {:pleroma_job_queue, "~> 0.2.0"},
  99. {:telemetry, "~> 0.3"},
  100. {:prometheus_ex, "~> 3.0"},
  101. {:prometheus_plugs, "~> 1.1"},
  102. {:prometheus_phoenix, "~> 1.2"},
  103. {:prometheus_ecto, "~> 1.4"},
  104. {:prometheus_process_collector, "~> 1.4"},
  105. {:recon, github: "ferd/recon", tag: "2.4.0"},
  106. {:quack, "~> 0.1.1"}
  107. ] ++ oauth_deps
  108. end
  109. # Aliases are shortcuts or tasks specific to the current project.
  110. # For example, to create, migrate and run the seeds file at once:
  111. #
  112. # $ mix ecto.setup
  113. #
  114. # See the documentation for `Mix` for more info on aliases.
  115. defp aliases do
  116. [
  117. "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
  118. "ecto.reset": ["ecto.drop", "ecto.setup"],
  119. test: ["ecto.create --quiet", "ecto.migrate", "test"]
  120. ]
  121. end
  122. # Builds a version string made of:
  123. # * the application version
  124. # * a pre-release if ahead of the tag: the describe string (-count-commithash)
  125. # * build info:
  126. # * a build name if `PLEROMA_BUILD_NAME` or `:pleroma, :build_name` is defined
  127. # * the mix environment if different than prod
  128. defp version(version) do
  129. {git_tag, git_pre_release} =
  130. with {tag, 0} <- System.cmd("git", ["describe", "--tags", "--abbrev=0"]),
  131. tag = String.trim(tag),
  132. {describe, 0} <- System.cmd("git", ["describe", "--tags", "--abbrev=8"]),
  133. describe = String.trim(describe),
  134. ahead <- String.replace(describe, tag, "") do
  135. {String.replace_prefix(tag, "v", ""), if(ahead != "", do: String.trim(ahead))}
  136. else
  137. _ -> {nil, nil}
  138. end
  139. if git_tag && version != git_tag do
  140. Mix.shell().error(
  141. "Application version #{inspect(version)} does not match git tag #{inspect(git_tag)}"
  142. )
  143. end
  144. build_name =
  145. cond do
  146. name = Application.get_env(:pleroma, :build_name) -> name
  147. name = System.get_env("PLEROMA_BUILD_NAME") -> name
  148. true -> nil
  149. end
  150. env_name = if Mix.env() != :prod, do: to_string(Mix.env())
  151. build =
  152. [build_name, env_name]
  153. |> Enum.filter(fn string -> string && string != "" end)
  154. |> Enum.join("-")
  155. |> (fn
  156. "" -> nil
  157. string -> "+" <> string
  158. end).()
  159. [version, git_pre_release, build]
  160. |> Enum.filter(fn string -> string && string != "" end)
  161. |> Enum.join()
  162. end
  163. end