homebrew-core/Formula/kotlin.rb

39 lines
1.2 KiB
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.8.0/kotlin-compiler-1.8.0.zip"
sha256 "0bb9419fac9832a56a3a19cad282f8f2d6f1237d2d467dc8dfe9bd4a2a43c42e"
license "Apache-2.0"
# This repository has thousands of development tags, so the `GithubLatest`
# strategy is used to minimize data transfer in this extreme case.
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 cellar: :any_skip_relocation, all: "3b09590444aa63fb2e429bbd8bd9ba9937cc38f21810364c546eccf29ae1c54d"
end
depends_on "openjdk"
def install
libexec.install "bin", "build.txt", "lib"
rm Dir[libexec/"bin/*.bat"]
bin.install Dir[libexec/"bin/*"]
bin.env_script_all_files libexec/"bin", Language::Java.overridable_java_home_env
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-jvm", "test.kt", "-include-runtime", "-d", "test.jar"
end
end