Skip to content

Commit

Permalink
Merge pull request #101 from breedx-splk/rollback_dependency_mgmt
Browse files Browse the repository at this point in the history
Rollback dependency mgmt
  • Loading branch information
breedx-splk authored Oct 3, 2023
2 parents 1f023bb + 3b29586 commit 30fc647
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
}

dependencies {
implementation("com.squareup.okhttp3:okhttp:4.11.0")
implementation(project(":auto-instrumentation:okhttp:okhttp-3.0:library"))
implementation("net.bytebuddy:byte-buddy:${property("bytebuddy.version")}")
}
10 changes: 6 additions & 4 deletions auto-instrumentation/okhttp/okhttp-3.0/library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ plugins {
id("otel.publish-conventions")
}

val otelVersion = project.property("otel.sdk.version")
dependencies {
// Pin at 3.0.0 for api compatibility
api("com.squareup.okhttp3:okhttp:3.0.0")
api("io.opentelemetry.instrumentation:opentelemetry-okhttp-3.0")
implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv")
// pin okhttp api at 3.0.0 for now
//noinspection GradleDependency
compileOnly("com.squareup.okhttp3:okhttp:3.0.0")
api("io.opentelemetry.instrumentation:opentelemetry-okhttp-3.0:$otelVersion-alpha")
implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:$otelVersion-alpha")
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientResendCount;
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientResend;
import io.opentelemetry.instrumentation.api.instrumenter.net.PeerServiceAttributesExtractor;
import io.opentelemetry.instrumentation.library.okhttp.v3_0.OkHttpInstrumentationConfig;
import io.opentelemetry.instrumentation.okhttp.v3_0.internal.ConnectionErrorSpanInterceptor;
Expand All @@ -38,8 +38,6 @@ public final class OkHttp3Singletons {
OkHttpInstrumentationConfig
.getCapturedResponseHeaders())
.setKnownMethods(OkHttpInstrumentationConfig.getKnownMethods()),
builder ->
builder.setKnownMethods(OkHttpInstrumentationConfig.getKnownMethods()),
singletonList(
PeerServiceAttributesExtractor.create(
OkHttpAttributesGetter.INSTANCE,
Expand All @@ -48,8 +46,7 @@ public final class OkHttp3Singletons {

public static final Interceptor CONTEXT_INTERCEPTOR =
chain -> {
try (Scope ignored =
HttpClientResendCount.initialize(Context.current()).makeCurrent()) {
try (Scope ignored = HttpClientResend.initialize(Context.current()).makeCurrent()) {
return chain.proceed(chain.request());
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ plugins {
dependencies {
byteBuddy(project(":auto-instrumentation:okhttp:okhttp-3.0:agent"))
implementation(project(":auto-instrumentation:okhttp:okhttp-3.0:library"))
implementation("com.squareup.okhttp3:okhttp")
androidTestImplementation("com.squareup.okhttp3:mockwebserver:${rootProject.extra["okhttpVersion"]}")
implementation("com.squareup.okhttp3:okhttp:4.11.0")
androidTestImplementation("com.squareup.okhttp3:mockwebserver:4.11.0")
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ android {
}
}

val otelVersion = rootProject.property("otel.sdk.version")
dependencies {
implementation(platform(project(":dependencyManagement")))

androidTestImplementation("androidx.test:runner:${rootProject.extra["androidTestRunnerVersion"]}")
androidTestImplementation("io.opentelemetry:opentelemetry-sdk-testing:${rootProject.extra["otelSdkVersion"]}")
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestImplementation("io.opentelemetry:opentelemetry-sdk-testing:$otelVersion")
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@ android {
sourceCompatibility(javaVersion)
targetCompatibility(javaVersion)
}

dependencies {
implementation(platform(project(":dependencyManagement")))
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import gradle.kotlin.dsl.accessors._98848321c7233c2f7fb697478033dcb2.implementation
import ru.vyarus.gradle.plugin.animalsniffer.AnimalSniffer

plugins {
Expand All @@ -14,7 +13,6 @@ java {
}

dependencies {
implementation(platform(project(":dependencyManagement")))
signature("com.toasttab.android:gummy-bears-api-${project.property("android.minSdk")}:0.5.1:coreLib@signature")
implementation("com.google.code.findbugs:jsr305:3.0.2")
}
Expand Down
59 changes: 0 additions & 59 deletions dependencyManagement/build.gradle.kts

This file was deleted.

1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ android.defaults.buildfeatures.buildconfig=true
android.minSdk=21
android.targetSdk=23
android.compileSdk=34
otel.sdk.version=1.29.0
bytebuddy.version=1.14.8

version=0.2.0
Expand Down
21 changes: 11 additions & 10 deletions instrumentation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ android {
}

dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.core:core:1.12.0")
implementation("androidx.navigation:navigation-fragment:2.7.3")

implementation("androidx.appcompat:appcompat")
implementation("androidx.core:core")
implementation("androidx.navigation:navigation-fragment")

api(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${property("otel.sdk.version")}-alpha"))
api("io.opentelemetry:opentelemetry-api")
implementation("io.opentelemetry:opentelemetry-sdk")
implementation("io.opentelemetry:opentelemetry-exporter-zipkin")
Expand All @@ -71,16 +71,17 @@ dependencies {
implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api")
implementation("io.opentelemetry:opentelemetry-semconv")

testImplementation("org.mockito:mockito-core")
testImplementation("org.mockito:mockito-junit-jupiter")
testImplementation("org.mockito:mockito-core:5.5.0")
testImplementation("org.mockito:mockito-junit-jupiter:5.5.0")
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-engine")
testImplementation("org.junit.vintage:junit-vintage-engine")
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
testImplementation("org.robolectric:robolectric")
testImplementation("androidx.test:core")
testImplementation("org.assertj:assertj-core")
testImplementation("org.awaitility:awaitility")
testImplementation("org.robolectric:robolectric:4.10.3")
testImplementation("androidx.test:core:1.5.0")
testImplementation("org.assertj:assertj-core:3.24.2")
testImplementation("org.awaitility:awaitility:4.2.0")

coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")
}
Expand Down
6 changes: 6 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
"matchUpdateTypes": ["major", "minor"],
"enabled": false
},
{
// pin okhttp at 3.0.0 for api compatibility
"matchPackageNames": ["com.squareup.okhttp3:okhttp"],
"matchUpdateTypes": ["major", "minor"],
"enabled": false
},
{
// somehow renovate gets confused by the android property in gradle.properties,
// so let's just exclude it and hopefully clean up the dashboard
Expand Down
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
rootProject.name = "opentelemetry-android"

include(":instrumentation")
include(":dependencyManagement")
include(":auto-instrumentation:okhttp:okhttp-3.0:agent")
include(":auto-instrumentation:okhttp:okhttp-3.0:library")
include(":auto-instrumentation:okhttp:okhttp-3.0:testing")

0 comments on commit 30fc647

Please sign in to comment.