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.10.11/0.10.11-assembly"
sha256 "078ec2eeca8eaa21daff6902e6593f275a572bad65d4ce6e99529a09f54eedc7"
license "MIT"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle do
sha256 cellar: :any_skip_relocation, all: "3dce0c38f4a4a108a42177f58d7a5dbc94771cd0eb73186346ac3a23958d04df"
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