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

cargo-dist 0.27.0 (new formula) #202435

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .github/autobump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ cargo-chef
cargo-crev
cargo-deny
cargo-depgraph
cargo-dist
cargo-generate
cargo-instruments
cargo-llvm-cov
Expand Down
34 changes: 34 additions & 0 deletions Formula/c/cargo-dist.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
class CargoDist < Formula
desc "Tool for building final distributable artifacts and uploading them to an archive"
homepage "https://opensource.axo.dev/cargo-dist/"
url "https://github.com/axodotdev/cargo-dist/archive/refs/tags/v0.27.0.tar.gz"
sha256 "d673c270c9da1e57a294c45ff18a1adee1b7739e05450e0062a243de8283d041"
license any_of: ["Apache-2.0", "MIT"]
head "https://github.com/axodotdev/cargo-dist.git", branch: "main"

depends_on "rust" => :build
depends_on "rustup" => :test

def install
system "cargo", "install", *std_cargo_args(path: "cargo-dist")
end

test do
# Show that we can use a different toolchain than the one provided by the `rust` formula.
# https://github.com/Homebrew/homebrew-core/pull/134074#pullrequestreview-1484979359
ENV.prepend_path "PATH", Formula["rustup"].bin
system "rustup", "default", "beta"
system "rustup", "set", "profile", "minimal"

assert_match version.to_s, shell_output("#{bin}/dist --version")

system "cargo", "new", "--bin", "test_project"
cd "test_project" do
output = shell_output("#{bin}/dist init 2>&1", 255)
assert_match "added [profile.dist] to your workspace Cargo.toml", output

output = shell_output("#{bin}/dist plan 2>&1", 255)
assert_match "You specified --artifacts, disabling host mode, but specified no targets to build", output
end
end
end
Loading