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.10/kotlin-compiler-1.3.10.zip"
|
|
sha256 "ca79c93151e14e34ff49cfb56ec4c0fe83e1383143b1469af8cdc4f62fb8c67d"
|
|
|
|
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
|