From 25672201ea41270e3224bd00872d94f24d7403b8 Mon Sep 17 00:00:00 2001 From: Micky Jittjana Date: Fri, 16 Sep 2022 12:17:09 +0700 Subject: [PATCH 1/2] [#252] Remove gettext compiler --- .../templates/variants/phoenix/template.ex | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/nimble_template/templates/variants/phoenix/template.ex b/lib/nimble_template/templates/variants/phoenix/template.ex index 22df9a31..57c7c907 100644 --- a/lib/nimble_template/templates/variants/phoenix/template.ex +++ b/lib/nimble_template/templates/variants/phoenix/template.ex @@ -3,7 +3,7 @@ defmodule NimbleTemplate.Templates.Phoenix.Template do import NimbleTemplate.{AddonHelper, GithubHelper} - alias NimbleTemplate.Addons + alias NimbleTemplate.{Addons, Generator} alias NimbleTemplate.Addons.Phoenix, as: PhoenixAddons alias NimbleTemplate.Projects.Project alias NimbleTemplate.Templates.Phoenix.Api.Template, as: ApiTemplate @@ -18,6 +18,9 @@ defmodule NimbleTemplate.Templates.Phoenix.Template do # credo:disable-for-next-line Credo.Check.Refactor.ABCSize defp apply_phoenix_common_setup(%Project{} = project) do + # TODO: Remove me after the Phoenix generator fix releases: https://github.com/phoenixframework/phoenix/pull/4894 + remove_gettext_compiler() + project |> apply_default_common_phoenix_addons() |> apply_optional_common_phoenix_addons() @@ -108,4 +111,8 @@ defmodule NimbleTemplate.Templates.Phoenix.Template do defp apply_phoenix_variant_setup(%Project{web_project?: true, live_project?: true} = project), do: LiveTemplate.apply(project) + + defp remove_gettext_compiler() do + Generator.delete_content("mix.exs", "[:gettext] ++ ") + end end From d77a37c0c9002baba05391044f126c5f9103234f Mon Sep 17 00:00:00 2001 From: Micky Jittjana Date: Fri, 16 Sep 2022 12:46:25 +0700 Subject: [PATCH 2/2] [#252] Use compiler default value --- lib/nimble_template/templates/variants/phoenix/template.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nimble_template/templates/variants/phoenix/template.ex b/lib/nimble_template/templates/variants/phoenix/template.ex index 57c7c907..3f5565e4 100644 --- a/lib/nimble_template/templates/variants/phoenix/template.ex +++ b/lib/nimble_template/templates/variants/phoenix/template.ex @@ -19,7 +19,7 @@ defmodule NimbleTemplate.Templates.Phoenix.Template do # credo:disable-for-next-line Credo.Check.Refactor.ABCSize defp apply_phoenix_common_setup(%Project{} = project) do # TODO: Remove me after the Phoenix generator fix releases: https://github.com/phoenixframework/phoenix/pull/4894 - remove_gettext_compiler() + remove_mix_compiler_config() project |> apply_default_common_phoenix_addons() @@ -112,7 +112,7 @@ defmodule NimbleTemplate.Templates.Phoenix.Template do defp apply_phoenix_variant_setup(%Project{web_project?: true, live_project?: true} = project), do: LiveTemplate.apply(project) - defp remove_gettext_compiler() do - Generator.delete_content("mix.exs", "[:gettext] ++ ") + defp remove_mix_compiler_config() do + Generator.delete_content("mix.exs", "compilers: [:gettext] ++ Mix.compilers(),") end end