2024-09-17 12:24:25 +00:00
|
|
|
import kotlinx.kover.gradle.plugin.dsl.CoverageUnit
|
|
|
|
|
2024-04-30 09:42:41 +00:00
|
|
|
plugins {
|
2024-07-29 07:26:41 +00:00
|
|
|
alias(libs.plugins.kotlin.jvm)
|
2024-08-10 03:18:52 +00:00
|
|
|
id("maven-publish")
|
2024-09-17 12:24:25 +00:00
|
|
|
alias(libs.plugins.kover)
|
|
|
|
alias(libs.plugins.detekt)
|
2024-04-30 09:42:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
allprojects {
|
|
|
|
group = "dev.usbharu"
|
2024-08-10 08:01:26 +00:00
|
|
|
version = "0.0.2-SNAPSHOT"
|
2024-04-30 09:42:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-08-10 03:18:52 +00:00
|
|
|
tasks {
|
|
|
|
create("publishMavenPublicationToMavenLocal") {
|
|
|
|
subprojects.forEach { dependsOn("${it.path}:publishMavenPublicationToMavenLocal") }
|
|
|
|
}
|
|
|
|
create("publishMavenPublicationToGiteaRepository") {
|
|
|
|
subprojects.forEach { dependsOn("${it.path}:publishMavenPublicationToGiteaRepository") }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-30 09:42:41 +00:00
|
|
|
subprojects {
|
|
|
|
apply {
|
|
|
|
plugin("org.jetbrains.kotlin.jvm")
|
2024-08-10 03:18:52 +00:00
|
|
|
plugin("maven-publish")
|
2024-09-17 12:24:25 +00:00
|
|
|
plugin(rootProject.libs.plugins.kover.get().pluginId)
|
2024-09-17 12:53:54 +00:00
|
|
|
plugin(rootProject.libs.plugins.detekt.get().pluginId)
|
2024-04-30 09:42:41 +00:00
|
|
|
}
|
|
|
|
kotlin {
|
2024-07-29 06:37:28 +00:00
|
|
|
jvmToolchain(21)
|
2024-04-30 09:42:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2024-08-08 15:38:36 +00:00
|
|
|
implementation("org.slf4j:slf4j-api:2.0.15")
|
2024-06-28 08:51:52 +00:00
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter:5.10.3")
|
2024-09-17 12:53:54 +00:00
|
|
|
detektPlugins(rootProject.libs.detekt.formatting)
|
2024-04-30 09:42:41 +00:00
|
|
|
|
2024-09-17 12:53:54 +00:00
|
|
|
}
|
2024-04-30 09:42:41 +00:00
|
|
|
|
2024-09-17 12:53:54 +00:00
|
|
|
detekt {
|
|
|
|
parallel = true
|
|
|
|
config.setFrom(files("$rootDir/../detekt.yml"))
|
|
|
|
buildUponDefaultConfig = true
|
|
|
|
basePath = "${projectDir}/src/main/kotlin"
|
|
|
|
autoCorrect = true
|
2024-04-30 09:42:41 +00:00
|
|
|
}
|
2024-09-17 12:53:54 +00:00
|
|
|
|
2024-09-17 12:24:25 +00:00
|
|
|
project.gradle.taskGraph.whenReady {
|
|
|
|
if (this.hasTask(":koverGenerateArtifact")) {
|
|
|
|
val task = this.allTasks.find { println(it.name);it.name == "test" }
|
|
|
|
val verificationTask = task as VerificationTask
|
|
|
|
verificationTask.ignoreFailures = true
|
|
|
|
}
|
|
|
|
}
|
2024-09-17 13:02:29 +00:00
|
|
|
tasks {
|
|
|
|
withType<io.gitlab.arturbosch.detekt.Detekt> {
|
|
|
|
exclude("**/generated/**")
|
|
|
|
setSource("src/main/kotlin")
|
|
|
|
exclude("build/")
|
|
|
|
configureEach {
|
|
|
|
exclude("**/org/koin/ksp/generated/**", "**/generated/**")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
withType<io.gitlab.arturbosch.detekt.DetektCreateBaselineTask>() {
|
|
|
|
configureEach {
|
|
|
|
exclude("**/org/koin/ksp/generated/**", "**/generated/**")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
withType<Test> {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
2024-04-30 09:42:41 +00:00
|
|
|
}
|
|
|
|
|
2024-08-10 03:18:52 +00:00
|
|
|
publishing {
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
name = "Gitea"
|
|
|
|
url = uri("https://git.usbharu.dev/api/packages/usbharu/maven")
|
|
|
|
|
2024-08-10 07:24:12 +00:00
|
|
|
credentials(HttpHeaderCredentials::class) {
|
2024-08-10 03:18:52 +00:00
|
|
|
name = "Authorization"
|
|
|
|
value = "token " + (project.findProperty("gpr.gitea") as String? ?: System.getenv("GITEA"))
|
|
|
|
}
|
2024-04-30 09:42:41 +00:00
|
|
|
|
2024-08-10 03:18:52 +00:00
|
|
|
authentication {
|
|
|
|
create<HttpHeaderAuthentication>("header")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publications {
|
|
|
|
register<MavenPublication>("maven") {
|
|
|
|
groupId = "dev.usbharu"
|
|
|
|
artifactId = project.name
|
|
|
|
version = project.version.toString()
|
|
|
|
from(components["kotlin"])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-09-17 12:24:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
kover(project(":owl-broker"))
|
|
|
|
kover(project(":owl-broker:owl-broker-mongodb"))
|
|
|
|
kover(project(":owl-common"))
|
|
|
|
kover(project(":owl-common:owl-common-serialize-jackson"))
|
|
|
|
kover(project(":owl-consumer"))
|
|
|
|
kover(project(":owl-producer"))
|
|
|
|
kover(project(":owl-producer:owl-producer-api"))
|
|
|
|
kover(project(":owl-producer:owl-producer-default"))
|
|
|
|
kover(project(":owl-producer:owl-producer-embedded"))
|
|
|
|
}
|
|
|
|
|
2024-09-17 12:53:54 +00:00
|
|
|
detekt {
|
|
|
|
parallel = true
|
|
|
|
config.setFrom(files("../detekt.yml"))
|
|
|
|
buildUponDefaultConfig = true
|
|
|
|
basePath = "${projectDir}/src/main/kotlin"
|
|
|
|
autoCorrect = true
|
|
|
|
}
|
2024-09-17 12:24:25 +00:00
|
|
|
|
|
|
|
project.gradle.taskGraph.whenReady {
|
|
|
|
if (this.hasTask(":koverGenerateArtifact")) {
|
|
|
|
val task = this.allTasks.find { it.name == "test" }
|
|
|
|
val verificationTask = task as VerificationTask
|
|
|
|
verificationTask.ignoreFailures = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
kover {
|
|
|
|
currentProject {
|
|
|
|
sources {
|
|
|
|
excludedSourceSets.addAll("grpc", "grpckt")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
reports {
|
|
|
|
verify {
|
|
|
|
rule {
|
|
|
|
bound {
|
|
|
|
minValue = 50
|
|
|
|
coverageUnits = CoverageUnit.INSTRUCTION
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
total {
|
|
|
|
xml {
|
|
|
|
title = "Hideout Core"
|
|
|
|
xmlFile = file("$buildDir/reports/kover/hideout-core.xml")
|
|
|
|
}
|
|
|
|
filters {
|
|
|
|
excludes {
|
|
|
|
packages("dev.usbharu.owl.generated")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|