[英]How do I configure mix.exs to make umbrella project apps share the same version?
I want to define the version in the root mix.exs.我想在根 mix.exs 中定义版本。 The project in apps can read this version.应用程序中的项目可以读取此版本。 Can it be configured like this?可以这样配置吗?
root mix.exs
:根mix.exs
:
defmodule MyCoolUmbrellaApp.Mixfile do
use Mix.Project
def project do
[app: :my_cool_umbrella_app,
version: "1.0",
apps_path: "apps",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps()]
end
defp deps do
[
]
end
end
code in one of the apps in the umbrella:在保护伞中的应用程序之一中的代码:
defmodule SomeApp.SomeModule do
def some_function() do
project = Mix.Project.get.project
app = project[:app]
version = project[:version]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.