com.autonomousapps.subplugin.RedundantJvmPlugin.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dependency-analysis-gradle-plugin Show documentation
Show all versions of dependency-analysis-gradle-plugin Show documentation
Analyzes dependency usage in Android and JVM projects
// Copyright (c) 2024. Tony Robalik.
// SPDX-License-Identifier: Apache-2.0
package com.autonomousapps.subplugin
import com.autonomousapps.extension.Behavior
import com.autonomousapps.internal.RedundantSubPluginOutputPaths
import com.autonomousapps.tasks.ComputeAdviceTask
import com.autonomousapps.tasks.DetectRedundantJvmPluginTask
import org.gradle.api.Project
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.TaskProvider
import org.gradle.kotlin.dsl.property
import org.gradle.kotlin.dsl.register
internal class RedundantJvmPlugin(
private val project: Project,
private val computeAdviceTask: TaskProvider,
private val redundantPluginsBehavior: Provider
) {
private val outputPaths = RedundantSubPluginOutputPaths(project)
private val javaSource = project.objects.property().convention(false)
private val kotlinSource = project.objects.property().convention(false)
fun configure() {
val detectRedundantJvmPlugin = project.tasks.register("detectRedundantJvmPlugin") {
hasJava.set(javaSource)
hasKotlin.set(kotlinSource)
redundantPluginsBehavior.set([email protected])
output.set(outputPaths.pluginJvmAdvicePath)
}
computeAdviceTask.configure {
redundantJvmPluginReport.set(detectRedundantJvmPlugin.flatMap { it.output })
}
}
internal fun withJava(java: Provider) {
javaSource.set(java)
}
internal fun withKotlin(kotlin: Provider) {
kotlinSource.set(kotlin)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy