Add Kotlin support
This commit is contained in:
parent
b750de1f5e
commit
c36c5a6e63
|
@ -73,6 +73,7 @@ func Execute(res http.ResponseWriter, req *http.Request) {
|
||||||
"go",
|
"go",
|
||||||
"java",
|
"java",
|
||||||
"julia", "jl",
|
"julia", "jl",
|
||||||
|
"kotlin",
|
||||||
"nasm", "asm",
|
"nasm", "asm",
|
||||||
"node", "javascript", "js",
|
"node", "javascript", "js",
|
||||||
"php",
|
"php",
|
||||||
|
|
|
@ -66,6 +66,9 @@ case "$lang" in
|
||||||
"julia" | "jl")
|
"julia" | "jl")
|
||||||
bin=julia
|
bin=julia
|
||||||
;;
|
;;
|
||||||
|
"kotlin")
|
||||||
|
bin=kotlin
|
||||||
|
;;
|
||||||
"nasm" | "asm")
|
"nasm" | "asm")
|
||||||
bin=nasm
|
bin=nasm
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
cd /tmp/$2
|
||||||
|
cp code.code code.kt
|
||||||
|
timeout -s KILL 10 kotlinc code.kt -include-runtime -d code.jar
|
||||||
|
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 java -jar code.jar"
|
|
@ -24,6 +24,9 @@ echo '---'
|
||||||
echo 'julia'
|
echo 'julia'
|
||||||
lxc-attach --clear-env -n piston -- /bin/bash -l -c "julia --version"
|
lxc-attach --clear-env -n piston -- /bin/bash -l -c "julia --version"
|
||||||
echo '---'
|
echo '---'
|
||||||
|
echo 'kotlin'
|
||||||
|
lxc-attach --clear-env -n piston -- /bin/bash -l -c "kotlinc -version"
|
||||||
|
echo '---'
|
||||||
echo 'nasm'
|
echo 'nasm'
|
||||||
lxc-attach --clear-env -n piston -- /bin/bash -l -c "nasm -version"
|
lxc-attach --clear-env -n piston -- /bin/bash -l -c "nasm -version"
|
||||||
echo '---'
|
echo '---'
|
||||||
|
|
|
@ -145,6 +145,14 @@ tar -xzf julia-1.4.1-linux-x86_64.tar.gz
|
||||||
echo 'export PATH=$PATH:/opt/julia/julia-1.4.1/bin' >> /opt/.profile
|
echo 'export PATH=$PATH:/opt/julia/julia-1.4.1/bin' >> /opt/.profile
|
||||||
source /opt/.profile
|
source /opt/.profile
|
||||||
|
|
||||||
|
#install kotlin
|
||||||
|
#final binary: /opt/kotlinc/bin/kotlinc
|
||||||
|
cd /opt
|
||||||
|
wget https://github.com/JetBrains/kotlin/releases/download/v1.3.72/kotlin-compiler-1.3.72.zip
|
||||||
|
unzip kotlin-compiler-1.3.72.zip
|
||||||
|
rm kotlin-compiler-1.3.72.zip
|
||||||
|
echo 'export PATH=$PATH:/opt/kotlinc/bin' >> /opt/.profile
|
||||||
|
source /opt/.profile
|
||||||
|
|
||||||
# create runnable users and apply limits
|
# create runnable users and apply limits
|
||||||
for i in {1..150}; do
|
for i in {1..150}; do
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
println("good")
|
||||||
|
}
|
|
@ -12,6 +12,8 @@ echo 'testing go'
|
||||||
../lxc/execute go test.go
|
../lxc/execute go test.go
|
||||||
echo 'testing java'
|
echo 'testing java'
|
||||||
../lxc/execute java test.java
|
../lxc/execute java test.java
|
||||||
|
echo 'testing kotlin'
|
||||||
|
../lxc/execute kotlin test.kt
|
||||||
echo 'testing asm'
|
echo 'testing asm'
|
||||||
../lxc/execute asm test.nasm
|
../lxc/execute asm test.nasm
|
||||||
echo 'testing js'
|
echo 'testing js'
|
||||||
|
|
Loading…
Reference in New Issue