Skip to content

Commit 76c9d13

Browse files
committed
Removed support of old compile task hierarchy for KGP <= 1.7.0
1 parent a4cabfe commit 76c9d13

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

atomicfu-gradle-plugin/src/main/kotlin/kotlinx/atomicfu/plugin/gradle/AtomicFUGradlePlugin.kt

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -313,23 +313,11 @@ private fun Project.configureTransformationForTarget(target: KotlinTarget) {
313313
val originalMainClassesDirs = project.objects.fileCollection().from(
314314
mainCompilation.compileTaskProvider.flatMap { (it as KotlinCompileTool).destinationDirectory }
315315
)
316-
317-
// KGP >= 1.7.0 has breaking changes in task hierarchy:
318-
// https://youtrack.jetbrains.com/issue/KT-32805#focus=Comments-27-5915479.0-0
319-
val (majorVersion, minorVersion) = getKotlinPluginVersion()
320-
.split('.')
321-
.take(2)
322-
.map { it.toInt() }
323-
if (majorVersion == 1 && minorVersion < 7) {
324-
(tasks.findByName(compilation.compileKotlinTaskName) as? AbstractCompile)?.classpath =
325-
originalMainClassesDirs + compilation.compileDependencyFiles - mainCompilation.output.classesDirs
326-
} else {
327-
(tasks.findByName(compilation.compileKotlinTaskName) as? AbstractKotlinCompileTool<*>)
328-
?.libraries
329-
?.setFrom(
330-
originalMainClassesDirs + compilation.compileDependencyFiles
331-
)
332-
}
316+
(tasks.findByName(compilation.compileKotlinTaskName) as? AbstractKotlinCompileTool<*>)
317+
?.libraries
318+
?.setFrom(
319+
originalMainClassesDirs + compilation.compileDependencyFiles
320+
)
333321

334322
(tasks.findByName("${target.name}${compilation.name.capitalize()}") as? Test)?.classpath =
335323
originalMainClassesDirs + (compilation as KotlinCompilationToRunnableFiles).runtimeDependencyFiles - mainCompilation.output.classesDirs

0 commit comments

Comments
 (0)