@@ -23,22 +23,22 @@ println("Current version: $version Game: $game")
23
23
val deployDir by extra { buildDir.resolve(" deploy" ) }
24
24
val deployedPlayer by extra { " simpleclient-$gameName -$version .jar" }
25
25
val testLogDir by extra { buildDir.resolve(" tests" ) }
26
+ val documentedProjects = arrayOf(" sdk" , " plugin" )
26
27
27
28
subprojects {
28
29
apply (plugin = " java-library" )
29
30
apply (plugin = " kotlin" )
30
31
}
31
32
32
33
val doAfterEvaluate = ArrayList < (Project ) -> Unit > ()
33
- val mainGroup = " _main"
34
34
tasks {
35
35
val startServer by creating {
36
36
dependsOn(" :server:run" )
37
- group = mainGroup
37
+ group = " application "
38
38
}
39
39
40
40
val doc by creating(DokkaTask ::class ) {
41
- val includedProjects = arrayOf( " sdk " , " plugin " )
41
+ val includedProjects = documentedProjects
42
42
mustRunAfter(includedProjects.map { " $it :classes" })
43
43
moduleName = " Software-Challenge API $version "
44
44
val sourceSets = includedProjects.map { project(it).sourceSets.main.get() }
@@ -55,14 +55,15 @@ tasks {
55
55
val deploy by creating {
56
56
dependsOn(doc)
57
57
dependOnSubprojects()
58
- group = mainGroup
58
+ group = " distribution "
59
59
description = " Zips everything up for release into build/deploy/"
60
+ outputs.dir(deployDir)
60
61
}
61
62
62
63
val release by creating {
63
64
dependsOn(deploy)
64
- group = mainGroup
65
- description = " Prepares a new Release by bumping the version and creating a commit and a git tag"
65
+ group = " distribution "
66
+ description = " Prepares a new Release by bumping the version and creating a commit with a git tag of the new version "
66
67
doLast {
67
68
fun edit (original : String , version : String , new : Int ) =
68
69
if (original.startsWith(" socha.version.$version " ))
@@ -104,6 +105,7 @@ tasks {
104
105
}
105
106
106
107
val testGame by creating {
108
+ group = " verification"
107
109
dependsOn(clearTestLogs, " :server:deploy" , " :player:deploy" )
108
110
doFirst {
109
111
testLogDir.mkdirs()
@@ -163,8 +165,9 @@ tasks {
163
165
}
164
166
165
167
val testTestClient by creating {
168
+ group = " verification"
166
169
dependsOn(clearTestLogs, " :server:deploy" )
167
- mustRunAfter (testGame)
170
+ shouldRunAfter (testGame)
168
171
val testClientGames = 3
169
172
doFirst {
170
173
val tmpDir = buildDir.resolve(" tmp" )
@@ -177,7 +180,7 @@ tasks {
177
180
println (" Testing TestClient..." )
178
181
val testClient = ProcessBuilder (
179
182
project(" test-client" ).tasks.getByName<ScriptsTask >(" createScripts" ).content.split(" " ) +
180
- listOf (" --start-server" , " --tests" , " $ testClientGames" ))
183
+ listOf (" --start-server" , " --tests" , testClientGames.toString(), " --port " , " 13055 " ))
181
184
.redirectOutput(testLogDir.resolve(" test-client.log" )).redirectError(testLogDir.resolve(" test-client-err.log" ))
182
185
.directory(unzipped).start()
183
186
if (testClient.waitFor(maxGameLength * testClientGames, TimeUnit .SECONDS )) {
@@ -193,26 +196,22 @@ tasks {
193
196
}
194
197
195
198
val integrationTest by creating {
196
- group = mainGroup
199
+ group = " verification "
197
200
dependsOn(testGame, testTestClient)
198
201
shouldRunAfter(test)
199
202
}
200
203
201
204
clean {
202
- group = mainGroup
203
205
dependOnSubprojects()
204
206
}
205
207
test {
206
- group = mainGroup
207
208
dependOnSubprojects()
208
209
}
209
210
check {
210
- group = mainGroup
211
- if (! hasProperty(" nointegration" ) && versionObject.minor > 0 )
211
+ if (! project.hasProperty(" nointegration" ) && versionObject.minor > 0 )
212
212
dependsOn(integrationTest)
213
213
}
214
214
build {
215
- group = mainGroup
216
215
dependsOn(deploy)
217
216
}
218
217
}
@@ -228,7 +227,7 @@ allprojects {
228
227
jcenter()
229
228
maven(" http://dist.wso2.org/maven2" )
230
229
}
231
- if (this .name in arrayOf( " sdk " , " plugin " ) ) {
230
+ if (this .name in documentedProjects ) {
232
231
apply (plugin = " maven" )
233
232
tasks {
234
233
val doc by creating(DokkaTask ::class ) {
0 commit comments