|
@@ -1,6 +1,8 @@
|
|
|
package org.springframework.security.convention.versions;
|
|
|
|
|
|
+import com.github.benmanes.gradle.versions.updates.resolutionstrategy.ComponentSelectionRulesWithCurrent;
|
|
|
import com.github.benmanes.gradle.versions.updates.resolutionstrategy.ComponentSelectionWithCurrent;
|
|
|
+import com.github.benmanes.gradle.versions.updates.resolutionstrategy.ResolutionStrategyWithCurrent;
|
|
|
import org.gradle.api.Action;
|
|
|
|
|
|
import java.io.File;
|
|
@@ -115,11 +117,16 @@ public class UpdateDependenciesExtension {
|
|
|
*/
|
|
|
public class DependencyExcludes {
|
|
|
private List<Action<ComponentSelectionWithCurrent>> actions = new ArrayList<>();
|
|
|
+ private List<Action<ComponentSelectionRulesWithCurrent>> components = new ArrayList<>();
|
|
|
|
|
|
List<Action<ComponentSelectionWithCurrent>> getActions() {
|
|
|
return actions;
|
|
|
}
|
|
|
|
|
|
+ public List<Action<ComponentSelectionRulesWithCurrent>> getComponents() {
|
|
|
+ return components;
|
|
|
+ }
|
|
|
+
|
|
|
public DependencyExcludes alphaBetaVersions() {
|
|
|
this.actions.add(excludeVersionWithRegex("(?i).*?(alpha|beta).*", "an alpha or beta version"));
|
|
|
return this;
|
|
@@ -155,6 +162,11 @@ public class UpdateDependenciesExtension {
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
+ public DependencyExcludes addRule(Action<ComponentSelectionRulesWithCurrent> rule) {
|
|
|
+ this.components.add(rule);
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
private Action<ComponentSelectionWithCurrent> excludeVersionWithRegex(String regex, String reason) {
|
|
|
Pattern pattern = Pattern.compile(regex);
|
|
|
return (selection) -> {
|