From 621ca378fab120e5b186ff05af8f8b8be179125c Mon Sep 17 00:00:00 2001 From: "m.malkin" Date: Fri, 22 Sep 2023 19:36:13 +0200 Subject: [PATCH] Support for poncho apps --- lib/clean_mixer/compiler_manifests/app.ex | 8 +++++++- lib/clean_mixer/compiler_manifests/mix_project.ex | 2 +- lib/clean_mixer/project.ex | 8 ++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/clean_mixer/compiler_manifests/app.ex b/lib/clean_mixer/compiler_manifests/app.ex index 7f58ce3..214b6e6 100644 --- a/lib/clean_mixer/compiler_manifests/app.ex +++ b/lib/clean_mixer/compiler_manifests/app.ex @@ -34,8 +34,14 @@ defmodule CleanMixer.CompilerManifests.App do } end + @spec poncho_project_apps() :: list(t) + def poncho_project_apps do + current_deps() + |> Enum.reject(&String.starts_with?(&1.path, "deps/")) + end + @spec current_deps() :: list(t) - def current_deps() do + def current_deps do deps = Mix.Dep.load_on_environment(env: Mix.env()) for %{app: app_name, opts: opts} <- deps, !umbrella_app?(opts) do diff --git a/lib/clean_mixer/compiler_manifests/mix_project.ex b/lib/clean_mixer/compiler_manifests/mix_project.ex index b88f6c7..6f36d33 100644 --- a/lib/clean_mixer/compiler_manifests/mix_project.ex +++ b/lib/clean_mixer/compiler_manifests/mix_project.ex @@ -22,6 +22,6 @@ defmodule CleanMixer.CompilerManifests.MixProject do end def apps(%__MODULE__{umbrella?: false}) do - [App.current()] + [App.current()] ++ App.poncho_project_apps() end end diff --git a/lib/clean_mixer/project.ex b/lib/clean_mixer/project.ex index 81c6c10..d146178 100644 --- a/lib/clean_mixer/project.ex +++ b/lib/clean_mixer/project.ex @@ -31,10 +31,10 @@ defmodule CleanMixer.Project do } end - defp hex_packs() do - for app <- App.current_deps() do - %{name: "hex/#{app.name}", path: app.path, tags: [hex_pack: true]} - end + defp hex_packs do + App.current_deps() + |> Enum.filter(&String.starts_with?(&1.path, "deps/")) + |> Enum.map(fn app -> %{name: "hex/#{app.name}", path: app.path, tags: [hex_pack: true]} end) end defp make_arch_map(component_map, code_map) do