[*] Modernize Gradle setup

Version catalog and convention plugin instead of allprojects/subprojects
This commit is contained in:
2025-02-22 22:55:06 +01:00
parent f10a23a0f5
commit b466ccd577
20 changed files with 192 additions and 113 deletions

View File

@@ -1 +1,5 @@
plugins {
id("dev.panuszewski.typesafe-conventions") version "0.4.1"
}
rootProject.name = "tweed5-conventions"

View File

@@ -0,0 +1,69 @@
plugins {
java
`java-library`
`maven-publish`
id("de.siphalor.tweed5.local-runtime-only")
}
group = rootProject.group
version = rootProject.version
java {
sourceCompatibility = JavaVersion.toVersion(libs.versions.java.get())
targetCompatibility = JavaVersion.toVersion(libs.versions.java.get())
}
repositories {
mavenCentral()
}
sourceSets {
test {
runtimeClasspath = main.get().runtimeClasspath
}
}
dependencies {
compileOnly(libs.lombok)
annotationProcessor(libs.lombok)
testCompileOnly(libs.lombok)
testAnnotationProcessor(libs.lombok)
compileOnly(libs.autoservice.annotations)
annotationProcessor(libs.autoservice.processor)
testCompileOnly(libs.autoservice.annotations)
testAnnotationProcessor(libs.autoservice.processor)
implementation(libs.jetbrains.annotations)
implementation(libs.slf4j.api)
"localRuntimeOnly"(libs.slf4j.rt)
testImplementation(platform(libs.junit.platform))
testImplementation(libs.junit.core)
testImplementation(libs.mockito)
testImplementation(libs.assertj)
}
tasks.test {
useJUnitPlatform()
systemProperties(
"junit.jupiter.execution.timeout.mode" to "disabled_on_debug",
"junit.jupiter.execution.timeout.testable.method.default" to "10s",
"junit.jupiter.execution.timeout.thread.mode.default" to "SEPARATE_THREAD",
)
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
from(components["java"])
}
}
}

View File

@@ -1,5 +1,5 @@
plugins {
id("java")
java
}
val localRuntimeOnly = configurations.create("localRuntimeOnly")