This commit is contained in:
Fiereu committed 2025-08-22 16:11:41 +02:00
commit c5ee4e27e6
131 files changed
+9926

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
plugins {
`kotlin-dsl`
}
kotlin {
jvmToolchain(24)
}
dependencies {
implementation(libs.kotlinGradlePlugin)
implementation(libs.spotlessGradlePlugin)
implementation(libs.junit5)
}
+14
View File
@@ -0,0 +1,14 @@
dependencyResolutionManagement {
@Suppress("UnstableApiUsage")
repositories {
mavenCentral()
}
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
rootProject.name = "buildSrc"
+67
View File
@@ -0,0 +1,67 @@
package buildsrc.common
val KEYS_RESOURCE_LOCATION = "src/main/resources"
tasks.register<Copy>("copyPublicKeyChat") {
group = "openmmo"
description = "Copy chat keys from \":keys\" to the current projects resources directory"
from(project(":keys").tasks.getByName("generateChat").outputs.files) {
include("*.public.pem")
}
into(project.layout.projectDirectory.dir(KEYS_RESOURCE_LOCATION))
tasks.getByName("processResources").let { it.mustRunAfter("copyPublicKeyChat") }
}
tasks.register<Copy>("copyPrivateKeyChat") {
group = "openmmo"
description = "Copy chat keys from \":keys\" to the current projects resources directory"
from(project(":keys").tasks.getByName("generateChat").outputs.files) {
include("*.public.pem")
}
into(project.layout.projectDirectory.dir(KEYS_RESOURCE_LOCATION))
tasks.getByName("processResources").let { it.mustRunAfter("copyPrivateKeyChat") }
}
tasks.register("copyKeysChat") {
group = "openmmo"
description = "Copies all chat keys from \":keys\" to the current projects resources directory"
dependsOn("copyPublicKeyChat", "copyPrivateKeyChat")
}
tasks.register<Copy>("copyPublicKeyGame") {
group = "openmmo"
description = "Copy game keys from \":keys\" to the current projects resources directory"
from(project(":keys").tasks.getByName("generateGame").outputs.files) {
include("*.public.pem")
}
into(project.layout.projectDirectory.dir(KEYS_RESOURCE_LOCATION))
tasks.getByName("processResources").let { it.mustRunAfter("copyPublicKeyGame") }
}
tasks.register<Copy>("copyPrivateKeyGame") {
group = "openmmo"
description = "Copy game keys from \":keys\" to the current projects resources directory"
from(project(":keys").tasks.getByName("generateGame").outputs.files) {
include("*.private.pem")
}
into(project.layout.projectDirectory.dir(KEYS_RESOURCE_LOCATION))
tasks.getByName("processResources").let { it.mustRunAfter("copyPrivateKeyGame") }
}
tasks.register("copyKeysGame") {
group = "openmmo"
description = "Copies all game keys from \":keys\" to the current projects resources directory"
dependsOn("copyPublicKeyGame", "copyPrivateKeyGame")
}
tasks.register("copyPublicKeys") {
group = "openmmo"
description = "Copies all public keys from \":keys\" to the current projects resources directory"
dependsOn("copyPublicKeyChat", "copyPublicKeyGame")
}
tasks.register("copyKeys") {
group = "openmmo"
description = "Copies all keys from \":keys\" to the current projects resources directory"
dependsOn("copyKeysChat", "copyKeysGame")
}
@@ -0,0 +1,29 @@
package buildsrc.convention
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.withType
plugins {
kotlin("jvm")
}
kotlin {
jvmToolchain(24)
}
dependencies {
testImplementation(kotlin("test"))
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
testLogging {
events(
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED
)
}
}
@@ -0,0 +1,31 @@
package buildsrc.convention
import com.diffplug.spotless.LineEnding
plugins {
id("com.diffplug.spotless")
}
spotless {
encoding("UTF-8")
lineEndings = LineEnding.UNIX
kotlinGradle {
target("**/*.gradle.kts")
ktfmt()
trimTrailingWhitespace()
endWithNewline()
}
kotlin {
target("**/src/**/*.kt")
ktfmt()
trimTrailingWhitespace()
endWithNewline()
}
format("misc") {
target("**/*.md", "**/*.yml", "**/*.yaml", "**/*.properties")
trimTrailingWhitespace()
endWithNewline()
}
}
tasks.withType<Test> { dependsOn("spotlessCheck") }