From 80e1029754ce50a15f884bb35bf6f10549071749 Mon Sep 17 00:00:00 2001 From: stefanosiano Date: Mon, 24 Jun 2024 18:32:55 +0200 Subject: [PATCH 1/3] removed sentry-android-okhttp module --- .craft.yml | 1 - .github/ISSUE_TEMPLATE/bug_report_android.yml | 4 +- .github/workflows/system-tests-backend.yml | 2 +- README.md | 1 - build.gradle.kts | 2 - .../api/sentry-android-okhttp.api | 62 ------ sentry-android-okhttp/build.gradle.kts | 83 -------- sentry-android-okhttp/proguard-rules.pro | 13 -- .../okhttp/SentryOkHttpEventListener.kt | 201 ------------------ .../android/okhttp/SentryOkHttpInterceptor.kt | 79 ------- .../src/main/res/values/public.xml | 4 - .../sentry-samples-android/build.gradle.kts | 2 +- settings.gradle.kts | 1 - 13 files changed, 4 insertions(+), 451 deletions(-) delete mode 100644 sentry-android-okhttp/api/sentry-android-okhttp.api delete mode 100644 sentry-android-okhttp/build.gradle.kts delete mode 100644 sentry-android-okhttp/proguard-rules.pro delete mode 100644 sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEventListener.kt delete mode 100644 sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpInterceptor.kt delete mode 100644 sentry-android-okhttp/src/main/res/values/public.xml diff --git a/.craft.yml b/.craft.yml index d50705f433..c08a321343 100644 --- a/.craft.yml +++ b/.craft.yml @@ -37,7 +37,6 @@ targets: maven:io.sentry:sentry-android-core: maven:io.sentry:sentry-android-ndk: maven:io.sentry:sentry-android-timber: - maven:io.sentry:sentry-android-okhttp: maven:io.sentry:sentry-kotlin-extensions: maven:io.sentry:sentry-android-fragment: maven:io.sentry:sentry-bom: diff --git a/.github/ISSUE_TEMPLATE/bug_report_android.yml b/.github/ISSUE_TEMPLATE/bug_report_android.yml index 9b6bfc9ff6..20db87e363 100644 --- a/.github/ISSUE_TEMPLATE/bug_report_android.yml +++ b/.github/ISSUE_TEMPLATE/bug_report_android.yml @@ -10,13 +10,13 @@ body: options: - sentry-android - sentry-android-ndk - - sentry-android-okhttp - sentry-android-timber - sentry-android-fragment - sentry-android-sqlite - sentry-apollo - - sentry-compose - sentry-apollo-3 + - sentry-compose + - sentry-okhttp - other validations: required: true diff --git a/.github/workflows/system-tests-backend.yml b/.github/workflows/system-tests-backend.yml index a916d8f9ac..6584228d51 100644 --- a/.github/workflows/system-tests-backend.yml +++ b/.github/workflows/system-tests-backend.yml @@ -46,7 +46,7 @@ jobs: - name: Exclude android modules from build run: | - sed -i -e '/.*"sentry-android-ndk",/d' -e '/.*"sentry-android",/d' -e '/.*"sentry-compose",/d' -e '/.*"sentry-android-core",/d' -e '/.*"sentry-android-fragment",/d' -e '/.*"sentry-android-navigation",/d' -e '/.*"sentry-android-okhttp",/d' -e '/.*"sentry-android-sqlite",/d' -e '/.*"sentry-android-timber",/d' -e '/.*"sentry-android-integration-tests:sentry-uitest-android-benchmark",/d' -e '/.*"sentry-android-integration-tests:sentry-uitest-android",/d' -e '/.*"sentry-android-integration-tests:test-app-sentry",/d' -e '/.*"sentry-samples:sentry-samples-android",/d' settings.gradle.kts + sed -i -e '/.*"sentry-android-ndk",/d' -e '/.*"sentry-android",/d' -e '/.*"sentry-compose",/d' -e '/.*"sentry-android-core",/d' -e '/.*"sentry-android-fragment",/d' -e '/.*"sentry-android-navigation",/d' -e '/.*"sentry-android-sqlite",/d' -e '/.*"sentry-android-timber",/d' -e '/.*"sentry-android-integration-tests:sentry-uitest-android-benchmark",/d' -e '/.*"sentry-android-integration-tests:sentry-uitest-android",/d' -e '/.*"sentry-android-integration-tests:test-app-sentry",/d' -e '/.*"sentry-samples:sentry-samples-android",/d' settings.gradle.kts - name: Exclude android modules from ignore list run: | diff --git a/README.md b/README.md index 338a59eba5..d6107cd267 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,6 @@ Sentry SDK for Java and Android | sentry-android | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android) | 19 | | sentry-android-core | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-core) | 19 | | sentry-android-ndk | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-ndk/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-ndk) | 19 | -| sentry-android-okhttp | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-okhttp/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-okhttp) | 21 | | sentry-android-timber | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-timber/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-timber) | 19 | | sentry-android-fragment | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-fragment/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-fragment) | 19 | | sentry-android-navigation | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-navigation/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-navigation) | 19 | diff --git a/build.gradle.kts b/build.gradle.kts index 03b5723da0..4b84c17aba 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -107,7 +107,6 @@ subprojects { "sentry-android-fragment", "sentry-android-navigation", "sentry-android-ndk", - "sentry-android-okhttp", "sentry-android-sqlite", "sentry-android-timber" ) @@ -291,7 +290,6 @@ private val androidLibs = setOf( "sentry-android-ndk", "sentry-android-fragment", "sentry-android-navigation", - "sentry-android-okhttp", "sentry-android-timber", "sentry-compose-android" ) diff --git a/sentry-android-okhttp/api/sentry-android-okhttp.api b/sentry-android-okhttp/api/sentry-android-okhttp.api deleted file mode 100644 index 35f42842dd..0000000000 --- a/sentry-android-okhttp/api/sentry-android-okhttp.api +++ /dev/null @@ -1,62 +0,0 @@ -public final class io/sentry/android/okhttp/BuildConfig { - public static final field BUILD_TYPE Ljava/lang/String; - public static final field DEBUG Z - public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String; - public static final field VERSION_NAME Ljava/lang/String; - public fun ()V -} - -public final class io/sentry/android/okhttp/SentryOkHttpEventListener : okhttp3/EventListener { - public fun ()V - public fun (Lio/sentry/IScopes;Lkotlin/jvm/functions/Function1;)V - public synthetic fun (Lio/sentry/IScopes;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public fun (Lio/sentry/IScopes;Lokhttp3/EventListener$Factory;)V - public synthetic fun (Lio/sentry/IScopes;Lokhttp3/EventListener$Factory;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public fun (Lio/sentry/IScopes;Lokhttp3/EventListener;)V - public synthetic fun (Lio/sentry/IScopes;Lokhttp3/EventListener;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public fun (Lokhttp3/EventListener$Factory;)V - public fun (Lokhttp3/EventListener;)V - public fun cacheConditionalHit (Lokhttp3/Call;Lokhttp3/Response;)V - public fun cacheHit (Lokhttp3/Call;Lokhttp3/Response;)V - public fun cacheMiss (Lokhttp3/Call;)V - public fun callEnd (Lokhttp3/Call;)V - public fun callFailed (Lokhttp3/Call;Ljava/io/IOException;)V - public fun callStart (Lokhttp3/Call;)V - public fun canceled (Lokhttp3/Call;)V - public fun connectEnd (Lokhttp3/Call;Ljava/net/InetSocketAddress;Ljava/net/Proxy;Lokhttp3/Protocol;)V - public fun connectFailed (Lokhttp3/Call;Ljava/net/InetSocketAddress;Ljava/net/Proxy;Lokhttp3/Protocol;Ljava/io/IOException;)V - public fun connectStart (Lokhttp3/Call;Ljava/net/InetSocketAddress;Ljava/net/Proxy;)V - public fun connectionAcquired (Lokhttp3/Call;Lokhttp3/Connection;)V - public fun connectionReleased (Lokhttp3/Call;Lokhttp3/Connection;)V - public fun dnsEnd (Lokhttp3/Call;Ljava/lang/String;Ljava/util/List;)V - public fun dnsStart (Lokhttp3/Call;Ljava/lang/String;)V - public fun proxySelectEnd (Lokhttp3/Call;Lokhttp3/HttpUrl;Ljava/util/List;)V - public fun proxySelectStart (Lokhttp3/Call;Lokhttp3/HttpUrl;)V - public fun requestBodyEnd (Lokhttp3/Call;J)V - public fun requestBodyStart (Lokhttp3/Call;)V - public fun requestFailed (Lokhttp3/Call;Ljava/io/IOException;)V - public fun requestHeadersEnd (Lokhttp3/Call;Lokhttp3/Request;)V - public fun requestHeadersStart (Lokhttp3/Call;)V - public fun responseBodyEnd (Lokhttp3/Call;J)V - public fun responseBodyStart (Lokhttp3/Call;)V - public fun responseFailed (Lokhttp3/Call;Ljava/io/IOException;)V - public fun responseHeadersEnd (Lokhttp3/Call;Lokhttp3/Response;)V - public fun responseHeadersStart (Lokhttp3/Call;)V - public fun satisfactionFailure (Lokhttp3/Call;Lokhttp3/Response;)V - public fun secureConnectEnd (Lokhttp3/Call;Lokhttp3/Handshake;)V - public fun secureConnectStart (Lokhttp3/Call;)V -} - -public final class io/sentry/android/okhttp/SentryOkHttpInterceptor : okhttp3/Interceptor { - public fun ()V - public fun (Lio/sentry/IScopes;)V - public fun (Lio/sentry/IScopes;Lio/sentry/android/okhttp/SentryOkHttpInterceptor$BeforeSpanCallback;ZLjava/util/List;Ljava/util/List;)V - public synthetic fun (Lio/sentry/IScopes;Lio/sentry/android/okhttp/SentryOkHttpInterceptor$BeforeSpanCallback;ZLjava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public fun (Lio/sentry/android/okhttp/SentryOkHttpInterceptor$BeforeSpanCallback;)V - public fun intercept (Lokhttp3/Interceptor$Chain;)Lokhttp3/Response; -} - -public abstract interface class io/sentry/android/okhttp/SentryOkHttpInterceptor$BeforeSpanCallback { - public abstract fun execute (Lio/sentry/ISpan;Lokhttp3/Request;Lokhttp3/Response;)Lio/sentry/ISpan; -} - diff --git a/sentry-android-okhttp/build.gradle.kts b/sentry-android-okhttp/build.gradle.kts deleted file mode 100644 index f3eaa59303..0000000000 --- a/sentry-android-okhttp/build.gradle.kts +++ /dev/null @@ -1,83 +0,0 @@ -import io.gitlab.arturbosch.detekt.Detekt -import org.jetbrains.kotlin.config.KotlinCompilerVersion - -plugins { - id("com.android.library") - kotlin("android") - jacoco - id(Config.QualityPlugins.jacocoAndroid) - id(Config.QualityPlugins.gradleVersions) - id(Config.QualityPlugins.detektPlugin) -} - -android { - compileSdk = Config.Android.compileSdkVersion - namespace = "io.sentry.android.okhttp" - - defaultConfig { - targetSdk = Config.Android.targetSdkVersion - minSdk = Config.Android.minSdkVersionOkHttp - - // for AGP 4.1 - buildConfigField("String", "VERSION_NAME", "\"${project.version}\"") - } - - buildTypes { - getByName("debug") - getByName("release") - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - kotlinOptions.languageVersion = Config.kotlinCompatibleLanguageVersion - } - - testOptions { - animationsDisabled = true - unitTests.apply { - isReturnDefaultValues = true - isIncludeAndroidResources = true - } - } - - lint { - warningsAsErrors = true - checkDependencies = true - - // We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks. - checkReleaseBuilds = false - } - - variantFilter { - if (Config.Android.shouldSkipDebugVariant(buildType.name)) { - ignore = true - } - } -} - -kotlin { - explicitApi() -} - -dependencies { - api(projects.sentry) - api(projects.sentryOkhttp) - - compileOnly(Config.Libs.okhttp) - - implementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION)) - - // tests - testImplementation(projects.sentryTestSupport) - testImplementation(Config.Libs.okhttp) - testImplementation(Config.TestLibs.kotlinTestJunit) - testImplementation(Config.TestLibs.androidxJunit) - testImplementation(Config.TestLibs.mockitoKotlin) - testImplementation(Config.TestLibs.mockitoInline) - testImplementation(Config.TestLibs.mockWebserver) -} - -tasks.withType { - // Target version of the generated JVM bytecode. It is used for type resolution. - jvmTarget = JavaVersion.VERSION_1_8.toString() -} diff --git a/sentry-android-okhttp/proguard-rules.pro b/sentry-android-okhttp/proguard-rules.pro deleted file mode 100644 index 3f9ea4feb2..0000000000 --- a/sentry-android-okhttp/proguard-rules.pro +++ /dev/null @@ -1,13 +0,0 @@ -##---------------Begin: proguard configuration for OkHttp ---------- - -# To ensure that stack traces is unambiguous -# https://developer.android.com/studio/build/shrink-code#decode-stack-trace --keepattributes LineNumberTable,SourceFile - -# https://square.github.io/okhttp/features/r8_proguard/ -# If you use OkHttp as a dependency in an Android project which uses R8 as a default compiler you -# don’t have to do anything. The specific rules are already bundled into the JAR which can -# be interpreted by R8 automatically. -# https://raw.githubusercontent.com/square/okhttp/master/okhttp/src/jvmMain/resources/META-INF/proguard/okhttp3.pro - -##---------------End: proguard configuration for OkHttp ---------- diff --git a/sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEventListener.kt b/sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEventListener.kt deleted file mode 100644 index f99106e8d9..0000000000 --- a/sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEventListener.kt +++ /dev/null @@ -1,201 +0,0 @@ -package io.sentry.android.okhttp - -import io.sentry.IScopes -import io.sentry.ScopesAdapter -import okhttp3.Call -import okhttp3.Connection -import okhttp3.EventListener -import okhttp3.Handshake -import okhttp3.HttpUrl -import okhttp3.Protocol -import okhttp3.Request -import okhttp3.Response -import java.io.IOException -import java.net.InetAddress -import java.net.InetSocketAddress -import java.net.Proxy - -/** - * Logs network performance event metrics to Sentry - * - * Usage - add instance of [SentryOkHttpEventListener] in [okhttp3.OkHttpClient.Builder.eventListener] - * - * ``` - * val client = OkHttpClient.Builder() - * .eventListener(SentryOkHttpEventListener()) - * .addInterceptor(SentryOkHttpInterceptor()) - * .build() - * ``` - * - * If you already use a [okhttp3.EventListener], you can pass it in the constructor. - * - * ``` - * val client = OkHttpClient.Builder() - * .eventListener(SentryOkHttpEventListener(myEventListener)) - * .addInterceptor(SentryOkHttpInterceptor()) - * .build() - * ``` - */ -@Deprecated( - "Use SentryOkHttpEventListener from sentry-okhttp instead", - ReplaceWith("SentryOkHttpEventListener", "io.sentry.okhttp.SentryOkHttpEventListener") -) -@Suppress("TooManyFunctions") -class SentryOkHttpEventListener( - scopes: IScopes = ScopesAdapter.getInstance(), - originalEventListenerCreator: ((call: Call) -> EventListener)? = null -) : EventListener() { - constructor() : this( - ScopesAdapter.getInstance(), - originalEventListenerCreator = null - ) - - constructor(originalEventListener: EventListener) : this( - ScopesAdapter.getInstance(), - originalEventListenerCreator = { originalEventListener } - ) - - constructor(originalEventListenerFactory: Factory) : this( - ScopesAdapter.getInstance(), - originalEventListenerCreator = { originalEventListenerFactory.create(it) } - ) - - constructor(scopes: IScopes = ScopesAdapter.getInstance(), originalEventListener: EventListener) : this( - scopes, - originalEventListenerCreator = { originalEventListener } - ) - - constructor(scopes: IScopes = ScopesAdapter.getInstance(), originalEventListenerFactory: Factory) : this( - scopes, - originalEventListenerCreator = { originalEventListenerFactory.create(it) } - ) - - private val delegate = io.sentry.okhttp.SentryOkHttpEventListener(scopes, originalEventListenerCreator) - - override fun cacheConditionalHit(call: Call, cachedResponse: Response) { - delegate.cacheConditionalHit(call, cachedResponse) - } - - override fun cacheHit(call: Call, response: Response) { - delegate.cacheHit(call, response) - } - - override fun cacheMiss(call: Call) { - delegate.cacheMiss(call) - } - - override fun callEnd(call: Call) { - delegate.callEnd(call) - } - - override fun callFailed(call: Call, ioe: IOException) { - delegate.callFailed(call, ioe) - } - - override fun callStart(call: Call) { - delegate.callStart(call) - } - - override fun canceled(call: Call) { - delegate.canceled(call) - } - - override fun connectEnd( - call: Call, - inetSocketAddress: InetSocketAddress, - proxy: Proxy, - protocol: Protocol? - ) { - delegate.connectEnd(call, inetSocketAddress, proxy, protocol) - } - - override fun connectFailed( - call: Call, - inetSocketAddress: InetSocketAddress, - proxy: Proxy, - protocol: Protocol?, - ioe: IOException - ) { - delegate.connectFailed(call, inetSocketAddress, proxy, protocol, ioe) - } - - override fun connectStart(call: Call, inetSocketAddress: InetSocketAddress, proxy: Proxy) { - delegate.connectStart(call, inetSocketAddress, proxy) - } - - override fun connectionAcquired(call: Call, connection: Connection) { - delegate.connectionAcquired(call, connection) - } - - override fun connectionReleased(call: Call, connection: Connection) { - delegate.connectionReleased(call, connection) - } - - override fun dnsEnd(call: Call, domainName: String, inetAddressList: List) { - delegate.dnsEnd(call, domainName, inetAddressList) - } - - override fun dnsStart(call: Call, domainName: String) { - delegate.dnsStart(call, domainName) - } - - override fun proxySelectEnd(call: Call, url: HttpUrl, proxies: List) { - delegate.proxySelectEnd(call, url, proxies) - } - - override fun proxySelectStart(call: Call, url: HttpUrl) { - delegate.proxySelectStart(call, url) - } - - override fun requestBodyEnd(call: Call, byteCount: Long) { - delegate.requestBodyEnd(call, byteCount) - } - - override fun requestBodyStart(call: Call) { - delegate.requestBodyStart(call) - } - - override fun requestFailed(call: Call, ioe: IOException) { - delegate.requestFailed(call, ioe) - } - - override fun requestHeadersEnd(call: Call, request: Request) { - delegate.requestHeadersEnd(call, request) - } - - override fun requestHeadersStart(call: Call) { - delegate.requestHeadersStart(call) - } - - override fun responseBodyEnd(call: Call, byteCount: Long) { - delegate.responseBodyEnd(call, byteCount) - } - - override fun responseBodyStart(call: Call) { - delegate.responseBodyStart(call) - } - - override fun responseFailed(call: Call, ioe: IOException) { - delegate.responseFailed(call, ioe) - } - - override fun responseHeadersEnd(call: Call, response: Response) { - delegate.responseHeadersEnd(call, response) - } - - override fun responseHeadersStart(call: Call) { - delegate.responseHeadersStart(call) - } - - override fun satisfactionFailure(call: Call, response: Response) { - delegate.satisfactionFailure(call, response) - } - - override fun secureConnectEnd(call: Call, handshake: Handshake?) { - delegate.secureConnectEnd(call, handshake) - } - - override fun secureConnectStart(call: Call) { - delegate.secureConnectStart(call) - } -} diff --git a/sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpInterceptor.kt b/sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpInterceptor.kt deleted file mode 100644 index 3925a83199..0000000000 --- a/sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpInterceptor.kt +++ /dev/null @@ -1,79 +0,0 @@ -package io.sentry.android.okhttp - -import io.sentry.HttpStatusCodeRange -import io.sentry.IScopes -import io.sentry.ISpan -import io.sentry.ScopesAdapter -import io.sentry.SentryIntegrationPackageStorage -import io.sentry.SentryOptions.DEFAULT_PROPAGATION_TARGETS -import io.sentry.android.okhttp.SentryOkHttpInterceptor.BeforeSpanCallback -import io.sentry.util.IntegrationUtils.addIntegrationToSdkVersion -import okhttp3.Interceptor -import okhttp3.Request -import okhttp3.Response - -/** - * The Sentry's [SentryOkHttpInterceptor], it will automatically add a breadcrumb and start a span - * out of the active span bound to the scope for each HTTP Request. - * If [captureFailedRequests] is enabled, the SDK will capture HTTP Client errors as well. - * - * @param scopes The [IScopes], internal and only used for testing. - * @param beforeSpan The [ISpan] can be customized or dropped with the [BeforeSpanCallback]. - * @param captureFailedRequests The SDK will only capture HTTP Client errors if it is enabled, - * Defaults to true. - * @param failedRequestStatusCodes The SDK will only capture HTTP Client errors if the HTTP Response - * status code is within the defined ranges. - * @param failedRequestTargets The SDK will only capture HTTP Client errors if the HTTP Request URL - * is a match for any of the defined targets. - */ -@Deprecated( - "Use SentryOkHttpInterceptor from sentry-okhttp instead", - ReplaceWith("SentryOkHttpInterceptor", "io.sentry.okhttp.SentryOkHttpInterceptor") -) -class SentryOkHttpInterceptor( - private val scopes: IScopes = ScopesAdapter.getInstance(), - private val beforeSpan: BeforeSpanCallback? = null, - private val captureFailedRequests: Boolean = true, - private val failedRequestStatusCodes: List = listOf( - HttpStatusCodeRange(HttpStatusCodeRange.DEFAULT_MIN, HttpStatusCodeRange.DEFAULT_MAX) - ), - private val failedRequestTargets: List = listOf(DEFAULT_PROPAGATION_TARGETS) -) : Interceptor by io.sentry.okhttp.SentryOkHttpInterceptor( - scopes, - { span, request, response -> - beforeSpan ?: return@SentryOkHttpInterceptor span - beforeSpan.execute(span, request, response) - }, - captureFailedRequests, - failedRequestStatusCodes, - failedRequestTargets -) { - - constructor() : this(ScopesAdapter.getInstance()) - constructor(scopes: IScopes) : this(scopes, null) - constructor(beforeSpan: BeforeSpanCallback) : this(ScopesAdapter.getInstance(), beforeSpan) - - init { - addIntegrationToSdkVersion(javaClass) - SentryIntegrationPackageStorage.getInstance() - .addPackage("maven:io.sentry:sentry-android-okhttp", BuildConfig.VERSION_NAME) - } - - /** - * The BeforeSpan callback - */ - @Deprecated( - "Use BeforeSpanCallback from sentry-okhttp instead", - ReplaceWith("BeforeSpanCallback", "io.sentry.okhttp.SentryOkHttpInterceptor.BeforeSpanCallback") - ) - fun interface BeforeSpanCallback { - /** - * Mutates or drops span before being added - * - * @param span the span to mutate or drop - * @param request the HTTP request executed by okHttp - * @param response the HTTP response received by okHttp - */ - fun execute(span: ISpan, request: Request, response: Response?): ISpan? - } -} diff --git a/sentry-android-okhttp/src/main/res/values/public.xml b/sentry-android-okhttp/src/main/res/values/public.xml deleted file mode 100644 index 379be515be..0000000000 --- a/sentry-android-okhttp/src/main/res/values/public.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/sentry-samples/sentry-samples-android/build.gradle.kts b/sentry-samples/sentry-samples-android/build.gradle.kts index 871f46ce09..e86dab253d 100644 --- a/sentry-samples/sentry-samples-android/build.gradle.kts +++ b/sentry-samples/sentry-samples-android/build.gradle.kts @@ -100,11 +100,11 @@ dependencies { implementation(kotlin(Config.kotlinStdLib, org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)) implementation(projects.sentryAndroid) - implementation(projects.sentryAndroidOkhttp) implementation(projects.sentryAndroidFragment) implementation(projects.sentryAndroidTimber) implementation(projects.sentryCompose) implementation(projects.sentryComposeHelper) + implementation(projects.sentryOkhttp) implementation(Config.Libs.fragment) implementation(Config.Libs.timber) diff --git a/settings.gradle.kts b/settings.gradle.kts index 1f7d5c2226..822c8e9db0 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,7 +17,6 @@ include( "sentry-android-ndk", "sentry-android", "sentry-android-timber", - "sentry-android-okhttp", "sentry-android-fragment", "sentry-android-navigation", "sentry-android-sqlite", From 1d93474b17f0f098dae1c39668eaa5f58dbb0782 Mon Sep 17 00:00:00 2001 From: stefanosiano Date: Mon, 24 Jun 2024 18:36:55 +0200 Subject: [PATCH 2/3] updated changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 715567cb42..4737ddf50f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Breaking Changes + +- `sentry-android-okhttp` has been removed in favor of `sentry-okhttp`, removing android dependency from the module ([#3510](https://github.com/getsentry/sentry-java/pull/3510)) + ### Behavioural Changes - (Android) The JNI layer for sentry-native has now been moved from sentry-java to sentry-native ([#3189](https://github.com/getsentry/sentry-java/pull/3189)) From 2226c966a48dcf1225e7b0ad20a8a4a2dac38045 Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 1 Jul 2024 10:40:10 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d548a6d1f..59b6d78694 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,13 @@ # Changelog -## 8.0.0-alpha.2 +## Unreleased ### Breaking Changes - `sentry-android-okhttp` has been removed in favor of `sentry-okhttp`, removing android dependency from the module ([#3510](https://github.com/getsentry/sentry-java/pull/3510)) +## 8.0.0-alpha.2 + ### Behavioural Changes - (Android) The JNI layer for sentry-native has now been moved from sentry-java to sentry-native ([#3189](https://github.com/getsentry/sentry-java/pull/3189))