homebrew-core/Formula/kotlin.rb
2017-08-20 11:23:13 -07:00

25 lines
824 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.1.4-2/kotlin-compiler-1.1.4-2.zip"
sha256 "9b8957cc8fc5845c4e97beec05e4eaa952a26545022f16c158c4f65e269f5127"
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<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