File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,14 @@ tasks {
104
104
from(prepareZip)
105
105
into(execDir)
106
106
}
107
+ val logic = execDir.resolve(" src/main/sc/player/Logic.java" )
108
+ val lines = logic.readLines()
109
+ logic.writeText(lines.map {
110
+ it.replace(
111
+ " // Hier intelligente Strategie zur Auswahl des Zuges einfügen" ,
112
+ " try {Thread.sleep(3000);} catch(InterruptedException e) {throw new RuntimeException(e);}"
113
+ )
114
+ }.joinToString(System .lineSeparator()))
107
115
// required by gradle to distinguish the test build
108
116
execDir.resolve(" settings.gradle" ).createNewFile()
109
117
}
@@ -122,4 +130,11 @@ tasks {
122
130
}
123
131
}
124
132
133
+ // Run a player that hits the soft-timeout
134
+ val runTimeout by creating(Exec ::class ) {
135
+ dependsOn(playerTest)
136
+ workingDir(playerTest.workingDir)
137
+ commandLine(" java" , " -jar" , workingDir.resolve(" ${game} _client.jar" ))
138
+ }
139
+
125
140
}
You can’t perform that action at this time.
0 commit comments