-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
74 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,82 @@ | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension | ||
import org.jetbrains.kotlin.gradle.plugin.KotlinBasePlugin | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension | ||
import org.jlleitschuh.gradle.ktlint.KtlintExtension | ||
import org.jlleitschuh.gradle.ktlint.KtlintPlugin | ||
|
||
buildscript { | ||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0") | ||
classpath("org.jlleitschuh.gradle:ktlint-gradle:12.1.0") | ||
classpath("com.vanniktech:gradle-maven-publish-plugin:0.18.0") | ||
} | ||
plugins { | ||
id("org.jetbrains.kotlin.jvm") version "2.0.0" | ||
id("org.jlleitschuh.gradle.ktlint") version "12.1.1" | ||
id("com.vanniktech.maven.publish") version "0.29.0" | ||
} | ||
|
||
subprojects { | ||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
apply<KtlintPlugin>() | ||
configure<KtlintExtension> { | ||
version.set("1.2.1") | ||
} | ||
|
||
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") { | ||
configure<KotlinProjectExtension> { | ||
jvmToolchain(21) | ||
configure<KotlinJvmProjectExtension> { | ||
compilerOptions.jvmTarget.set(JvmTarget.JVM_21) | ||
} | ||
|
||
configure<JavaPluginExtension> { | ||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
} | ||
} | ||
|
||
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
|
||
testLogging { | ||
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL | ||
exceptionFormat = TestExceptionFormat.FULL | ||
showExceptions = true | ||
showCauses = true | ||
} | ||
|
||
addTestListener(object : TestListener { | ||
override fun afterSuite(suite: TestDescriptor, result: TestResult) { | ||
if (suite.parent == null) { | ||
val output = "| Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped) |" | ||
val border = "-".repeat(output.length) | ||
println(""" | ||
$border | ||
$output | ||
$border | ||
""".trimIndent() | ||
) | ||
addTestListener( | ||
object : TestListener { | ||
override fun afterSuite( | ||
suite: TestDescriptor, | ||
result: TestResult, | ||
) { | ||
if (suite.parent == null) { | ||
val output = | ||
buildString { | ||
append("| Results: ") | ||
append(result.resultType) | ||
append(" (") | ||
append(result.testCount) | ||
append(" tests, ") | ||
append(result.successfulTestCount) | ||
append(" passed, ") | ||
append(result.failedTestCount) | ||
append(" failed, ") | ||
append(result.skippedTestCount) | ||
append(" skipped) |") | ||
} | ||
val border = "-".repeat(output.length) | ||
println( | ||
""" | ||
$border | ||
$output | ||
$border | ||
""".trimIndent(), | ||
) | ||
} | ||
} | ||
} | ||
|
||
override fun afterTest(testDescriptor: TestDescriptor?, result: TestResult?) {} | ||
override fun beforeTest(testDescriptor: TestDescriptor?) {} | ||
override fun beforeSuite(suite: TestDescriptor?) {} | ||
}) | ||
override fun afterTest( | ||
testDescriptor: TestDescriptor?, | ||
result: TestResult?, | ||
) {} | ||
|
||
override fun beforeTest(testDescriptor: TestDescriptor?) {} | ||
|
||
override fun beforeSuite(suite: TestDescriptor?) {} | ||
}, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
* | ||
* The settings file is used to specify which projects to include in your build. | ||
* | ||
* Detailed information about configuring a multi-project build in Gradle can be found | ||
* in the user manual at https://docs.gradle.org/5.6/userguide/multi_project_builds.html | ||
*/ | ||
pluginManagement { | ||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
} | ||
|
||
dependencyResolutionManagement { | ||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) | ||
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
|
||
include("vgo-core", "vgo", "vgo-plugin") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters