From a739be3f6c51d7aa58d90738c65e52138e0bcb3f Mon Sep 17 00:00:00 2001 From: RVG|lory <87276663+LoryPelli@users.noreply.github.com> Date: Sat, 8 Apr 2023 17:32:53 +0200 Subject: [PATCH] Updated to `Kotlin 1.8.20` --- packages/kotlin/1.8.20/build.sh | 13 +++++++++++++ packages/kotlin/1.8.20/compile | 6 ++++++ packages/kotlin/1.8.20/environment | 4 ++++ packages/kotlin/1.8.20/metadata.json | 5 +++++ packages/kotlin/1.8.20/run | 5 +++++ packages/kotlin/1.8.20/test.kt | 3 +++ 6 files changed, 36 insertions(+) create mode 100644 packages/kotlin/1.8.20/build.sh create mode 100644 packages/kotlin/1.8.20/compile create mode 100644 packages/kotlin/1.8.20/environment create mode 100644 packages/kotlin/1.8.20/metadata.json create mode 100644 packages/kotlin/1.8.20/run create mode 100644 packages/kotlin/1.8.20/test.kt diff --git a/packages/kotlin/1.8.20/build.sh b/packages/kotlin/1.8.20/build.sh new file mode 100644 index 0000000..2574b8d --- /dev/null +++ b/packages/kotlin/1.8.20/build.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Download and extract JDK8 +curl -L "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jdk_x64_linux_hotspot_8u292b10.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.20/kotlin-compiler-1.8.20.zip" -o kotlin.zip +unzip kotlin.zip +rm kotlin.zip +cp -r kotlinc/* . +rm -rf kotlinc \ No newline at end of file diff --git a/packages/kotlin/1.8.20/compile b/packages/kotlin/1.8.20/compile new file mode 100644 index 0000000..7ef1cff --- /dev/null +++ b/packages/kotlin/1.8.20/compile @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +rename 's/$/\.kt/' "$@" # Add .kt extension + +# Compile Kotlin code to a jar file +kotlinc *.kt -include-runtime -d code.jar \ No newline at end of file diff --git a/packages/kotlin/1.8.20/environment b/packages/kotlin/1.8.20/environment new file mode 100644 index 0000000..9f25b86 --- /dev/null +++ b/packages/kotlin/1.8.20/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Add java and kotlinc to path +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/kotlin/1.8.20/metadata.json b/packages/kotlin/1.8.20/metadata.json new file mode 100644 index 0000000..7a4321e --- /dev/null +++ b/packages/kotlin/1.8.20/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "kotlin", + "version": "1.8.20", + "aliases": ["kt"] +} \ No newline at end of file diff --git a/packages/kotlin/1.8.20/run b/packages/kotlin/1.8.20/run new file mode 100644 index 0000000..a719220 --- /dev/null +++ b/packages/kotlin/1.8.20/run @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Run jar file +shift +java -jar code.jar "$@" \ No newline at end of file diff --git a/packages/kotlin/1.8.20/test.kt b/packages/kotlin/1.8.20/test.kt new file mode 100644 index 0000000..31acf7b --- /dev/null +++ b/packages/kotlin/1.8.20/test.kt @@ -0,0 +1,3 @@ +fun main() { + println("OK") +} \ No newline at end of file