diff --git a/packages/kotlin/1.4.31/build.sh b/packages/kotlin/1.4.31/build.sh index e921dd5..c00cb27 100755 --- a/packages/kotlin/1.4.31/build.sh +++ b/packages/kotlin/1.4.31/build.sh @@ -1,10 +1,13 @@ #!/usr/bin/env bash -source ../../java/15.0.2/build.sh +# 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.4.31/kotlin-compiler-1.4.31.zip" -o kotlin.zip unzip kotlin.zip rm kotlin.zip - cp -r kotlinc/* . rm -rf kotlinc diff --git a/packages/kotlin/1.4.31/compile b/packages/kotlin/1.4.31/compile index 027ade0..9b49562 100644 --- a/packages/kotlin/1.4.31/compile +++ b/packages/kotlin/1.4.31/compile @@ -1,7 +1,6 @@ #!/usr/bin/env bash -# Put instructions to compile source code, remove this file if the language does not require this stage - rename 's/$/\.kt/' "$@" # Add .kt extension -kotlinc *.kt -include-runtime -d code.jar \ No newline at end of file +# Compile Kotlin code to a jar file +kotlinc *.kt -include-runtime -d code.jar diff --git a/packages/kotlin/1.4.31/environment b/packages/kotlin/1.4.31/environment index 780b668..aadd2e5 100644 --- a/packages/kotlin/1.4.31/environment +++ b/packages/kotlin/1.4.31/environment @@ -1,4 +1,4 @@ #!/usr/bin/env bash -# Put 'export' statements here for environment variables +# Add java and kotlinc to path export PATH=$PWD/bin:$PATH diff --git a/packages/kotlin/1.4.31/run b/packages/kotlin/1.4.31/run index d7c9501..e5713a3 100644 --- a/packages/kotlin/1.4.31/run +++ b/packages/kotlin/1.4.31/run @@ -1,4 +1,4 @@ #!/usr/bin/env bash -# Put instructions to run the runtime -java -jar code.jar \ No newline at end of file +# Run jar file +java -jar code.jar diff --git a/packages/kotlin/1.4.31/test.kt b/packages/kotlin/1.4.31/test.kt index 31acf7b..0c9540f 100644 --- a/packages/kotlin/1.4.31/test.kt +++ b/packages/kotlin/1.4.31/test.kt @@ -1,3 +1,3 @@ fun main() { println("OK") -} \ No newline at end of file +}