homebrew-core/Formula/cake.rb
2018-06-19 05:23:15 -07:00

38 lines
964 B
Ruby

class Cake < Formula
desc "Cross platform build automation system with a C# DSL"
homepage "https://cakebuild.net/"
url "https://github.com/cake-build/cake/releases/download/v0.28.1/Cake-bin-net461-v0.28.1.zip"
sha256 "537f5b821e05ab947ea6947d547ced7dae51e3f1b34028815fc92f3cfe859f5d"
bottle :unneeded
depends_on "mono" => :recommended
conflicts_with "coffeescript", :because => "both install `cake` binaries"
def install
libexec.install Dir["*.dll"]
libexec.install Dir["*.exe"]
libexec.install Dir["*.xml"]
bin.mkpath
(bin/"cake").write <<~EOS
#!/bin/bash
mono #{libexec}/Cake.exe "$@"
EOS
end
test do
(testpath/"build.cake").write <<~EOS
var target = Argument ("target", "info");
Task("info").Does(() =>
{
Information ("Hello Homebrew");
});
RunTarget ("info");
EOS
assert_match "Hello Homebrew\n", shell_output("#{bin}/cake build.cake")
end
end