From 24578e743b5db1284ba28b02642fd99004b85d34 Mon Sep 17 00:00:00 2001 From: Guanzhong Chen Date: Fri, 11 Oct 2019 11:20:46 -0400 Subject: [PATCH] Add kotlin autoconfig (#551) --- dmoj/executors/KOTLIN.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dmoj/executors/KOTLIN.py b/dmoj/executors/KOTLIN.py index d3e8de43e..e2b78d953 100644 --- a/dmoj/executors/KOTLIN.py +++ b/dmoj/executors/KOTLIN.py @@ -36,3 +36,15 @@ def get_compile_args(self): @classmethod def get_versionable_commands(cls): return [('kotlinc', cls.get_compiler()), ('java', cls.get_vm())] + + @classmethod + def autoconfig(cls): + kotlinc = cls.find_command_from_list(['kotlinc']) + if kotlinc is None: + return None, False, 'Failed to find "kotlinc"' + + java = cls.find_command_from_list(['java']) + if java is None: + return None, False, 'Failed to find "java"' + + return cls.autoconfig_run_test({cls.compiler: kotlinc, cls.vm: cls.unravel_java(java)})