26 lines
858 B
Ruby
26 lines
858 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.60/kotlin-compiler-1.2.60.zip"
|
|
sha256 "ff79f695c9be0a500d4b56a69d0b8657b3d106d78a35101e792248af904a623d"
|
|
|
|
bottle :unneeded
|
|
|
|
def install
|
|
libexec.install "bin", "build.txt", "lib"
|
|
rm Dir["#{libexec}/bin/*.bat"]
|
|
bin.install_symlink Dir["#{libexec}/bin/*"]
|
|
prefix.install "license"
|
|
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
|