homebrew-core/Formula/mill.rb

30 lines
829 B
Ruby

class Mill < Formula
desc "Scala build tool"
homepage "https://com-lihaoyi.github.io/mill/mill/Intro_to_Mill.html"
url "https://github.com/lihaoyi/mill/releases/download/0.9.6/0.9.6"
sha256 "70085c4e648f915e73e6bcae08dae9c72f7fd625afbe68a789562e97d73f0f03"
license "MIT"
bottle :unneeded
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