From 26e2f5516b589864021934ced0bb64b85962fcfb Mon Sep 17 00:00:00 2001 From: Ilia Vologin Date: Wed, 10 Jul 2024 14:26:21 +0200 Subject: [PATCH] Try to fix CI --- .../primitives/PrimitivesGradlePlugin.kt | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/plugin-build/primitives-plugin/src/main/kotlin/io/kinference/primitives/PrimitivesGradlePlugin.kt b/plugin-build/primitives-plugin/src/main/kotlin/io/kinference/primitives/PrimitivesGradlePlugin.kt index 02f2533..c472607 100644 --- a/plugin-build/primitives-plugin/src/main/kotlin/io/kinference/primitives/PrimitivesGradlePlugin.kt +++ b/plugin-build/primitives-plugin/src/main/kotlin/io/kinference/primitives/PrimitivesGradlePlugin.kt @@ -12,50 +12,50 @@ class PrimitivesGradlePlugin : Plugin { val primitivesExt = project.extensions.create(extensionName, PrimitivesExtension::class.java) - val primitivesTask = project.tasks.register(primitivesTaskName, PrimitivesTask::class.java) { primitivesTask -> - primitivesTask.generationPath.set(primitivesExt.generationPath) - } - project.afterEvaluate { + val primitivesTask = project.tasks.register(primitivesTaskName, PrimitivesTask::class.java) { primitivesTask -> + primitivesTask.generationPath.set(primitivesExt.generationPath) + } + val buildDependenciesTasks = project.tasks.named("buildNeeded").get().dependsOn.filterNot { it == "build" }.filterNotNull() for (task in buildDependenciesTasks) { primitivesTask.get().dependsOn(task) } - } - kotlinExt.sourceSets.all { sourceSet -> - val sourceSetName = sourceSet.name - val fullPath = primitivesExt.generationPath.dir(sourceSetName) + kotlinExt.sourceSets.all { sourceSet -> + val sourceSetName = sourceSet.name + val fullPath = primitivesExt.generationPath.dir(sourceSetName) - sourceSet.kotlin.srcDir(fullPath) + sourceSet.kotlin.srcDir(fullPath) - //Support for Incremental compilation - primitivesTask.get().inputs - .files(sourceSet.kotlin.asFileTree) - .withPathSensitivity(PathSensitivity.ABSOLUTE) - .normalizeLineEndings() - .skipWhenEmpty() - } + //Support for Incremental compilation + primitivesTask.get().inputs + .files(sourceSet.kotlin.asFileTree) + .withPathSensitivity(PathSensitivity.ABSOLUTE) + .normalizeLineEndings() + .skipWhenEmpty() + } - fun configureCompilation(compilation: KotlinCompilation<*>) { - val targetTask = compilation.compileTaskProvider + fun configureCompilation(compilation: KotlinCompilation<*>) { + val targetTask = compilation.compileTaskProvider - targetTask.configure { - it.dependsOn(primitivesTask) + targetTask.configure { + it.dependsOn(primitivesTask) + } } - } - if (kotlinExt is KotlinMultiplatformExtension) { - kotlinExt.targets.all { kotlinTarget -> - kotlinTarget.compilations.all { compilation -> - configureCompilation(compilation) + if (kotlinExt is KotlinMultiplatformExtension) { + kotlinExt.targets.all { kotlinTarget -> + kotlinTarget.compilations.all { compilation -> + configureCompilation(compilation) + } } } - } - if (kotlinExt is KotlinSingleTargetExtension<*>) { - kotlinExt.target.compilations.all { compilation -> - configureCompilation(compilation) + if (kotlinExt is KotlinSingleTargetExtension<*>) { + kotlinExt.target.compilations.all { compilation -> + configureCompilation(compilation) + } } } }