Skip to content

Commit

Permalink
Add Kotlin 2.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
halabooda committed Feb 18, 2025
1 parent a232bf4 commit c8bc044
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ But created for more extensible
<details><summary>Languages (updating...)</summary>
<div>
<p>πŸ”₯πŸ”₯πŸ”₯ PostgresQL</p>
<p>Bash</p>
<p>PHP 8.3</p>
<p>PHP 8.4</p>
<p>Python 3.12</p>
Expand All @@ -46,6 +47,9 @@ But created for more extensible
<p>C++17</p>
<p>C++14</p>
<p>C++11</p>
<p>Ruby 2.7</p>
<p>Ruby 3.3</p>
<p>Kotlin 2.1.10</p>
<p>Golang 1.23.6</p>
<p>Golang 1.24.0</p>
<p>Rust 1.84</p>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions sandbox/dockerfiles/kotlin_2_1_10/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM openjdk:8-jdk-alpine

RUN apk add --no-cache bash

RUN apk add --no-cache curl unzip && \
curl -LO "https://github.com/JetBrains/kotlin/releases/download/v2.1.10/kotlin-compiler-2.1.10.zip" && \
unzip kotlin-compiler-2.1.10.zip -d /usr/local && \
ln -s /usr/local/kotlin-compiler-2.1.10/bin/kotlinc /usr/local/bin/kotlinc && \
ln -s /usr/local/kotlin-compiler-2.1.10/bin/kotlin /usr/local/bin/kotlin && \
rm kotlin-compiler-2.1.10.zip

RUN mkdir -p /app
WORKDIR /app

ENV PATH=$PATH:/usr/local/kotlinc/bin

26 changes: 26 additions & 0 deletions sandbox/dockerfiles/kotlin_2_1_10/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"Template": "kotlin_2_1_10",
"Labels": ["kotlin"],
"Enabled": true,
"Connections": ["postgres"],
"ContainerOptions": {
"CompileTTL": 30,
"RunTTL": 5,
"MemoryLimit": 524288000
},
"Workdir": "/app",
"IsSupportPackage": true,

"Actions": {
"default": {
"Id": "default",
"IsDefault": true,
"Name": "Kotlin (2.1.10)",
"CompileCmd": "kotlinc *.kt -include-runtime -d app.jar",
"RunCmd": "java -jar app.jar {ARGS} < {STDIN}",
"ScriptOptions": {
"SourceFile": "Main.kt"
}
}
}
}
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions sandbox/dockerfiles/run_kotlin.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Kotlin 2.1.10
POST {{url}}/run
Content-Type: application/json

{
"templateId": "kotlin_2_1_10",
"files": {
"Main.kt": "abstract class Person(val name: String) {\n abstract fun greet()\n}\n\ninterface FoodConsumer {\n fun eat()\n fun pay(amount: Int) = println(\"Delicious! Here's $amount bucks!\")\n}\n\nclass RestaurantCustomer(name: String, val dish: String) : Person(name), FoodConsumer {\n fun order() = println(\"$dish, please!\")\n override fun eat() = println(\"*Eats $dish*\")\n override fun greet() = println(\"It's me, $name.\")\n}\n\nfun main() {\n val sam = RestaurantCustomer(\"Sam\", \"Mixed salad\")\n sam.greet() // An implementation of an abstract function\n sam.order() // A member function\n sam.eat() // An implementation of an interface function\n sam.pay(10) // A default implementation in an interface\n}\n"
},
"args": "--name Mark",
"stdin": "100.00",
"externalOptions": {
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c8bc044

Please sign in to comment.