Skip to content

Commit e2a0a22

Browse files
committed
use version properties for Groovy versions:
* performance baselines default to latest v3, v4, v5 but can have hard-coded versions too * binaryCompatBaseline has a similar latest version approach, but we can also fix in gradle.properties or a system property
1 parent 7126136 commit e2a0a22

5 files changed

Lines changed: 13 additions & 9 deletions

File tree

build-logic/src/main/groovy/org.apache.groovy-dep-updates.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,16 @@ def jdkRejections = new java.util.concurrent.ConcurrentHashMap<String, Set<Strin
3131
// Used for two purposes:
3232
// * hint-skip gate in depUpHints (suppress misleading cross-track bump hints)
3333
// * in-track update detection in depUpCapped (proactively warn when a newer
34-
// within-track version is available, e.g. binary-compat baseline drift)
35-
// TODO: migrate performance-test baselines ('3.0.25', '4.0.31', '5.0.5' currently hardcoded
36-
// in subprojects/performance/build.gradle:24) into versions.properties and add
37-
// matching cappedTracks entries so depUpCapped surfaces drift on those too.
34+
// within-track version is available, e.g. Groovy baseline drift on each mainline)
3835
def cappedTracks = [
3936
[group: 'org.junit.jupiter', name: 'junit-jupiter', current: versions.junit5, maxPrefix: '5.'],
4037
[group: 'org.junit.jupiter', name: 'junit-jupiter-api', current: versions.junit5, maxPrefix: '5.'],
4138
[group: 'org.junit.jupiter', name: 'junit-jupiter-engine', current: versions.junit5, maxPrefix: '5.'],
4239
[group: 'org.junit.jupiter', name: 'junit-jupiter-params', current: versions.junit5, maxPrefix: '5.'],
4340
[group: 'org.junit.platform', name: 'junit-platform-launcher', current: versions.junit5Platform, maxPrefix: '1.'],
44-
[group: 'org.apache.groovy', name: 'groovy',
45-
current: sharedConfiguration.binaryCompatibilityBaselineVersion.get(), maxPrefix: '5.0.'],
41+
[group: 'org.codehaus.groovy', name: 'groovy', current: versions.latest3, maxPrefix: '3.0.'],
42+
[group: 'org.apache.groovy', name: 'groovy', current: versions.latest4, maxPrefix: '4.0.'],
43+
[group: 'org.apache.groovy', name: 'groovy', current: versions.latest5, maxPrefix: '5.0.'],
4644
]
4745
def capByCoord = cappedTracks.collectEntries { [("${it.group}:${it.name}".toString()): it.maxPrefix] }
4846

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ groovyBundleVersion=6.0.0.SNAPSHOT
2020
groovyTargetBytecodeVersion=17
2121
targetJavaVersion=17
2222

23-
binaryCompatibilityBaseline=5.0.4
23+
binaryCompatibilityBaseline=versions.latest5
2424
gradle_version=9.4.0
2525

2626
groovyJUnit_ms=512m

subprojects/binary-compatibility/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ rootProject.allprojects {
3838
pluginManager.withPlugin('org.apache.groovy-base') {
3939
if (groovyLibrary.checkBinaryCompatibility.get()) {
4040
def taskName = "japicmp${project.name.split('-').collect{ it.capitalize() }.join()}"
41-
def baselineCoords = "org.apache.groovy:${project.name}:${sharedConfiguration.binaryCompatibilityBaselineVersion.get()}@jar"
41+
// Accept either an explicit version ('5.0.4') or a pseudo-property reference ('versions.latest5')
42+
def rawBaseline = sharedConfiguration.binaryCompatibilityBaselineVersion.get()
43+
def baselineVersion = rawBaseline.startsWith('versions.') ? versions."${rawBaseline.substring('versions.'.length())}" : rawBaseline
44+
def baselineCoords = "org.apache.groovy:${project.name}:${baselineVersion}@jar"
4245
def baseline = thisProject.configurations.create("${taskName}Baseline") {
4346
dependencies.add(thisProject.dependencies.create(baselineCoords))
4447
}

subprojects/performance/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ plugins {
2121
}
2222

2323
performanceTests {
24-
versions 'current', '3.0.25', '4.0.31', '5.0.5'
24+
versions 'current', versions.latest3, versions.latest4, versions.latest5
2525

2626
testFiles project.files("src/files") +
2727
project.files('src/jmh/groovy/org/apache/groovy/bench/Ackermann.groovy') +

versions.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ junit=4.13.2
4545
junit5=5.14.3
4646
junit5Platform=1.14.3
4747
junit6=6.0.3
48+
latest3=3.0.25
49+
latest4=4.0.31
50+
latest5=5.0.5
4851
log4j=1.2.17
4952
log4j2=2.25.3
5053
logback=1.5.32

0 commit comments

Comments
 (0)