@@ -78,6 +78,7 @@ tasks {
78
78
79
79
run.configure {
80
80
args = System .getProperty(" args" , " " ).split(" " )
81
+ mustRunAfter(" :server:run" )
81
82
}
82
83
83
84
val bundleDir: File by project
@@ -96,6 +97,7 @@ tasks {
96
97
archiveFileName.set(" player-$gameName -src.zip" )
97
98
}
98
99
100
+ /* * Build a player that times out. */
99
101
val playerTest by creating(Exec ::class ) {
100
102
group = " verification"
101
103
dependsOn(prepareZip)
@@ -108,12 +110,12 @@ tasks {
108
110
}
109
111
val logic = execDir.resolve(" src/main/sc/player/Logic.java" )
110
112
val lines = logic.readLines()
111
- logic.writeText(lines.map {
113
+ logic.writeText(lines.joinToString( System .lineSeparator()) {
112
114
it.replace(
113
115
" // Hier intelligente Strategie zur Auswahl des Zuges einfügen" ,
114
116
" try {Thread.sleep(3000);} catch(InterruptedException e) {throw new RuntimeException(e);}"
115
117
)
116
- }.joinToString( System .lineSeparator()) )
118
+ })
117
119
// required by gradle to distinguish the test build
118
120
execDir.resolve(" settings.gradle" ).createNewFile()
119
121
}
@@ -132,8 +134,10 @@ tasks {
132
134
}
133
135
}
134
136
135
- // Run a player that hits the soft-timeout
137
+ /* * Run a player that hits the soft-timeout. */
138
+ // TODO incorporate into a proper test
136
139
val runTimeout by creating(Exec ::class ) {
140
+ group = " verification"
137
141
dependsOn(playerTest)
138
142
workingDir(playerTest.workingDir)
139
143
commandLine(" java" , " -jar" , workingDir.resolve(" ${game} _client.jar" ))
0 commit comments