Skip to content

Commit

Permalink
Remove usage of an internal AGP API (detekt#6565)
Browse files Browse the repository at this point in the history
This can be replaced using Gradle's standard API
  • Loading branch information
3flex authored Oct 26, 2023
1 parent e7a3e5c commit e9954a8
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.android.build.gradle.LibraryExtension
import com.android.build.gradle.TestExtension
import com.android.build.gradle.api.BaseVariant
import com.android.build.gradle.internal.api.TestedVariant
import com.android.build.gradle.internal.tasks.factory.dependsOn
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
import io.gitlab.arturbosch.detekt.DetektPlugin
Expand Down Expand Up @@ -79,26 +78,26 @@ internal class DetektAndroid(private val project: Project) {
?.all { variant ->
project.registerAndroidDetektTask(bootClasspath, extension, variant)
.also { provider ->
mainTaskProvider.dependsOn(provider)
mainTaskProvider.configure { it.dependsOn(provider) }
}
project.registerAndroidCreateBaselineTask(bootClasspath, extension, variant)
.also { provider ->
mainBaselineTaskProvider.dependsOn(provider)
mainBaselineTaskProvider.configure { it.dependsOn(provider) }
}
variant.testVariants
.filter { !extension.matchesIgnoredConfiguration(it) }
.forEach { testVariant ->
project.registerAndroidDetektTask(bootClasspath, extension, testVariant)
.also { provider ->
testTaskProvider.dependsOn(provider)
testTaskProvider.configure { it.dependsOn(provider) }
}
project.registerAndroidCreateBaselineTask(
bootClasspath,
extension,
testVariant
)
.also { provider ->
testBaselineTaskProvider.dependsOn(provider)
testBaselineTaskProvider.configure { it.dependsOn(provider) }
}
}
}
Expand Down

0 comments on commit e9954a8

Please sign in to comment.