File tree Expand file tree Collapse file tree 4 files changed +57
-6
lines changed Expand file tree Collapse file tree 4 files changed +57
-6
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ SAMPLE_TEST_JSON = "{}"
19
19
RUNNERS = {
20
20
"py" : (None , ["./runners/py.sh" ]),
21
21
"go" : (["./runners/buildGo.sh" ], None ),
22
+ "kt" : (["./runners/buildKotlin.sh" ], ["./runners/jar.sh" ]),
22
23
}
23
24
24
25
@@ -167,11 +168,11 @@ def get_runner_command(
167
168
print (f"No build or run command specified for runner { file_extension } " )
168
169
raise SystemExit (1 )
169
170
170
- if runner_run is not None and runner_build is not None :
171
- print (
172
- f"Build command and run command specified for { file_extension } - cannot determine path forwards."
173
- )
174
- raise SystemExit (1 )
171
+ # if runner_run is not None and runner_build is not None:
172
+ # print(
173
+ # f"Build command and run command specified for {file_extension} - cannot determine path forwards."
174
+ # )
175
+ # raise SystemExit(1)
175
176
176
177
command = runner_build + [file_name ]
177
178
set_terminal_colour ("grey" )
@@ -182,7 +183,11 @@ def get_runner_command(
182
183
print (f"Failed to build: `{ command } ` returned exit code { exit_code } " )
183
184
raise SystemExit (1 )
184
185
fpstr = fpath .decode ().strip ()
185
- return [fpstr ], lambda : os .unlink (fpstr )
186
+
187
+ if runner_run is None :
188
+ return [fpstr ], lambda : os .unlink (fpstr )
189
+
190
+ return runner_run + [fpstr ], lambda : os .unlink (fpstr )
186
191
187
192
188
193
class CLI (object ):
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ TEMPDIR=" $( mktemp -d) "
6
+ FNAME=$( basename $1 | sed ' s/\.kt$/.jar/' )
7
+ FULLPATH=" $TEMPDIR /$FNAME "
8
+ kotlinc " $1 " -include-runtime -d " $FULLPATH "
9
+ echo $FULLPATH
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ java -jar $@
Original file line number Diff line number Diff line change
1
+ import java.lang.System
2
+ import kotlin.system.*
3
+ import kotlin.sequences.generateSequence
4
+
5
+ fun parse (instr : String ) {
6
+
7
+ }
8
+
9
+ fun one (instr : String ): Int {
10
+ return 0
11
+ }
12
+
13
+ fun two (instr : String ): Int {
14
+ return 0
15
+ }
16
+
17
+ fun main (args : Array <String >) {
18
+ if (args.size < 1 || ! (args[0 ] == " 1" || args[0 ] == " 2" )) {
19
+ debug(" Missing or invalid day argument" )
20
+ exitProcess(1 )
21
+ }
22
+ val inp = generateSequence(::readLine).joinToString(" \n " )
23
+ if (args[0 ] == " 1" ) {
24
+ println (" ${one(inp)} " )
25
+ } else {
26
+ println (" ${two(inp)} " )
27
+ }
28
+ }
29
+
30
+ fun debug (msg : String ) {
31
+ System .err.println (msg)
32
+ }
You can’t perform that action at this time.
0 commit comments