Skip to content

Commit dafb251

Browse files
committed
another simplification:
1 parent e912810 commit dafb251

1 file changed

Lines changed: 12 additions & 20 deletions

File tree

conventions/src/main/kotlin/io.opentelemetry.instrumentation.base.gradle.kts

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -162,29 +162,21 @@ configurations {
162162
// "latest.release" or "+" versions (e.g. transitive deps) gets pinned to a concrete
163163
// version from the JSON file.
164164
if (otelProps.testLatestDeps) {
165+
// Apply latestDepTestLibrary overrides and pinned versions to every resolvable
166+
// configuration. Both maps only contain entries the module author explicitly opted into
167+
// (`latestDepTestLibrary(...)` declarations and `library`/`testLibrary` artifacts pinned
168+
// in latest-dep-versions.json), and the lookups are no-ops for unrelated artifacts and
169+
// for concrete versions — so broad application costs nothing but keeps every dynamic
170+
// version in the build reproducible, including custom JvmTestSuite source sets and
171+
// `compileClasspath` entries rewritten via dependencySubstitution (e.g. gwt-2.0).
165172
configureEach {
166173
if (!isCanBeResolved) return@configureEach
167-
// latestDepTestLibrary overrides only apply to the main test/latestDepTest configurations.
168-
// Custom JvmTestSuite source sets (e.g. `version20TestRuntimeClasspath`,
169-
// `play24TestRuntimeClasspath`) declare their own explicit versions and must not be
170-
// affected by overrides intended for the main test suite. Overrides also must not leak
171-
// into build-tool configurations like Zinc (the Scala compiler) where overriding
172-
// scala-library would break compilation.
173-
val applyOverrides = name.startsWith("test") || name.startsWith("latestDepTest")
174-
// Pinning of `latest.release`/`+` versions is applied to every configuration. The pin
175-
// lookup is a no-op for concrete versions (the only kind in build-tool configurations
176-
// like Zinc), so applying broadly costs nothing but keeps every dynamic version in the
177-
// build reproducible — including custom JvmTestSuite source sets and `compileClasspath`
178-
// entries rewritten via dependencySubstitution (e.g. gwt-2.0).
179-
if (!applyOverrides && !pinLatestDeps) return@configureEach
180174
resolutionStrategy.eachDependency {
181-
if (applyOverrides) {
182-
// latestDepTestLibrary overrides take priority over pinned versions
183-
val override = latestDepTestLibraryOverrides["${requested.group}:${requested.name}"]
184-
if (override != null) {
185-
useVersion(override)
186-
return@eachDependency
187-
}
175+
// latestDepTestLibrary overrides take priority over pinned versions
176+
val override = latestDepTestLibraryOverrides["${requested.group}:${requested.name}"]
177+
if (override != null) {
178+
useVersion(override)
179+
return@eachDependency
188180
}
189181
if (pinLatestDeps) {
190182
val pinnedVersion = lookupPinnedVersion(requested.group, requested.name, requested.version)

0 commit comments

Comments
 (0)