Skip to content

Commit ef7a61c

Browse files
committed
chore: rename task deploy to bundle
1 parent 9c68e8f commit ef7a61c

File tree

7 files changed

+31
-72
lines changed

7 files changed

+31
-72
lines changed

.dev/scopes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ contributing
55
git
66
gradle
77
ci
8-
deploy
8+
bundle
99

1010
# Modules
1111
testclient

.github/workflows/gradle.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ jobs:
2525
run: chmod +x gradlew
2626
- name: Execute tests
2727
run: ./gradlew check || (exitcode=$?; find build/tests -name '*.log' -type f | while read f; do echo -e "\033[4m$f\033[0m"; cat $f; done && return $exitcode)
28-
- name: Build deployment artifacts
29-
run: ./gradlew deploy
30-
- name: Upload jars as artifact
28+
- name: Bundle Artifacts
29+
run: ./gradlew bundle
30+
- name: Upload Artifacts
3131
uses: actions/upload-artifact@v4
3232
with:
3333
name: software-challenge-backend-${{ github.sha }}
3434
path: |
35-
build/deploy/*.zip
36-
build/deploy/*.jar
35+
build/bundle/*.zip
36+
build/bundle/*.jar
3737
release:
3838
needs: build
3939
runs-on: ubuntu-latest

.travis.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Die wichtigsten Tasks:
4343
| Task | Beschreibung
4444
| ---- | ------------
4545
| `build` | Kompiliert, packt und testet alles
46-
| `deploy` | Erstellt hochladbare ZIP-Pakete
46+
| `bundle` | Erstellt hochladbare ZIP-Pakete
4747
| `check` | Führt alle Tests aus
4848
| `test` | Führt Unittests aus
4949
| `integrationTest` | Testet ein komplettes Spiel sowie den TestClient

gradle/build.gradle.kts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ version = versionObject.toString() + property("socha.version.suffix").toString()
2323
val year by extra { "20${versionObject.major}" }
2424
val game by extra { "${gameName}_$year" }
2525

26-
val deployDir by extra { buildDir.resolve("deploy") }
27-
val deployedPlayer by extra { "randomplayer-$gameName-$version.jar" }
26+
val bundleDir by extra { buildDir.resolve("bundle") }
27+
val bundledPlayer by extra { "randomplayer-$gameName-$version.jar" }
2828
val testingDir by extra { buildDir.resolve("tests") }
2929
val documentedProjects = listOf("sdk", "plugin$year")
3030

@@ -48,7 +48,7 @@ tasks {
4848
val doc by creating(DokkaTask::class) {
4949
dependsOn(documentedProjects.map { ":$it:classes" })
5050
group = "documentation"
51-
outputDirectory = deployDir.resolve("doc").toString()
51+
outputDirectory = bundleDir.resolve("doc").toString()
5252
outputFormat = "javadoc"
5353
subProjects = documentedProjects
5454
configuration {
@@ -58,12 +58,12 @@ tasks {
5858
}
5959
}
6060

61-
val deploy by creating {
61+
val bundle by creating {
6262
dependsOn(doc)
6363
dependOnSubprojects()
6464
group = "distribution"
65-
description = "Zips everything up for release into ${deployDir.relativeTo(projectDir)}"
66-
outputs.dir(deployDir)
65+
description = "Zips everything up for release into ${bundleDir.relativeTo(projectDir)}"
66+
outputs.dir(bundleDir)
6767
}
6868

6969
val release by creating {
@@ -111,14 +111,14 @@ tasks {
111111
dependOnSubprojects()
112112
}
113113
build {
114-
dependsOn(deploy)
114+
dependsOn(bundle)
115115
}
116116

117117
// TODO create a global constant which can be shared with testclient & co - maybe a resource?
118118
val maxGameLength = 150L // 2m30s
119119

120120
val testGame by creating {
121-
dependsOn(":server:deploy", ":player:deployShadow")
121+
dependsOn(":server:bundle", ":player:bundleShadow")
122122
group = "verification"
123123
doFirst {
124124
val testGameDir = testingDir.resolve("game")
@@ -145,7 +145,7 @@ tasks {
145145
val startClient: (Int) -> Process = {
146146
Thread.sleep(300)
147147
ProcessBuilder(
148-
java, "-jar", deployDir.resolve(deployedPlayer).absolutePath,
148+
java, "-jar", bundleDir.resolve(bundledPlayer).absolutePath,
149149
"--port", port
150150
).redirectOutput(testGameDir.resolve("client$it.log")).redirectError(testGameDir.resolve("client$it-err.log")).start()
151151
}
@@ -190,20 +190,20 @@ tasks {
190190
server.destroy()
191191
}
192192
thread.interrupt()
193-
println("Successfully played a game using the deployed server & client!")
193+
println("Successfully played a game using the bundled server & client!")
194194
}
195195
}
196196

197197
val testTestClient by creating {
198-
dependsOn(":server:deploy")
198+
dependsOn(":server:bundle")
199199
group = "verification"
200200
shouldRunAfter(testGame)
201201
val testClientGames = 3
202202
doFirst {
203203
testingDir.mkdirs()
204204
val serverDir = testingDir.resolve("testclient")
205205
serverDir.deleteRecursively()
206-
unzipTo(serverDir, deployDir.resolve("software-challenge-server.zip"))
206+
unzipTo(serverDir, bundleDir.resolve("software-challenge-server.zip"))
207207

208208
val command = (project(":test-client").getTasksByName("createStartScripts", false).single() as ScriptsTask).content.split(' ') +
209209
arrayOf("--start-server", "--tests", testClientGames.toString(), "--port", "13055")

player/build.gradle.kts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,19 @@ tasks {
7878
args = System.getProperty("args", "").split(" ")
7979
}
8080

81-
val deployDir: File by project
82-
val deployedPlayer: String by project
83-
val deployShadow by creating(Copy::class) {
81+
val bundleDir: File by project
82+
val bundledPlayer: String by project
83+
val bundleShadow by creating(Copy::class) {
8484
group = "distribution"
8585
from(shadowJar)
86-
into(deployDir)
87-
rename { deployedPlayer }
86+
into(bundleDir)
87+
rename { bundledPlayer }
8888
}
89-
val deploy by creating(Zip::class) {
89+
val bundle by creating(Zip::class) {
9090
group = "distribution"
91-
dependsOn(deployShadow)
91+
dependsOn(bundleShadow)
9292
from(prepareZip, copyDocs)
93-
destinationDirectory.set(deployDir)
93+
destinationDirectory.set(bundleDir)
9494
archiveFileName.set("player-$gameName-src.zip")
9595
}
9696

@@ -118,6 +118,7 @@ tasks {
118118
commandLine("java", "-jar", execDir.resolve("${game}_client.jar"), "--verify")
119119
standardOutput = org.apache.commons.io.output.NullOutputStream.NULL_OUTPUT_STREAM
120120
}
121+
println("Successfully built the shipped player package!")
121122
}
122123
}
123124

server/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies {
2020
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") // legacy java tests
2121
}
2222

23-
val deployDir: File by project
23+
val bundleDir: File by project
2424
val isBeta: Boolean by project
2525

2626
tasks {
@@ -51,10 +51,10 @@ tasks {
5151
into(runnableDir.resolve("lib"))
5252
}
5353

54-
val deploy by creating(Zip::class) {
54+
val bundle by creating(Zip::class) {
5555
group = "distribution"
5656
dependsOn(":test-client:jar", ":player:shadowJar", makeRunnable)
57-
destinationDirectory.set(deployDir)
57+
destinationDirectory.set(bundleDir)
5858
archiveBaseName.set("software-challenge-server")
5959
from(runnableDir)
6060
doFirst {

0 commit comments

Comments
 (0)