homebrew-core/Formula/mill.rb

37 lines
1.0 KiB
Ruby

class Mill < Formula
desc "Scala build tool"
homepage "https://com-lihaoyi.github.io/mill/mill/Intro_to_Mill.html"
url "https://github.com/com-lihaoyi/mill/releases/download/0.9.12/0.9.12-assembly"
sha256 "72de12b08b3a12b5a5d976f17ea5f7153394f4af6d4caa3c616bb5413f378932"
license "MIT"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle do
sha256 cellar: :any_skip_relocation, all: "8c2fffecbe427f40314b58e15b2a01c9a65c546dbdca6e7ae6718754f46a414f"
end
depends_on "openjdk"
def install
libexec.install Dir["*"].shift => "mill"
chmod 0555, libexec/"mill"
(bin/"mill").write_env_script libexec/"mill", Language::Java.overridable_java_home_env
end
test do
(testpath/"build.sc").write <<~EOS
import mill._
import mill.scalalib._
object foo extends ScalaModule {
def scalaVersion = "2.12.8"
}
EOS
output = shell_output("#{bin}/mill resolve __.compile")
assert_equal "foo.compile", output.lines.last.chomp
end
end