Skip to content

Commit a08ef98

Browse files
committed
Add support for git dependencies in gleam packages
1 parent cb236e7 commit a08ef98

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
@@ -38,8 +38,17 @@ defmodule Mix.Gleam do
3838

3939
spec =
4040
case requirement do
41-
%{"version" => version} -> {dep, version, opts}
42-
%{"path" => path} -> {dep, Keyword.merge(opts, path: path)}
41+
%{"version" => version} ->
42+
{dep, version, opts}
43+
44+
%{"path" => path} ->
45+
{dep, Keyword.merge(opts, path: path)}
46+
47+
%{"git" => git, "ref" => ref} ->
48+
{dep, git: git, ref: ref}
49+
50+
_ ->
51+
Mix.raise("Gleam package #{dep} has unsupported requirement: #{inspect(requirement)}")
4352
end
4453

4554
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)