piston/runtimes/openjdk-java.nix

34 lines
750 B
Nix
Raw Normal View History

2022-02-11 18:45:31 +01:00
{pkgs, piston, ...}:
let
pkg = pkgs.openjdk;
in piston.mkRuntime {
language = "java";
version = pkg.version;
runtime = "openjdk";
aliases = [];
run = ''
mv $1 $1.java
filename=$1.java
shift
${pkg}/bin/java $filename "$@"
'';
tests = [
(piston.mkTest {
files = {
"test.java" = ''
public class PrinOK {
public static void main(String[] args) {
System.out.println("OK");
}
}
'';
};
args = [];
stdin = "";
packages = [];
main = "test.java";
})
];
}