homebrew-core/Formula/kotlin.rb
2018-04-19 23:43:36 -07:00

25 lines
829 B
Ruby

class Kotlin < Formula
desc "Statically typed programming language for the JVM"
homepage "https://kotlinlang.org/"
url "https://github.com/JetBrains/kotlin/releases/download/v1.2.40/kotlin-compiler-1.2.40.zip"
sha256 "3498571126c335be0feec24075c359f1954d46bbabccafc729ec49db1a509658"
bottle :unneeded
def install
libexec.install "bin", "build.txt", "lib"
rm Dir["#{libexec}/bin/*.bat"]
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
(testpath/"test.kt").write <<~EOS
fun main(args: Array<String>) {
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