|
| 1 | +def springAiVersion = '2.0.0' |
| 2 | + |
| 3 | +muzzle { |
| 4 | + // The sibling SDK-level modules (openai_2_15_0, anthropic_2_2_0) are on this project's |
| 5 | + // classpath for client-wrapping reuse, so their instrumentation modules are discovered by |
| 6 | + // muzzle too — each pass must ignore the other provider's modules. |
| 7 | + pass { |
| 8 | + group = 'org.springframework.ai' |
| 9 | + module = 'spring-ai-openai' |
| 10 | + versions = "[${springAiVersion},)" |
| 11 | + ignoredInstrumentation = [ |
| 12 | + "dev.braintrust.instrumentation.springai.v2_0_0.auto.SpringAIAnthropicInstrumentationModule", |
| 13 | + "dev.braintrust.instrumentation.anthropic.v2_2_0.auto.AnthropicInstrumentationModule", |
| 14 | + ] |
| 15 | + } |
| 16 | + pass { |
| 17 | + group = 'org.springframework.ai' |
| 18 | + module = 'spring-ai-anthropic' |
| 19 | + versions = "[${springAiVersion},)" |
| 20 | + ignoredInstrumentation = [ |
| 21 | + "dev.braintrust.instrumentation.springai.v2_0_0.auto.SpringAIOpenAIInstrumentationModule", |
| 22 | + "dev.braintrust.instrumentation.openai.v2_15_0.auto.OpenAIInstrumentationModule", |
| 23 | + ] |
| 24 | + } |
| 25 | +} |
| 26 | + |
| 27 | +dependencies { |
| 28 | + compileOnly project(':braintrust-java-agent:instrumenter') |
| 29 | + implementation "io.opentelemetry:opentelemetry-api:${otelVersion}" |
| 30 | + implementation 'com.google.code.findbugs:jsr305:3.0.2' |
| 31 | + implementation "org.slf4j:slf4j-api:${slf4jVersion}" |
| 32 | + implementation project(':braintrust-sdk') |
| 33 | + |
| 34 | + // Spring AI 2.0 delegates all HTTP to the official provider SDKs (openai-java, |
| 35 | + // anthropic-java), so this module reuses the client wrapping from the SDK-level |
| 36 | + // instrumentation modules instead of instrumenting Spring's HTTP layer (which no |
| 37 | + // longer exists in 2.0). |
| 38 | + implementation project(':braintrust-sdk:instrumentation:openai_2_15_0') |
| 39 | + implementation project(':braintrust-sdk:instrumentation:anthropic_2_2_0') |
| 40 | + |
| 41 | + // ByteBuddy for ElementMatcher types used in instrumentation definitions |
| 42 | + compileOnly 'net.bytebuddy:byte-buddy:1.17.5' |
| 43 | + |
| 44 | + // Test dependencies |
| 45 | + testImplementation(testFixtures(project(":test-harness"))) |
| 46 | + testImplementation project(':braintrust-java-agent:instrumenter') |
| 47 | + testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}" |
| 48 | + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' |
| 49 | + testImplementation 'net.bytebuddy:byte-buddy-agent:1.17.5' |
| 50 | + testRuntimeOnly "org.slf4j:slf4j-simple:${slf4jVersion}" |
| 51 | + testImplementation "org.springframework.ai:spring-ai-model:${springAiVersion}" |
| 52 | + testImplementation "org.springframework.ai:spring-ai-openai:${springAiVersion}" |
| 53 | + testImplementation "org.springframework.ai:spring-ai-anthropic:${springAiVersion}" |
| 54 | +} |
| 55 | + |
| 56 | +test { |
| 57 | + useJUnitPlatform() |
| 58 | + workingDir = rootProject.projectDir |
| 59 | + testLogging { |
| 60 | + events "passed", "skipped", "failed" |
| 61 | + showStandardStreams = true |
| 62 | + exceptionFormat "full" |
| 63 | + } |
| 64 | +} |
0 commit comments