Skip to content

Commit d27c1bc

Browse files
committed
chore(gradle): do not generate documentation upon check
1 parent 3c3a0bc commit d27c1bc

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

gradle/build.gradle.kts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ tasks {
116116

117117
val testGame by creating {
118118
group = "verification"
119-
dependsOn(":server:deploy", ":player:deploy")
119+
dependsOn(":server:deploy", ":player:deployJar")
120120
doFirst {
121121
val testGameDir = testingDir.resolve("game")
122122
testGameDir.deleteRecursively()
@@ -300,10 +300,8 @@ allprojects {
300300
afterEvaluate {
301301
doAfterEvaluate.forEach { action -> action(this) }
302302
tasks {
303-
forEach { if (it.name != clean.name) it.mustRunAfter(clean.get()) }
304-
test {
305-
testLogging { showStandardStreams = project.properties["verbose"] != null }
306-
}
303+
forEach { if (!it.name.endsWith("clean", true)) it.mustRunAfter(clean.get()) }
304+
test { testLogging { showStandardStreams = project.properties["verbose"] != null } }
307305
withType<Jar> {
308306
if (plugins.hasPlugin(ApplicationPlugin::class))
309307
manifest.attributes["Main-Class"] = project.extensions.getByType<JavaApplication>().mainClass.get()
@@ -312,8 +310,6 @@ allprojects {
312310
}
313311
}
314312

315-
// == Utilities ==
316-
317313
fun Task.dependOnSubprojects() {
318314
if (this.project == rootProject)
319315
doAfterEvaluate.add {

player/build.gradle.kts

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ tasks {
3232
archiveFileName.set("defaultplayer.jar")
3333
}
3434

35+
val copyDocs by creating(Copy::class) {
36+
dependsOn(":sdk:doc", ":plugin:doc")
37+
into(buildDir.resolve("zip"))
38+
with(copySpec {
39+
from(project(":plugin").buildDir.resolve("doc"))
40+
into("doc/plugin-$gameName")
41+
}, copySpec {
42+
from(project(":sdk").buildDir.resolve("doc"))
43+
into("doc/sdk")
44+
})
45+
}
46+
3547
val prepareZip by creating(Copy::class) {
3648
group = "distribution"
3749
into(buildDir.resolve("zip"))
@@ -53,28 +65,20 @@ tasks {
5365
from(configurations.default, arrayOf("sdk", "plugin").map { project(":$it").getTasksByName("sourcesJar", false).single().outputs.files })
5466
into("lib")
5567
})
56-
if(!project.hasProperty("nodoc")) {
57-
dependsOn(":sdk:doc", ":plugin:doc")
58-
with(copySpec {
59-
from(project(":plugin").buildDir.resolve("doc"))
60-
into("doc/plugin-$gameName")
61-
}, copySpec {
62-
from(project(":sdk").buildDir.resolve("doc"))
63-
into("doc/sdk")
64-
})
65-
}
68+
}
69+
70+
val deployJar by creating(Copy::class) {
71+
from(shadowJar)
72+
into(deployDir)
73+
rename { project.property("deployedPlayer") as String }
6674
}
6775

6876
val deploy by creating(Zip::class) {
6977
group = "distribution"
70-
dependsOn(shadowJar, prepareZip)
78+
dependsOn(deployJar)
79+
from(prepareZip, copyDocs)
7180
destinationDirectory.set(deployDir)
7281
archiveFileName.set("simpleclient-$gameName-src.zip")
73-
from(prepareZip.destinationDir)
74-
doFirst {
75-
shadowJar.get().outputs.files.singleFile.copyTo(
76-
deployDir.resolve(project.property("deployedPlayer") as String), true)
77-
}
7882
}
7983

8084
run.configure {

0 commit comments

Comments
 (0)