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

name.remal.gradle_plugins.dsl.reflective_project_plugin.info.PluginInfo.kt Maven / Gradle / Ivy

There is a newer version: 1.9.2
Show newest version
package name.remal.gradle_plugins.dsl.reflective_project_plugin.info

import name.remal.SetBuilder
import name.remal.buildSet
import name.remal.gradle_plugins.dsl.PluginId
import name.remal.gradle_plugins.dsl.ProjectPluginClass
import org.gradle.util.GradleVersion

data class PluginInfo(
    val pluginClass: ProjectPluginClass,
    val id: String,
    val isHidden: Boolean = false,
    val description: String = "",
    val tags: Set = setOf(),
    override val conditionMethods: List = listOf(),
    override val minGradleVersion: GradleVersion? = null,
    override val maxGradleVersion: GradleVersion? = null,
    override val requirePluginIds: Set = setOf(),
    override val applyPluginIds: Set = setOf(),
    override val applyOptionalPluginIds: Set = setOf(),
    override val applyPluginClasses: Set = setOf(),
    override val applyPluginIdsAtTheEnd: Set = setOf(),
    override val applyOptionalPluginIdsAtTheEnd: Set = setOf(),
    override val applyPluginClassesAtTheEnd: Set = setOf(),
    override val actionMethods: List = listOf(),
    override val actionsGroups: List = listOf()
) : WithPluginActions {

    override val actions: List = super.actions

    val allRequirePluginIds: Set = buildSet { collectAllRequirePluginIds(this, this@PluginInfo) }

    private fun collectAllRequirePluginIds(result: SetBuilder, context: WithRequirements) {
        result.addAll(context.requirePluginIds)

        if (context is WithPluginActions) {
            context.actionMethods.forEach { collectAllRequirePluginIds(result, it) }
            context.actionsGroups.forEach { collectAllRequirePluginIds(result, it) }
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy