@@ -30,6 +30,10 @@ java {
3030 }
3131}
3232
33+ ktlint {
34+ version = " 1.1.0"
35+ }
36+
3337tasks.withType<KotlinCompile > {
3438 kotlinOptions {
3539 // target 1.4 as ktlint 0.49 requires it for inline classes
@@ -56,6 +60,7 @@ configurations {
5660}
5761configurations[" compileOnly" ].extendsFrom(shadowImplementation)
5862configurations[" testImplementation" ].extendsFrom(shadowImplementation)
63+
5964sourceSets {
6065 val adapter by creating {
6166 }
@@ -88,13 +93,15 @@ sourceSets {
8893 runtimeClasspath = adapters.map { it.output }.fold(runtimeClasspath) { a, b -> a + b }
8994 }
9095 }
96+
9197 val test by getting {
9298 kotlin {
9399 compileClasspath = adapters.map { it.output }.fold(compileClasspath) { a, b -> a + b }
94100 runtimeClasspath = adapters.map { it.output }.fold(runtimeClasspath) { a, b -> a + b }
95101 }
96102 }
97103}
104+
98105val adapterSources = listOf (
99106 sourceSets.named(" adapter" ),
100107 sourceSets.named(" adapter47" ),
@@ -140,12 +147,6 @@ dependencies {
140147 // Explicitly added for shadow plugin to relocate implementation as well
141148 shadowImplementation(libs.slf4j.nop)
142149
143- /*
144- * Do not depend upon the gradle script kotlin plugin API. IE: gradleScriptKotlinApi()
145- * It's currently in flux and has binary breaking changes in gradle 4.0
146- * https://github.com/JLLeitschuh/ktlint-gradle/issues/9
147- */
148-
149150 testImplementation(libs.junit.jupiter)
150151 testImplementation(libs.assertj.core)
151152 testImplementation(libs.kotlin.reflect)
@@ -165,12 +166,8 @@ kotlin {
165166 }
166167}
167168
168- // Test tasks loods plugin from local maven repository
169- tasks.named<Test >(" test" ) {
170- dependsOn(" publishToMavenLocal" )
171- }
172-
173169tasks.withType<Test > {
170+ dependsOn(" publishToMavenLocal" )
174171 useJUnitPlatform()
175172 maxParallelForks = (Runtime .getRuntime().availableProcessors() / 2 ).takeIf { it > 0 } ? : 1
176173 doFirst {
@@ -195,6 +192,12 @@ tasks.withType<Test> {
195192 maxFailures.set(10 )
196193 }
197194 }
195+
196+ javaLauncher.set(
197+ javaToolchains.launcherFor {
198+ languageVersion = JavaLanguageVersion .of(JavaVersion .current().majorVersion)
199+ }
200+ )
198201}
199202
200203val relocateShadowJar = tasks.register<ConfigureShadowRelocation >(" relocateShadowJar" )
@@ -273,7 +276,9 @@ fun setupPublishingEnvironment() {
273276
274277 if (System .getProperty(keyProperty) == null || System .getProperty(secretProperty) == null ) {
275278 logger
276- .info(" `$keyProperty ` or `$secretProperty ` were not set. Attempting to configure from environment variables" )
279+ .info(
280+ " `$keyProperty ` or `$secretProperty ` were not set. Attempting to configure from environment variables"
281+ )
277282
278283 val key: String? = System .getenv(keyEnvironmentVariable)
279284 val secret: String? = System .getenv(secretEnvironmentVariable)
0 commit comments