@@ -11,20 +11,12 @@ 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 version.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- // pick the bom, since we don't use dependency substitution on it.
21- dependencies.add(temp.name, " io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:latest.release" )
22- val moduleVersion = configurations[" tempConfig" ].resolvedConfiguration.firstLevelModuleDependencies.elementAt(0 ).moduleVersion
23-
24- configurations.remove(temp)
25- logger.info(" Discovered latest release version: $moduleVersion " )
26- moduleVersion
27- }
18+ val apidiffBaselineVersion: String =
19+ rootProject.extra[" apidiffBaselineVersion" ] as String
2820
2921/* *
3022 * Locate the project's artifact of a particular version.
@@ -68,7 +60,7 @@ if (project.findProperty("otel.stable") == "true" && project.path != ":javaagent
6860
6961 // the japicmp "old" version is either the user-specified one, or the latest release.
7062 val apiBaseVersion: String? by project
71- val baselineVersion = apiBaseVersion ? : latestReleasedVersion
63+ val baselineVersion = apiBaseVersion ? : apidiffBaselineVersion
7264 oldClasspath.from(
7365 try {
7466 files(findArtifact(baselineVersion))
0 commit comments