Skip to content

Commit 5c28e1e

Browse files
Rodrigo ÁlvarezPapipo
Rodrigo Álvarez
authored andcommitted
Add support for git dependencies in gleam packages
1 parent 5a0c8ab commit 5c28e1e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lib/mix/lib/mix/gleam.ex

+11-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,17 @@ defmodule Mix.Gleam do
3636

3737
spec =
3838
case requirement do
39-
%{"version" => version} -> {dep, version, opts}
40-
%{"path" => path} -> {dep, Keyword.merge(opts, path: path)}
39+
%{"version" => version} ->
40+
{dep, version, opts}
41+
42+
%{"path" => path} ->
43+
{dep, Keyword.merge(opts, path: path)}
44+
45+
%{"git" => git, "ref" => ref} ->
46+
{dep, git: git, ref: ref}
47+
48+
_ ->
49+
Mix.raise("Gleam package #{dep} has unsupported requirement: #{inspect(requirement)}")
4150
end
4251

4352
case spec do

lib/mix/test/mix/gleam_test.exs

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ defmodule Mix.GleamTest do
4444
"version" => "1.0.0",
4545
"gleam" => ">= 1.8.0",
4646
"dependencies" => %{
47+
"git_dep" => %{"git" => "../git_dep", "ref" => "957b83b"},
4748
"gleam_stdlib" => %{"version" => ">= 0.18.0 and < 2.0.0"},
4849
"my_other_project" => %{"path" => "../my_other_project"}
4950
},
@@ -56,6 +57,7 @@ defmodule Mix.GleamTest do
5657
version: "1.0.0",
5758
gleam: ">= 1.8.0",
5859
deps: [
60+
{:git_dep, git: "../git_dep", ref: "957b83b"},
5961
{:gleam_stdlib, ">= 0.18.0 and < 2.0.0"},
6062
{:my_other_project, path: "../my_other_project"},
6163
{:gleeunit, ">= 1.0.0 and < 2.0.0", only: :dev}

0 commit comments

Comments
 (0)