From 884d17cf471e609eaf1e3967e954727e8c0c73d3 Mon Sep 17 00:00:00 2001 From: usbharu Date: Sun, 15 Sep 2024 23:11:29 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=E3=82=AB=E3=83=90=E3=83=AC=E3=83=83?= =?UTF-8?q?=E3=82=B8=E3=81=AE=E8=A8=88=E6=B8=AC=E6=96=B9=E6=B3=95=E3=82=92?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E7=B6=B2=E7=BE=85=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hideout-core/build.gradle.kts | 82 ++++++++++++++++------------------- 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/hideout-core/build.gradle.kts b/hideout-core/build.gradle.kts index 0c09fdee..a9247b41 100644 --- a/hideout-core/build.gradle.kts +++ b/hideout-core/build.gradle.kts @@ -19,6 +19,7 @@ import com.github.jk1.license.filter.LicenseBundleNormalizer import com.github.jk1.license.importer.DependencyDataImporter import com.github.jk1.license.importer.XmlReportImporter import com.github.jk1.license.render.* +import kotlinx.kover.gradle.plugin.dsl.CoverageUnit import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { @@ -37,19 +38,6 @@ apply { group = "dev.usbharu" version = "0.0.1" - -tasks.withType { - useJUnitPlatform() - doFirst { - jvmArgs = arrayOf( - "--add-opens", "java.base/java.lang=ALL-UNNAMED", - "--add-opens", "java.base/java.util=ALL-UNNAMED", - "--add-opens", "java.naming/javax.naming=ALL-UNNAMED", - "--add-opens", "java.base/java.util.concurrent.locks=ALL-UNNAMED" - ).toMutableList() - } -} - kotlin { jvmToolchain(21) compilerOptions { @@ -85,8 +73,7 @@ repositories { } -val os = org.gradle.nativeplatform.platform.internal - .DefaultNativePlatform.getCurrentOperatingSystem() +val os = org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.getCurrentOperatingSystem() dependencies { developmentOnly(libs.h2db) @@ -173,35 +160,40 @@ configurations { } } - -//tasks{ -// bootRun { -// sourceResources(sourceSets.main.get()) -// } -//} - -tasks.withType { - exclude("**/generated/**") - doFirst { - +tasks { + withType { + exclude("**/generated/**") + setSource("src/main/kotlin") + exclude("build/") + configureEach { + exclude("**/org/koin/ksp/generated/**", "**/generated/**") + } + } + withType() { + configureEach { + exclude("**/org/koin/ksp/generated/**", "**/generated/**") + } + } + withType { + useJUnitPlatform() + doFirst { + jvmArgs = arrayOf( + "--add-opens", + "java.base/java.lang=ALL-UNNAMED", + "--add-opens", + "java.base/java.util=ALL-UNNAMED", + "--add-opens", + "java.naming/javax.naming=ALL-UNNAMED", + "--add-opens", + "java.base/java.util.concurrent.locks=ALL-UNNAMED" + ).toMutableList() + } } - setSource("src/main/kotlin") - exclude("build/") } -tasks.withType().configureEach { - exclude("**/org/koin/ksp/generated/**", "**/generated/**") -} - -tasks.withType().configureEach { - exclude("**/org/koin/ksp/generated/**", "**/generated/**") -} project.gradle.taskGraph.whenReady { - println(this.allTasks) - this.allTasks.map { println(it.name) } if (this.hasTask(":koverGenerateArtifact")) { - println("has task") val task = this.allTasks.find { it.name == "test" } val verificationTask = task as VerificationTask verificationTask.ignoreFailures = true @@ -217,9 +209,12 @@ kover { } reports { - verify{ - rule{ - minBound(50) + verify { + rule { + bound{ + minValue = 50 + coverageUnits = CoverageUnit.INSTRUCTION + } } } filters { @@ -248,10 +243,7 @@ licenseReport { importers = arrayOf(XmlReportImporter("hideout", File("$projectDir/license-list.xml"))) renderers = arrayOf( - InventoryHtmlReportRenderer(), - CsvReportRenderer(), - JsonReportRenderer(), - XmlReportRenderer() + InventoryHtmlReportRenderer(), CsvReportRenderer(), JsonReportRenderer(), XmlReportRenderer() ) filters = arrayOf(LicenseBundleNormalizer("$projectDir/license-normalizer-bundle.json", true)) allowedLicensesFile = File("$projectDir/allowed-licenses.json")