@@ -11,18 +11,11 @@ plugins {
1111}
1212
1313/* *
14- * The latest *released* version of the project. Evaluated lazily so the work is only done if necessary.
14+ * The baseline version japicmp compares against. Pinned in build.gradle.kts and bumped
15+ * atomically with docs/apidiffs/current_vs_latest/ by the post-release PR opened from
16+ * .github/workflows/release.yml.
1517 */
16- val latestReleasedVersion: String by lazy {
17- // hack to find the current released version of the project
18- val temp: Configuration = configurations.create(" tempConfig" )
19- temp.resolutionStrategy.cacheDynamicVersionsFor(0 , TimeUnit .SECONDS )
20- dependencies.add(temp.name, " io.opentelemetry.semconv:opentelemetry-semconv:latest.release" )
21- val moduleVersion = configurations[" tempConfig" ].resolvedConfiguration.firstLevelModuleDependencies.elementAt(0 ).moduleVersion
22- configurations.remove(temp)
23- logger.debug(" Discovered latest release version: " + moduleVersion)
24- moduleVersion
25- }
18+ val apidiffBaselineVersion = rootProject.extra[" apidiffBaselineVersion" ] as String
2619
2720class SourceIncompatibleRule : AbstractRecordingSeenMembers () {
2821 override fun maybeAddViolation (member : JApiCompatibility ): Violation ? {
@@ -71,9 +64,9 @@ if (!project.hasProperty("otel.release")) {
7164 // only output changes, not everything
7265 onlyModified.set(true )
7366
74- // the japicmp "old" version is either the user-specified one, or the latest release .
67+ // the japicmp "old" version is either the user-specified one, or the pinned baseline .
7568 val apiBaseVersion: String? by project
76- val baselineVersion = apiBaseVersion ? : latestReleasedVersion
69+ val baselineVersion = apiBaseVersion ? : apidiffBaselineVersion
7770 oldClasspath.from(
7871 try {
7972 files(findArtifact(baselineVersion))
0 commit comments