78315f1ddf
Closes #39637. Signed-off-by: FX Coudert <fxcoudert@gmail.com>
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.3.31/kotlin-compiler-1.3.31.zip"
|
|
sha256 "107325d56315af4f59ff28db6837d03c2660088e3efeb7d4e41f3e01bb848d6a"
|
|
|
|
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
|