class KotlinCompiler < Formula desc "Statically typed programming language for the JVM" homepage "https://kotlinlang.org/" url "https://github.com/JetBrains/kotlin/releases/download/build-1.0.0-beta-3595/kotlin-compiler-1.0.0-beta-3595.zip" version "1.0.0-beta-3595" sha256 "1ed750a169a411349852a102d5a9c23aec656acb76d51018a4933741eb846fae" bottle :unneeded def install libexec.install %w[bin lib] rm Dir["#{libexec}/bin/*.bat"] bin.install_symlink Dir["#{libexec}/bin/*"] end test do (testpath/"test.kt").write <<-EOS.undent fun main(args: Array) { println("Hello World!") } EOS system "#{bin}/kotlinc", "test.kt", "-include-runtime", "-d", "test.jar" system "#{bin}/kotlinc-js", "test.kt", "-output", "test.js" system "#{bin}/kotlinc-jvm", "test.kt", "-include-runtime", "-d", "test.jar" end end