All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlinx.kover.gradle.aggregation.settings.tasks.AbstractKoverReportTask.kt Maven / Gradle / Ivy

There is a newer version: 0.9.0-RC
Show newest version
/*
 * Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

package kotlinx.kover.gradle.aggregation.settings.tasks

import kotlinx.kover.gradle.aggregation.commons.artifacts.ProjectArtifactInfo
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.Nested

internal abstract class AbstractKoverReportTask : AbstractKoverTask() {
    @get:Nested
    abstract val filters: Property

    @get:Nested
    val data: Provider> = artifacts.elements.map { elements ->
        elements.data().mapValues { entry ->
            entry.value.filterProjectSources(filters.get())
        }
    }

    @get:Internal
    protected val reports get() = data.get().values.flatMap { artifact -> artifact.reports }

    @get:Internal
    protected val sources get() =
        data.get().values.flatMap { artifact -> artifact.compilations.flatMap { compilation -> compilation.value.sourceDirs } }

    @get:Internal
    protected val outputs get() =
        data.get().values.flatMap { artifact -> artifact.compilations.flatMap { compilation -> compilation.value.outputDirs } }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy