mirror of
https://github.com/engineer-man/piston.git
synced 2025-05-15 16:16:28 +02:00
add piston nix pkg for jvm-kotlin
This commit is contained in:
parent
2d7609f5a2
commit
58a46e3b0a
8 changed files with 40 additions and 36 deletions
39
runtimes/jvm-kotlin.nix
Normal file
39
runtimes/jvm-kotlin.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{pkgs, piston, ...}:
|
||||
let
|
||||
pkg = pkgs.kotlin;
|
||||
jre = pkgs.jre;
|
||||
in piston.mkRuntime {
|
||||
language = "kotlin";
|
||||
version = pkg.version;
|
||||
runtime = "jvm";
|
||||
|
||||
aliases = [
|
||||
"kt"
|
||||
];
|
||||
|
||||
compile = ''
|
||||
rename 's/$/\.kt/' "$@" # Add .kt extension
|
||||
${pkg}/bin/kotlinc *.kt -include-runtime -d code.jar
|
||||
'';
|
||||
|
||||
run = ''
|
||||
shift
|
||||
${jre}/bin/java -jar code.jar "$@"
|
||||
'';
|
||||
|
||||
tests = [
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"test.kt" = ''
|
||||
fun main() {
|
||||
println("OK")
|
||||
}
|
||||
'';
|
||||
};
|
||||
args = [];
|
||||
stdin = "";
|
||||
packages = [];
|
||||
main = "test.kt";
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue