ci: preparations for new mix build
This commit is contained in:
parent
9a003ee3cf
commit
02a0ccfdd1
|
@ -0,0 +1 @@
|
||||||
|
*/.github/*
|
8
Makefile
8
Makefile
|
@ -28,6 +28,8 @@ CT_COVER_EXPORT_PREFIX ?= $(PROFILE)
|
||||||
|
|
||||||
export REBAR_GIT_CLONE_OPTIONS += --depth=1
|
export REBAR_GIT_CLONE_OPTIONS += --depth=1
|
||||||
|
|
||||||
|
ELIXIR_COMMON_DEPS := ensure-hex ensure-mix-rebar3 ensure-mix-rebar
|
||||||
|
|
||||||
.PHONY: default
|
.PHONY: default
|
||||||
default: $(REBAR) $(PROFILE)
|
default: $(REBAR) $(PROFILE)
|
||||||
|
|
||||||
|
@ -58,8 +60,12 @@ ensure-mix-rebar3: $(REBAR)
|
||||||
ensure-mix-rebar: $(REBAR)
|
ensure-mix-rebar: $(REBAR)
|
||||||
@mix local.rebar --if-missing --force
|
@mix local.rebar --if-missing --force
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: elixir-common-deps
|
||||||
|
elixir-common-deps: $(ELIXIR_COMMON_DEPS)
|
||||||
|
|
||||||
.PHONY: mix-deps-get
|
.PHONY: mix-deps-get
|
||||||
mix-deps-get: $(ELIXIR_COMMON_DEPS)
|
mix-deps-get: elixir-common-deps
|
||||||
@mix deps.get
|
@mix deps.get
|
||||||
|
|
||||||
.PHONY: eunit
|
.PHONY: eunit
|
||||||
|
|
|
@ -36,6 +36,7 @@ defmodule EMQX.MixProject do
|
||||||
def deps() do
|
def deps() do
|
||||||
## FIXME!!! go though emqx.app.src and add missing stuff...
|
## FIXME!!! go though emqx.app.src and add missing stuff...
|
||||||
[
|
[
|
||||||
|
{:emqx_mix_utils, in_umbrella: true, runtime: false},
|
||||||
{:emqx_utils, in_umbrella: true},
|
{:emqx_utils, in_umbrella: true},
|
||||||
{:emqx_ds_backends, in_umbrella: true},
|
{:emqx_ds_backends, in_umbrella: true},
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ defmodule EMQXAuth.MixProject do
|
||||||
|
|
||||||
def deps() do
|
def deps() do
|
||||||
[
|
[
|
||||||
|
{:emqx_mix_utils, in_umbrella: true, runtime: false},
|
||||||
{:emqx, in_umbrella: true},
|
{:emqx, in_umbrella: true},
|
||||||
{:emqx_utils, in_umbrella: true}
|
{:emqx_utils, in_umbrella: true}
|
||||||
]
|
]
|
||||||
|
|
|
@ -28,6 +28,7 @@ defmodule EMQXBridge.MixProject do
|
||||||
|
|
||||||
def deps() do
|
def deps() do
|
||||||
[
|
[
|
||||||
|
{:emqx_mix_utils, in_umbrella: true, runtime: false},
|
||||||
{:emqx, in_umbrella: true},
|
{:emqx, in_umbrella: true},
|
||||||
{:emqx_resource, in_umbrella: true},
|
{:emqx_resource, in_umbrella: true},
|
||||||
{:emqx_connector, in_umbrella: true},
|
{:emqx_connector, in_umbrella: true},
|
||||||
|
|
|
@ -33,6 +33,7 @@ defmodule EMQXDurableStorage.MixProject do
|
||||||
|
|
||||||
def deps() do
|
def deps() do
|
||||||
[
|
[
|
||||||
|
{:emqx_mix_utils, in_umbrella: true, runtime: false},
|
||||||
{:emqx_utils, in_umbrella: true},
|
{:emqx_utils, in_umbrella: true},
|
||||||
UMP.common_dep(:rocksdb),
|
UMP.common_dep(:rocksdb),
|
||||||
UMP.common_dep(:gproc),
|
UMP.common_dep(:gproc),
|
||||||
|
|
|
@ -36,6 +36,7 @@ defmodule EMQXExhook.MixProject do
|
||||||
|
|
||||||
def deps() do
|
def deps() do
|
||||||
[
|
[
|
||||||
|
{:emqx_mix_utils, in_umbrella: true, runtime: false},
|
||||||
{:emqx, in_umbrella: true},
|
{:emqx, in_umbrella: true},
|
||||||
{:emqx_utils, in_umbrella: true},
|
{:emqx_utils, in_umbrella: true},
|
||||||
UMP.common_dep(:grpc)
|
UMP.common_dep(:grpc)
|
||||||
|
|
|
@ -26,6 +26,7 @@ defmodule EMQXGateway.MixProject do
|
||||||
|
|
||||||
def deps() do
|
def deps() do
|
||||||
[
|
[
|
||||||
|
{:emqx_mix_utils, in_umbrella: true, runtime: false},
|
||||||
{:emqx, in_umbrella: true},
|
{:emqx, in_umbrella: true},
|
||||||
{:emqx_utils, in_umbrella: true},
|
{:emqx_utils, in_umbrella: true},
|
||||||
{:emqx_ctl, in_umbrella: true},
|
{:emqx_ctl, in_umbrella: true},
|
||||||
|
|
|
@ -34,6 +34,7 @@ defmodule EMQXGatewayExproto.MixProject do
|
||||||
def deps() do
|
def deps() do
|
||||||
test_deps = if UMP.test_env?(), do: [{:emqx_exhook, in_umbrella: true, runtime: false}], else: []
|
test_deps = if UMP.test_env?(), do: [{:emqx_exhook, in_umbrella: true, runtime: false}], else: []
|
||||||
test_deps ++ [
|
test_deps ++ [
|
||||||
|
{:emqx_mix_utils, in_umbrella: true, runtime: false},
|
||||||
{:emqx, in_umbrella: true},
|
{:emqx, in_umbrella: true},
|
||||||
{:emqx_utils, in_umbrella: true},
|
{:emqx_utils, in_umbrella: true},
|
||||||
{:emqx_gateway, in_umbrella: true},
|
{:emqx_gateway, in_umbrella: true},
|
||||||
|
|
|
@ -27,6 +27,7 @@ defmodule EMQXGCPDevice.MixProject do
|
||||||
|
|
||||||
def deps() do
|
def deps() do
|
||||||
[
|
[
|
||||||
|
{:emqx_mix_utils, in_umbrella: true, runtime: false},
|
||||||
{:emqx, in_umbrella: true},
|
{:emqx, in_umbrella: true},
|
||||||
{:emqx_auth, in_umbrella: true},
|
{:emqx_auth, in_umbrella: true},
|
||||||
UMP.common_dep(:jose),
|
UMP.common_dep(:jose),
|
||||||
|
|
|
@ -26,6 +26,7 @@ defmodule EMQXLicense.MixProject do
|
||||||
|
|
||||||
def deps() do
|
def deps() do
|
||||||
[
|
[
|
||||||
|
{:emqx_mix_utils, in_umbrella: true, runtime: false},
|
||||||
{:emqx, in_umbrella: true},
|
{:emqx, in_umbrella: true},
|
||||||
{:emqx_utils, in_umbrella: true},
|
{:emqx_utils, in_umbrella: true},
|
||||||
{:emqx_ctl, in_umbrella: true},
|
{:emqx_ctl, in_umbrella: true},
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
defmodule Mix.Tasks.Emqx.Dialyzer do
|
defmodule Mix.Tasks.Emqx.Dialyzer do
|
||||||
use Mix.Task
|
use Mix.Task
|
||||||
|
|
||||||
alias EMQXUmbrella.MixProject, as: UMP
|
|
||||||
|
|
||||||
if UMP.new_mix_build?() do
|
|
||||||
Code.require_file("emqx.ct.ex", __DIR__)
|
|
||||||
end
|
|
||||||
|
|
||||||
alias Mix.Tasks.Emqx.Ct, as: ECt
|
alias Mix.Tasks.Emqx.Ct, as: ECt
|
||||||
|
|
||||||
@requirements ["compile", "loadpaths"]
|
@requirements ["compile", "loadpaths"]
|
|
@ -1,12 +1,6 @@
|
||||||
defmodule Mix.Tasks.Emqx.Eunit do
|
defmodule Mix.Tasks.Emqx.Eunit do
|
||||||
use Mix.Task
|
use Mix.Task
|
||||||
|
|
||||||
alias EMQXUmbrella.MixProject, as: UMP
|
|
||||||
|
|
||||||
if UMP.new_mix_build?() do
|
|
||||||
Code.require_file("emqx.ct.ex", __DIR__)
|
|
||||||
end
|
|
||||||
|
|
||||||
alias Mix.Tasks.Emqx.Ct, as: ECt
|
alias Mix.Tasks.Emqx.Ct, as: ECt
|
||||||
|
|
||||||
# todo: invoke the equivalent of `make merge-config` as a requirement...
|
# todo: invoke the equivalent of `make merge-config` as a requirement...
|
|
@ -1,8 +1,6 @@
|
||||||
defmodule Mix.Tasks.Emqx.Proper do
|
defmodule Mix.Tasks.Emqx.Proper do
|
||||||
use Mix.Task
|
use Mix.Task
|
||||||
|
|
||||||
# Code.require_file("emqx.ct.ex", __DIR__)
|
|
||||||
|
|
||||||
alias Mix.Tasks.Emqx.Ct, as: ECt
|
alias Mix.Tasks.Emqx.Ct, as: ECt
|
||||||
|
|
||||||
# todo: invoke the equivalent of `make merge-config` as a requirement...
|
# todo: invoke the equivalent of `make merge-config` as a requirement...
|
|
@ -0,0 +1,26 @@
|
||||||
|
defmodule EMQXMixUtils.MixProject do
|
||||||
|
use Mix.Project
|
||||||
|
alias EMQXUmbrella.MixProject, as: UMP
|
||||||
|
|
||||||
|
def project do
|
||||||
|
[
|
||||||
|
app: :emqx_mix_utils,
|
||||||
|
version: "0.1.0",
|
||||||
|
build_path: "../../_build",
|
||||||
|
deps_path: "../../deps",
|
||||||
|
lockfile: "../../mix.lock",
|
||||||
|
elixir: "~> 1.14",
|
||||||
|
start_permanent: Mix.env() == :prod,
|
||||||
|
deps: deps()
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
# Run "mix help compile.app" to learn about applications
|
||||||
|
def application do
|
||||||
|
[extra_applications: UMP.extra_applications()]
|
||||||
|
end
|
||||||
|
|
||||||
|
def deps() do
|
||||||
|
[]
|
||||||
|
end
|
||||||
|
end
|
|
@ -26,6 +26,7 @@ defmodule EMQXS3.MixProject do
|
||||||
|
|
||||||
def deps() do
|
def deps() do
|
||||||
[
|
[
|
||||||
|
{:emqx_mix_utils, in_umbrella: true, runtime: false},
|
||||||
{:emqx, in_umbrella: true},
|
{:emqx, in_umbrella: true},
|
||||||
UMP.common_dep(:gproc),
|
UMP.common_dep(:gproc),
|
||||||
UMP.common_dep(:ehttpc),
|
UMP.common_dep(:ehttpc),
|
||||||
|
|
|
@ -26,6 +26,7 @@ defmodule EMQXTelemetry.MixProject do
|
||||||
|
|
||||||
def deps() do
|
def deps() do
|
||||||
[
|
[
|
||||||
|
{:emqx_mix_utils, in_umbrella: true, runtime: false},
|
||||||
{:emqx, in_umbrella: true},
|
{:emqx, in_umbrella: true},
|
||||||
{:emqx_utils, in_umbrella: true},
|
{:emqx_utils, in_umbrella: true},
|
||||||
{:emqx_conf, in_umbrella: true}
|
{:emqx_conf, in_umbrella: true}
|
||||||
|
|
7
mix.exs
7
mix.exs
|
@ -40,8 +40,6 @@ defmodule EMQXUmbrella.MixProject do
|
||||||
|
|
||||||
if new_mix_build?() do
|
if new_mix_build?() do
|
||||||
[
|
[
|
||||||
# TODO: these lines will be uncommented when we switch to using mix as the manager
|
|
||||||
# for all umbrella apps.
|
|
||||||
apps_path: "apps",
|
apps_path: "apps",
|
||||||
apps:
|
apps:
|
||||||
applications(profile_info.release_type, profile_info.edition_type) |> Keyword.keys(),
|
applications(profile_info.release_type, profile_info.edition_type) |> Keyword.keys(),
|
||||||
|
@ -315,6 +313,7 @@ defmodule EMQXUmbrella.MixProject do
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|> Enum.reject(fn {app, _} -> app == :emqx_mix_utils end)
|
||||||
|> Enum.reject(fn {app, _} -> app in excluded_apps end)
|
|> Enum.reject(fn {app, _} -> app in excluded_apps end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1316,26 +1315,22 @@ defmodule EMQXUmbrella.MixProject do
|
||||||
ensure_test_mix_env!()
|
ensure_test_mix_env!()
|
||||||
set_test_env!(true)
|
set_test_env!(true)
|
||||||
|
|
||||||
Code.require_file("lib/mix/tasks/emqx.ct.ex")
|
|
||||||
Mix.Task.run("emqx.ct", args)
|
Mix.Task.run("emqx.ct", args)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp do_eunit(args) do
|
defp do_eunit(args) do
|
||||||
ensure_test_mix_env!()
|
ensure_test_mix_env!()
|
||||||
set_test_env!(true)
|
set_test_env!(true)
|
||||||
Code.require_file("lib/mix/tasks/emqx.eunit.ex")
|
|
||||||
Mix.Task.run("emqx.eunit", args)
|
Mix.Task.run("emqx.eunit", args)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp do_proper(args) do
|
defp do_proper(args) do
|
||||||
ensure_test_mix_env!()
|
ensure_test_mix_env!()
|
||||||
set_test_env!(true)
|
set_test_env!(true)
|
||||||
Code.require_file("lib/mix/tasks/emqx.proper.ex")
|
|
||||||
Mix.Task.run("emqx.proper", args)
|
Mix.Task.run("emqx.proper", args)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp do_dialyzer(args) do
|
defp do_dialyzer(args) do
|
||||||
Code.require_file("lib/mix/tasks/emqx.dialyzer.ex")
|
|
||||||
Mix.Task.run("emqx.dialyzer", args)
|
Mix.Task.run("emqx.dialyzer", args)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue