class Mill < Formula desc "Scala build tool" homepage "https://www.lihaoyi.com/mill/" url "https://github.com/lihaoyi/mill/releases/download/0.8.0/0.8.0" sha256 "8162160264399d79b6db9f08ab4caca98166ab1319743da18002afeca339ee12" 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", 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