File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ import com.github.benmanes.gradle.versions.reporter.PlainTextReporter
2+ import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
13import org.gradle.accessors.dm.LibrariesForLibs
24
35plugins {
@@ -94,3 +96,45 @@ configure<org.checkerframework.gradle.plugin.CheckerFrameworkExtension> {
9496 )
9597}
9698
99+
100+
101+
102+
103+ tasks.withType<DependencyUpdatesTask > {
104+ rejectVersionIf {
105+ candidate.version.isNonStable()
106+ }
107+
108+ outputFormatter {
109+ exceeded.dependencies.removeIf { d -> ignore.contains(" ${d.group} :${d.name} " ) }
110+
111+ val plainTextReporter = PlainTextReporter (
112+ project,
113+ revision,
114+ gradleReleaseChannel
115+ )
116+ plainTextReporter.write(System .out , this )
117+ }
118+ }
119+
120+
121+ fun String.isNonStable (): Boolean {
122+ val nonStable = listOf (
123+ " .M[0-9]+$" ,
124+ " .RC[0-9]*$" ,
125+ " .alpha[0-9]+$" ,
126+ " .beta[0-9]+$" ,
127+ )
128+
129+ for (n in nonStable) {
130+ if (this .contains(" (?i)$n " .toRegex())) {
131+ return true
132+ }
133+ }
134+
135+ return false
136+ }
137+
138+ val ignore = listOf (
139+ " org.checkerframework:jdk8"
140+ )
You can’t perform that action at this time.
0 commit comments