Skip to content

Commit

Permalink
Add exclude method for version catalog dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Vichy97 authored and autonomousapps committed Oct 6, 2023
1 parent 368ad2f commit 8ea4311
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/kotlin/com/autonomousapps/extension/Issue.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
package com.autonomousapps.extension

import org.gradle.api.InvalidUserDataException
import org.gradle.api.artifacts.MinimalExternalModuleDependency
import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.Provider
import org.gradle.api.provider.SetProperty
import org.gradle.kotlin.dsl.property
import org.gradle.kotlin.dsl.setProperty
import javax.inject.Inject
Expand Down Expand Up @@ -55,6 +55,17 @@ open class Issue @Inject constructor(
severity.disallowChanges()
}

/**
* All provided elements will be filtered out of the final advice. For example:
* ```
* exclude(libs.example, libs.some.thing)
* ```
* tells the plugin to exclude those dependencies in the final advice.
*/
fun exclude(vararg ignore: Provider<MinimalExternalModuleDependency>) {
exclude(*ignore.map { it.get().toString() }.toTypedArray())
}

/**
* All provided elements will be filtered out of the final advice. For example:
* ```
Expand Down

0 comments on commit 8ea4311

Please sign in to comment.