Skip to content

Commit 712d375

Browse files
committed
more pinning
1 parent 15cb491 commit 712d375

4 files changed

Lines changed: 32 additions & 14 deletions

File tree

.github/config/latest-dep-versions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
"com.github.etaty:rediscala_2.13#+": "1.9.0",
4444
"com.github.oshi:oshi-core#+": "6.12.0",
4545
"com.google.guava:guava#+": "33.6.0-jre",
46+
"com.google.gwt:gwt-dev#+": "2.10.0",
4647
"com.google.gwt:gwt-servlet#+": "2.10.0",
48+
"com.google.gwt:gwt-user#+": "2.10.0",
4749
"com.google.http-client:google-http-client#+": "2.1.0",
4850
"com.graphql-java:graphql-java#+": "25.0",
4951
"com.graphql-java:graphql-java#19.+": "19.11",
@@ -379,7 +381,9 @@
379381
"org.glassfish:javax.faces#2.+": "2.4.0",
380382
"org.grails:grails-plugin-url-mappings#+": "6.2.3",
381383
"org.grails:grails-web-url-mappings#+": "6.2.3",
384+
"org.gwtproject:gwt-dev#+": "2.13.0",
382385
"org.gwtproject:gwt-servlet#+": "2.13.0",
386+
"org.gwtproject:gwt-user#+": "2.13.0",
383387
"org.hibernate.orm:hibernate-core#+": "7.3.2.Final",
384388
"org.hibernate.reactive:hibernate-reactive-core#+": "4.3.3.Final",
385389
"org.hibernate.reactive:hibernate-reactive-core#1.+": "1.1.9.Final",

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,11 @@ configurations {
172172
// affected by overrides intended for the main test suite.
173173
val applyOverrides = name.startsWith("test") || name.startsWith("latestDepTest")
174174
// Pinning of `latest.release`/`+` versions is applied broadly (case-insensitive "test"
175-
// match) so that custom JvmTestSuite source sets are also reproducible.
176-
val applyPinning = pinLatestDeps && name.contains("test", ignoreCase = true)
175+
// match) so that custom JvmTestSuite source sets are also reproducible. Also include the
176+
// main `compileClasspath` so that modules using `dependencySubstitution` to swap groups
177+
// for the agent's compile classpath (e.g. gwt-2.0) get pinned versions in latest mode.
178+
val applyPinning = pinLatestDeps &&
179+
(name.contains("test", ignoreCase = true) || name == "compileClasspath")
177180
if (!applyOverrides && !applyPinning) return@configureEach
178181
resolutionStrategy.eachDependency {
179182
if (applyOverrides) {

conventions/src/main/kotlin/otel.resolve-latest-dep-versions.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ tasks {
7878

7979
subprojects {
8080
configurations
81-
.filter { it.isCanBeResolved && it.name.contains("test", ignoreCase = true) && it.name.endsWith("RuntimeClasspath") }
81+
.filter {
82+
it.isCanBeResolved &&
83+
((it.name.contains("test", ignoreCase = true) && it.name.endsWith("RuntimeClasspath")) ||
84+
it.name == "compileClasspath")
85+
}
8286
.forEach { config ->
8387
config.incoming.resolutionResult.allDependencies.forEach { dep ->
8488
if (dep is org.gradle.api.artifacts.result.ResolvedDependencyResult) {

instrumentation/gwt-2.0/javaagent/build.gradle.kts

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,26 @@ sourceSets {
3030
}
3131
}
3232

33+
// GWT moved from `com.google.gwt` to `org.gwtproject` in 2.10.0. In latest-deps mode,
34+
// rewrite every `com.google.gwt:gwt-*` coordinate to the new group so the agent compiles
35+
// and tests against the modern artifacts. The version is left as `latest.release` and
36+
// gets pinned to a concrete release by the convention plugin's standard pinning hook.
37+
if (otelProps.testLatestDeps) {
38+
configurations.configureEach {
39+
resolutionStrategy.dependencySubstitution {
40+
listOf("gwt-user", "gwt-dev", "gwt-servlet").forEach { artifact ->
41+
substitute(module("com.google.gwt:$artifact"))
42+
.using(module("org.gwtproject:$artifact:latest.release"))
43+
}
44+
}
45+
}
46+
}
47+
3348
dependencies {
3449
// these are needed for compileGwt task
35-
if (otelProps.testLatestDeps) {
36-
compileOnly("org.gwtproject:gwt-user:latest.release")
37-
compileOnly("org.gwtproject:gwt-dev:latest.release")
38-
compileOnly("org.gwtproject:gwt-servlet:latest.release")
39-
testImplementation("org.gwtproject:gwt-servlet:latest.release")
40-
} else {
41-
compileOnly("com.google.gwt:gwt-user:2.0.0")
42-
compileOnly("com.google.gwt:gwt-dev:2.0.0")
43-
compileOnly("com.google.gwt:gwt-servlet:2.0.0")
44-
testImplementation("com.google.gwt:gwt-servlet:2.0.0")
45-
}
50+
library("com.google.gwt:gwt-user:2.0.0")
51+
library("com.google.gwt:gwt-dev:2.0.0")
52+
library("com.google.gwt:gwt-servlet:2.0.0")
4653

4754
testInstrumentation(project(":instrumentation:servlet:servlet-3.0:javaagent"))
4855
testInstrumentation(project(":instrumentation:jetty:jetty-8.0:javaagent"))

0 commit comments

Comments
 (0)