Skip to content

Commit e923152

Browse files
committed
Add plugins to handle version updates
1 parent 91dc656 commit e923152

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ plugins {
1919
alias(libs.plugins.plugin.publish)
2020
id 'java-gradle-plugin'
2121
alias(libs.plugins.animalsniffer)
22+
alias(libs.plugins.version.catalog.update)
23+
alias(libs.plugins.versions)
2224
}
2325

2426
apply plugin: 'com.github.hierynomus.license'
@@ -220,6 +222,14 @@ pluginBundle {
220222
}
221223
}
222224

225+
versionCatalogUpdate {
226+
versionSelector {
227+
// here 'it' is a ModuleVersionCandidate that can be used to determine if the version
228+
// is allowed, returning true if it is.
229+
!(it.candidate.version.contains('SNAPSHOT') || it.candidate.version.contains('ALPHA'))
230+
}
231+
}
232+
223233
if (!System.env.containsKey("JENKINS_URL")) {
224234
def javaVersion = System.properties['java.version']
225235
if (JavaVersion.toVersion(javaVersion) != project.targetCompatibility) {

gradle/libs.versions.toml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
11
[versions]
2-
spock = "2.0-M5-groovy-3.0"
3-
nebulaTest = "8.1.0"
4-
junit = "4.13.1"
5-
guava = "17.0"
62
androidGradlePlugin = "4.1.0"
7-
plexusUtils = "2.0.5"
8-
xmltool = "3.3"
3+
animalsniffer = "1.5.3"
4+
axionRelease = "1.11.0"
5+
guava = "17.0"
6+
junit = "4.13.1"
97
licenseMavenPlugin = "3.0"
8+
nebulaTest = "8.1.0"
9+
plexusUtils = "2.0.5"
1010
pluginPublish = "0.14.0"
11-
axionRelease = "1.11.0"
12-
animalsniffer = "1.5.3"
11+
spock = "2.0-M5-groovy-3.0"
12+
versionCatalogUpdate = "0.8.4"
13+
versions = "0.51.0"
14+
xmltool = "3.3"
1315

1416
[libraries]
17+
android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" }
18+
guava = { module = "com.google.guava:guava", version.ref = "guava" }
19+
junit = { module = "junit:junit", version.ref = "junit" }
20+
license-maven-plugin = { module = "com.mycila:license-maven-plugin", version.ref = "licenseMavenPlugin" }
21+
nebula-test = { module = "com.netflix.nebula:nebula-test", version.ref = "nebulaTest" }
22+
plexus-utils = { module = "org.codehaus.plexus:plexus-utils", version.ref = "plexusUtils" }
1523
spock-bom = { module = "org.spockframework:spock-bom", version.ref = "spock" }
1624
spock-core = { module = "org.spockframework:spock-core" }
1725
spock-junit4 = { module = "org.spockframework:spock-junit4" }
18-
nebula-test = { module = "com.netflix.nebula:nebula-test", version.ref = "nebulaTest" }
19-
junit = { module = "junit:junit", version.ref = "junit" }
20-
guava = { module = "com.google.guava:guava", version.ref = "guava" }
21-
android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" }
22-
plexus-utils = { module = "org.codehaus.plexus:plexus-utils", version.ref = "plexusUtils" }
2326
xmltool = { module = "com.mycila.xmltool:xmltool", version.ref = "xmltool" }
24-
license-maven-plugin = { module = "com.mycila:license-maven-plugin", version.ref = "licenseMavenPlugin" }
2527

2628
[plugins]
27-
plugin-publish = { id = "com.gradle.plugin-publish", version.ref = "pluginPublish" }
28-
axion-release = { id = "pl.allegro.tech.build.axion-release", version.ref = "axionRelease" }
2929
animalsniffer = { id = "ru.vyarus.animalsniffer", version.ref = "animalsniffer" }
30+
axion-release = { id = "pl.allegro.tech.build.axion-release", version.ref = "axionRelease" }
31+
plugin-publish = { id = "com.gradle.plugin-publish", version.ref = "pluginPublish" }
32+
version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "versionCatalogUpdate" }
33+
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }

0 commit comments

Comments
 (0)