Lazy task creation in konan plugin using Gradle Providers API.

Removes obsolete CMake task and IDE model.

Use Provider API for klib files. Replace findAll with matching to make tasks configure lazily

Make some test tasks use lazy configuration

Fix adding tasks to lists. Add it. to all fields to improve IDEA navigation

Remove obsolete IDE model from the task

Remove tooling model tests

Fix aggregate task dependency

Fix run tasks. Cleanup

Review fixes
This commit is contained in:
Pavel Punegov
2021-01-19 13:51:46 +03:00
committed by Vasily Levchenko
parent 716326a60f
commit 8a48609823
15 changed files with 218 additions and 777 deletions
@@ -2,6 +2,7 @@ package org.jetbrains.kotlin
import groovy.lang.Closure
import org.gradle.api.Task
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Exec
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFile
@@ -12,17 +13,17 @@ import java.io.File
// TODO: Implement as a part of the gradle plugin
open class KlibInstall: Exec() {
@InputFile
lateinit var klib: File
@Input
lateinit var klib: Provider<File>
@Input
var repo: File = project.rootDir
val installDir: File
val installDir: Provider<File>
@OutputDirectory
get() {
val klibName = klib.name.take(klib.name.lastIndexOf('.'))
return project.file("${repo.absolutePath}/$klibName")
get() = project.provider {
val klibName = klib.get().nameWithoutExtension
project.file("${repo.absolutePath}/$klibName")
}
@Input
@@ -38,7 +39,7 @@ open class KlibInstall: Exec() {
repo.mkdirs()
commandLine(klibProgram,
"install", klib.absolutePath,
"install", klib.get().absolutePath,
"-target", target,
"-repository", repo.absolutePath
)