pkg(kotlin-1.8.0): Added Kotlin 1.8.0

This commit is contained in:
zt64 2023-01-15 00:02:30 -05:00
parent 17c4fdb51e
commit fe3a636b0a
6 changed files with 36 additions and 0 deletions

13
packages/kotlin/1.8.0/build.sh vendored Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Download and extract JDK11
curl -L "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.17%2B8/OpenJDK11U-jdk_x64_linux_hotspot_11.0.17_8.tar.gz" -o jdk.tar.gz
tar xzf jdk.tar.gz --strip-components=1
rm jdk.tar.gz
# Download and extract Kotlin
curl -L "https://github.com/JetBrains/kotlin/releases/download/v1.8.0/kotlin-compiler-1.8.0.zip" -o kotlin.zip
unzip kotlin.zip
rm kotlin.zip
cp -r kotlinc/* .
rm -rf kotlinc

6
packages/kotlin/1.8.0/compile vendored Normal file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
rename 's/$/\.kt/' "$@" # Add .kt extension
# Compile Kotlin code to a jar file
kotlinc *.kt -d code.jar

4
packages/kotlin/1.8.0/environment vendored Normal file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Add java and kotlinc to path
export PATH=$PWD/bin:$PATH

5
packages/kotlin/1.8.0/metadata.json vendored Normal file
View file

@ -0,0 +1,5 @@
{
"language": "kotlin",
"version": "1.8.0",
"aliases": ["kt"]
}

5
packages/kotlin/1.8.0/run vendored Normal file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Run jar file
shift
java -jar code.jar "$@"

3
packages/kotlin/1.8.0/test.kt vendored Normal file
View file

@ -0,0 +1,3 @@
fun main() {
println("OK")
}