format
This commit is contained in:
parent
00a8f996f4
commit
3e6d73b553
3 changed files with 25 additions and 22 deletions
|
|
@ -1,8 +1,9 @@
|
||||||
defmodule Mix.Tasks.GleamCompile do
|
defmodule Mix.Tasks.GleamCompile do
|
||||||
use Mix.Task
|
|
||||||
|
|
||||||
@shortdoc "Compiles Gleam files and copies them to the correct location"
|
@shortdoc "Compiles Gleam files and copies them to the correct location"
|
||||||
|
|
||||||
|
@moduledoc false
|
||||||
|
use Mix.Task
|
||||||
|
|
||||||
def run(_args) do
|
def run(_args) do
|
||||||
env = Mix.env()
|
env = Mix.env()
|
||||||
|
|
||||||
|
|
@ -49,6 +50,7 @@ defmodule Mix.Tasks.GleamCompile do
|
||||||
|
|
||||||
# First, check if compile.gleam already created the aprsme@encoding.beam
|
# First, check if compile.gleam already created the aprsme@encoding.beam
|
||||||
dev_ebin = "_build/dev/lib/aprsme/ebin"
|
dev_ebin = "_build/dev/lib/aprsme/ebin"
|
||||||
|
|
||||||
if File.exists?(Path.join(dev_ebin, "aprsme@encoding.beam")) do
|
if File.exists?(Path.join(dev_ebin, "aprsme@encoding.beam")) do
|
||||||
Mix.shell().info("Found pre-compiled aprsme@encoding.beam")
|
Mix.shell().info("Found pre-compiled aprsme@encoding.beam")
|
||||||
src = Path.join(dev_ebin, "aprsme@encoding.beam")
|
src = Path.join(dev_ebin, "aprsme@encoding.beam")
|
||||||
|
|
@ -59,9 +61,11 @@ defmodule Mix.Tasks.GleamCompile do
|
||||||
|
|
||||||
if File.exists?(gleam_output) do
|
if File.exists?(gleam_output) do
|
||||||
Mix.shell().info("Checking #{gleam_output} for beam files...")
|
Mix.shell().info("Checking #{gleam_output} for beam files...")
|
||||||
beam_files = gleam_output
|
|
||||||
|> File.ls!()
|
beam_files =
|
||||||
|> Enum.filter(&String.ends_with?(&1, ".beam"))
|
gleam_output
|
||||||
|
|> File.ls!()
|
||||||
|
|> Enum.filter(&String.ends_with?(&1, ".beam"))
|
||||||
|
|
||||||
Mix.shell().info("Found #{length(beam_files)} beam files")
|
Mix.shell().info("Found #{length(beam_files)} beam files")
|
||||||
|
|
||||||
|
|
|
||||||
1
mix.exs
1
mix.exs
|
|
@ -142,5 +142,4 @@ defmodule Aprsme.MixProject do
|
||||||
# {:aprs, github: "aprsme/aprs", branch: "main"}
|
# {:aprs, github: "aprsme/aprs", branch: "main"}
|
||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue