homebrew-core/Formula/mill.rb

30 lines
819 B
Ruby

class Mill < Formula
desc "Scala build tool"
homepage "https://www.lihaoyi.com/mill/"
url "https://github.com/lihaoyi/mill/releases/download/0.6.0/0.6.0"
sha256 "499f73887128a85ec5ff904f7c6e009354ef49148ac0d4307ea03431d7d8be5d"
revision 1
bottle :unneeded
depends_on "openjdk"
def install
libexec.install Dir["*"].shift => "mill"
chmod 0555, libexec/"mill"
(bin/"mill").write_env_script libexec/"mill", :JAVA_HOME => "${JAVA_HOME:-#{Formula["openjdk"].opt_prefix}}"
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