Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gleam support to Mix #14262

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add fixture for gleam support
  • Loading branch information
Papipo committed Mar 25, 2025
commit 6de56db45e5d6b297318acdeb79692678df7e235
4 changes: 4 additions & 0 deletions lib/mix/test/fixtures/gleam_dep/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.beam
*.ez
/build
erl_crash.dump
20 changes: 20 additions & 0 deletions lib/mix/test/fixtures/gleam_dep/gleam.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name = "gleam_dep"
version = "1.0.0"

# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
#
# description = ""
# licences = ["Apache-2.0"]
# repository = { type = "github", user = "", repo = "" }
# links = [{ title = "Website", href = "" }]
#
# For a full reference of all the available options, you can have a look at
# https://gleam.run/writing-gleam/gleam-toml/.

[dependencies]
gleam_stdlib = ">= 0.44.0 and < 2.0.0"
gleam_otp = ">= 0.16.1 and < 1.0.0"

[dev-dependencies]
gleeunit = ">= 1.0.0 and < 2.0.0"
14 changes: 14 additions & 0 deletions lib/mix/test/fixtures/gleam_dep/manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file was generated by Gleam
# You typically do not need to edit this file

packages = [
{ name = "gleam_erlang", version = "0.34.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "0C38F2A128BAA0CEF17C3000BD2097EB80634E239CE31A86400C4416A5D0FDCC" },
{ name = "gleam_otp", version = "0.16.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "50DA1539FC8E8FA09924EB36A67A2BBB0AD6B27BCDED5A7EF627057CF69D035E" },
{ name = "gleam_stdlib", version = "0.54.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "723BA61A2BAE8D67406E59DD88CEA1B3C3F266FC8D70F64BE9FEC81B4505B927" },
{ name = "gleeunit", version = "1.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "0E6C83834BA65EDCAAF4FE4FB94AC697D9262D83E6F58A750D63C9F6C8A9D9FF" },
]

[requirements]
gleam_otp = { version = ">= 0.16.1 and < 1.0.0" }
gleam_stdlib = { version = ">= 0.44.0 and < 2.0.0" }
gleeunit = { version = ">= 1.0.0 and < 2.0.0" }
3 changes: 3 additions & 0 deletions lib/mix/test/fixtures/gleam_dep/src/gleam_dep.gleam
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn main() {
True
}
9 changes: 9 additions & 0 deletions lib/mix/test/test_helper.exs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,15 @@ Enum.each(fixtures, fn fixture ->
File.cp_r!(source, dest)
end)

## Set up Gleam fixtures

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we should probably skip gleam tests if gleam is not installed, right?

Copy link
Author

@Papipo Papipo Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I guess I need to add gleam to CI (although I need to wait until my gleam PR is merged and released).

fixture = "gleam_dep"

source = MixTest.Case.fixture_path(fixture)
dest = MixTest.Case.tmp_path(fixture)
File.mkdir_p!(dest)
File.cp_r!(source, dest)

## Set up Git fixtures

System.cmd("git", ~w[config --global user.email mix@example.com])
Expand Down