name.remal.gradle_plugins.dsl.reflective_project_plugin.info.PluginInfo.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-plugins-kotlin-dsl Show documentation
Show all versions of gradle-plugins-kotlin-dsl Show documentation
Remal Gradle plugins: gradle-plugins-kotlin-dsl
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) }
}
}
}