40 lines
1.3 KiB
Ruby
40 lines
1.3 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.7.20/kotlin-compiler-1.7.20.zip"
|
|
sha256 "5e3c8d0f965410ff12e90d6f8dc5df2fc09fd595a684d514616851ce7e94ae7d"
|
|
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: "ea9a41cf573e763edf09e62a24da0a9df95f4e00abac82c44afa14732443d535"
|
|
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-js", "test.kt", "-output", "test.js"
|
|
system bin/"kotlinc-jvm", "test.kt", "-include-runtime", "-d", "test.jar"
|
|
end
|
|
end
|