homebrew-core/Formula/gitversion.rb

30 lines
924 B
Ruby
Raw Normal View History

2016-06-01 12:32:09 +00:00
class Gitversion < Formula
desc "Easy semantic versioning for projects using Git"
homepage "https://github.com/GitTools/GitVersion"
2016-09-05 19:58:12 +00:00
url "https://github.com/GitTools/GitVersion/releases/download/v3.6.4/GitVersion_3.6.4.zip"
sha256 "e2cea2d3949a5128e5b924d1f65bd09eebc71e019932f9e2632eb11fe7c0b643"
2016-06-01 12:32:09 +00:00
bottle :unneeded
depends_on "mono" => :recommended
def install
libexec.install Dir["*"]
(bin/"gitversion").write <<-EOS.undent
#!/bin/sh
2016-09-05 19:58:12 +00:00
exec "mono" "#{libexec}/GitVersion.exe" "$@"
2016-06-01 12:32:09 +00:00
EOS
end
test do
# Circumvent GitVersion's build server detection scheme:
ENV["JENKINS_URL"] = nil
(testpath/"test.txt").write("test")
system "git", "init"
system "git", "add", "test.txt"
system "git", "commit", "-q", "--author='Test <test@example.com>'", "--message='Test'"
2016-08-10 13:00:38 +00:00
assert_match '"FullSemVer":"0.1.0+0"', shell_output("#{bin}/gitversion -output json")
2016-06-01 12:32:09 +00:00
end
end