Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

This document captures development standards and architecture decisions of this project as a point of reference.

## Gradle

We build everything with gradle, nesting projects if needed.
Currently we have some pending updates, due to the following incompatibilities:

- The new johnrengelman.shadow plugin version needs Gradle 7
- The current Dokka version can neither handle Gradle 7 nor Kotlin 1.5.30+ nor Java beyond version 8

The bottleneck is updating dokka,
which is a longer process tracked in
https://github.com/software-challenge/backend/pull/404

## Testing

Unsere Unittests nutzen das [Kotest-Framework](https://kotest.io)
Expand Down Expand Up @@ -41,7 +53,7 @@ annotate the serialized fields with a concrete type instead.
Ideally these fields should then be private with generically typed getters
as to not expose the implementation details internally.

## Cloning
## Object Cloning

Relevant discussion: https://github.com/software-challenge/backend/pull/148

Expand Down
39 changes: 27 additions & 12 deletions gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import java.util.concurrent.TimeoutException
import java.util.concurrent.atomic.AtomicBoolean

plugins {
maven
kotlin("jvm") version "1.6.21"
id("org.jetbrains.dokka") version "0.10.1"
id("scripts-task")
id("idea")
`maven-publish`

id("com.github.ben-manes.versions") version "0.42.0" // only upgrade with Gradle 7: https://github.com/ben-manes/gradle-versions-plugin/issues/778
id("se.patrikerdes.use-latest-versions") version "0.2.18"
Expand Down Expand Up @@ -285,32 +285,47 @@ allprojects {
}

if (this.name in documentedProjects) {
apply(plugin = "maven")
apply(plugin = "maven-publish")
apply(plugin = "org.jetbrains.dokka")
publishing {
publications {
create<MavenPublication>(name) {
println(components.joinToString())
from(components["java"])
version = rootProject.version.toString()
}
}
}
java {
withSourcesJar()
withJavadocJar()
}
tasks {
val doc by creating(DokkaTask::class) {
group = "documentation"
dependsOn(classes)
outputDirectory = buildDir.resolve("doc").toString()
outputFormat = "javadoc"
configuration {
reportUndocumented = false
moduleName = "Software-Challenge ${project.name} $version"
jdkVersion = 8
}
}
val docJar by creating(Jar::class) {
group = "build"
from(doc)
archiveBaseName.set(jar.get().archiveBaseName)
archiveClassifier.set("javadoc")
}
val sourcesJar by creating(Jar::class) {
group = "build"
archiveBaseName.set(jar.get().archiveBaseName)
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
install {
dependsOn(docJar, sourcesJar)
}
//val sourcesJar by creating(Jar::class) {
// group = "build"
// archiveBaseName.set(jar.get().archiveBaseName)
// archiveClassifier.set("sources")
// from(sourceSets.main.get().allSource)
//}
artifacts {
archives(sourcesJar.archiveFile) { classifier = "sources" }
//archives(sourcesJar.archiveFile) { classifier = "sources" }
archives(docJar.archiveFile) { classifier = "javadoc" }
}
}
Expand Down
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
# 7.6.6
# 8.14.3
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion plugin2025/src/test/kotlin/sc/plugin2025/MoveTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class MoveTest: WordSpec({
state.getSensibleMoves() shouldBe listOf(FallBack, ExchangeCarrots(10))
}

"produce concicse XML" {
"produce concise XML" {
ExchangeCarrots(-10) shouldSerializeTo "<exchangecarrots amount=\"-10\"/>"
}
}
Expand Down
5 changes: 2 additions & 3 deletions sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ configurations {
}

artifacts {
val kt = tasks["compileTestConfigKotlin"]
val kt = tasks.getByName("compileTestConfigKotlin", org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class)
add("testConfig", kt.outputs.files.first()) {
builtBy(kt)
}
Expand All @@ -26,13 +26,12 @@ configurations.archives.get().artifacts.removeIf { it.name == "testConfig" }

dependencies {
api(kotlin("stdlib"))
api("com.thoughtworks.xstream", "xstream", "1.4.17") // New security config for 1.4.20
api("com.thoughtworks.xstream", "xstream", "1.4.17") // New security config, then 1.4.20
api("jargs", "jargs", "1.0")
api("org.slf4j", "slf4j-api", "2.0.9")

implementation("org.hamcrest", "hamcrest-core", "2.2")
implementation("net.sf.kxml", "kxml2", "2.3.0")
implementation("xmlpull", "xmlpull", "1.1.3.1")

"testConfigApi"("io.kotest", "kotest-assertions-core")
"testConfigApi"("io.kotest", "kotest-runner-junit5-jvm", "5.0.3")
Expand Down
Loading