Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert api interfaces to kotlin #858

Merged
merged 9 commits into from
May 20, 2024
2 changes: 1 addition & 1 deletion embrace-android-sdk/api/embrace-android-sdk.api
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public final class io/embrace/android/embracesdk/BuildConfig {
public fun <init> ()V
}

public final class io/embrace/android/embracesdk/Embrace : io/embrace/android/embracesdk/EmbraceAndroidApi, io/embrace/android/embracesdk/EmbraceApi, io/embrace/android/embracesdk/LogsApi, io/embrace/android/embracesdk/MomentsApi, io/embrace/android/embracesdk/NetworkRequestApi, io/embrace/android/embracesdk/SessionApi, io/embrace/android/embracesdk/UserApi, io/embrace/android/embracesdk/spans/TracingApi {
public final class io/embrace/android/embracesdk/Embrace : io/embrace/android/embracesdk/EmbraceAndroidApi, io/embrace/android/embracesdk/EmbraceApi, io/embrace/android/embracesdk/LogsApi, io/embrace/android/embracesdk/MomentsApi, io/embrace/android/embracesdk/NetworkRequestApi, io/embrace/android/embracesdk/SessionApi, io/embrace/android/embracesdk/UserApi, io/embrace/android/embracesdk/internal/api/SdkStateApi, io/embrace/android/embracesdk/spans/TracingApi {
public fun addBreadcrumb (Ljava/lang/String;)V
public fun addLogRecordExporter (Lio/opentelemetry/sdk/logs/export/LogRecordExporter;)V
public fun addSessionProperty (Ljava/lang/String;Ljava/lang/String;Z)Z
Expand Down
3 changes: 1 addition & 2 deletions embrace-android-sdk/config/detekt/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<ID>DataClassContainsFunctions:LegacyExceptionError.kt$LegacyExceptionError$private fun getExceptionInfo(ex: Throwable?): List&lt;LegacyExceptionInfo&gt;</ID>
<ID>DataClassShouldBeImmutable:LegacyExceptionError.kt$LegacyExceptionError$@Json(name = "c") var occurrences: Int = 0</ID>
<ID>DataClassShouldBeImmutable:LegacyExceptionError.kt$LegacyExceptionError$@Json(name = "rep") var exceptionErrors: MutableList&lt;LegacyExceptionErrorInfo&gt; = mutableListOf()</ID>
<ID>LongParameterList:FakeModuleInitBootstrapper.kt$( fakeEmbLogger: FakeEmbLogger = FakeEmbLogger(), fakeInitModule: FakeInitModule = FakeInitModule(), fakeOpenTelemetryModule: FakeOpenTelemetryModule = FakeOpenTelemetryModule(), coreModuleSupplier: CoreModuleSupplier = { _, _, _ -&gt; FakeCoreModule() }, systemServiceModuleSupplier: SystemServiceModuleSupplier = { _, _ -&gt; FakeSystemServiceModule() }, androidServicesModuleSupplier: AndroidServicesModuleSupplier = { _, _, _ -&gt; FakeAndroidServicesModule() }, workerThreadModuleSupplier: WorkerThreadModuleSupplier = { _ -&gt; FakeWorkerThreadModule() }, storageModuleSupplier: StorageModuleSupplier = { _, _, _ -&gt; FakeStorageModule() }, essentialServiceModuleSupplier: EssentialServiceModuleSupplier = { _, _, _, _, _, _, _, _, _, _ -&gt; FakeEssentialServiceModule() }, dataSourceModuleSupplier: DataSourceModuleSupplier = { _, _, _, _, _, _, _, _ -&gt; FakeDataSourceModule() }, dataCaptureServiceModuleSupplier: DataCaptureServiceModuleSupplier = { _, _, _, _, _, _, _ -&gt; FakeDataCaptureServiceModule() }, deliveryModuleSupplier: DeliveryModuleSupplier = { _, _, _, _, _ -&gt; FakeDeliveryModule() }, anrModuleSupplier: AnrModuleSupplier = { _, _, _, _ -&gt; FakeAnrModule() }, customerLogModuleSupplier: CustomerLogModuleSupplier = { _, _, _, _, _, _, _, _ -&gt; FakeCustomerLogModule() }, nativeModuleSupplier: NativeModuleSupplier = { _, _, _, _, _, _, _ -&gt; FakeNativeModule() }, dataContainerModuleSupplier: DataContainerModuleSupplier = { _, _, _, _, _ -&gt; FakeDataContainerModule() }, sessionModuleSupplier: SessionModuleSupplier = { _, _, _, _, _, _, _, _, _, _, _, _, _ -&gt; FakeSessionModule() }, crashModuleSupplier: CrashModuleSupplier = { _, _, _, _, _, _, _, _, _, _, _ -&gt; FakeCrashModule() }, payloadModuleSupplier: PayloadModuleSupplier = { _, _, _, _, _, _, _, _, _ -&gt; FakePayloadModule() } )</ID>
<ID>TooManyFunctions:EmbraceImpl.kt$EmbraceImpl : UserApiSessionApiNetworkRequestApiLogsApiMomentsApiTracingApi</ID>
<ID>LongParameterList:FakeModuleInitBootstrapper.kt$( fakeEmbLogger: FakeEmbLogger = FakeEmbLogger(), fakeInitModule: FakeInitModule = FakeInitModule(logger = fakeEmbLogger), fakeOpenTelemetryModule: FakeOpenTelemetryModule = FakeOpenTelemetryModule(), coreModuleSupplier: CoreModuleSupplier = { _, _, _ -&gt; FakeCoreModule() }, systemServiceModuleSupplier: SystemServiceModuleSupplier = { _, _ -&gt; FakeSystemServiceModule() }, androidServicesModuleSupplier: AndroidServicesModuleSupplier = { _, _, _ -&gt; FakeAndroidServicesModule() }, workerThreadModuleSupplier: WorkerThreadModuleSupplier = { _ -&gt; FakeWorkerThreadModule() }, storageModuleSupplier: StorageModuleSupplier = { _, _, _ -&gt; FakeStorageModule() }, essentialServiceModuleSupplier: EssentialServiceModuleSupplier = { _, _, _, _, _, _, _, _, _, _ -&gt; FakeEssentialServiceModule() }, dataSourceModuleSupplier: DataSourceModuleSupplier = { _, _, _, _, _, _, _, _ -&gt; FakeDataSourceModule() }, dataCaptureServiceModuleSupplier: DataCaptureServiceModuleSupplier = { _, _, _, _, _, _, _ -&gt; FakeDataCaptureServiceModule() }, deliveryModuleSupplier: DeliveryModuleSupplier = { _, _, _, _, _ -&gt; FakeDeliveryModule() }, anrModuleSupplier: AnrModuleSupplier = { _, _, _, _ -&gt; FakeAnrModule() }, customerLogModuleSupplier: CustomerLogModuleSupplier = { _, _, _, _, _, _, _, _ -&gt; FakeCustomerLogModule() }, nativeModuleSupplier: NativeModuleSupplier = { _, _, _, _, _, _, _ -&gt; FakeNativeModule() }, dataContainerModuleSupplier: DataContainerModuleSupplier = { _, _, _, _, _ -&gt; FakeDataContainerModule() }, sessionModuleSupplier: SessionModuleSupplier = { _, _, _, _, _, _, _, _, _, _, _, _, _ -&gt; FakeSessionModule() }, crashModuleSupplier: CrashModuleSupplier = { _, _, _, _, _, _, _, _, _, _, _ -&gt; FakeCrashModule() }, payloadModuleSupplier: PayloadModuleSupplier = { _, _, _, _, _, _, _, _, _ -&gt; FakePayloadModule() } )</ID>
</CurrentIssues>
</SmellBaseline>
17 changes: 14 additions & 3 deletions embrace-android-sdk/lint-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<issue
id="EmbracePublicApiPackageRule"
message="Don&apos;t put classes in the io.embrace.android.embracesdk package unless they&apos;re part of the public API. Please move the new class to an appropriate package or (if you&apos;re adding to the public API) suppress this error via the lint baseline file."
errorLine1="internal interface EmbraceAndroidApi : EmbraceApi {"
errorLine1="internal interface EmbraceAndroidApi {"
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/io/embrace/android/embracesdk/EmbraceAndroidApi.kt"
Expand All @@ -26,11 +26,11 @@
<issue
id="EmbracePublicApiPackageRule"
message="Don&apos;t put classes in the io.embrace.android.embracesdk package unless they&apos;re part of the public API. Please move the new class to an appropriate package or (if you&apos;re adding to the public API) suppress this error via the lint baseline file."
errorLine1="internal interface EmbraceApi : LogsApi, MomentsApi, NetworkRequestApi, SessionApi, UserApi, TracingApi {"
errorLine1="internal interface EmbraceApi {"
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/java/io/embrace/android/embracesdk/EmbraceApi.kt"
line="14"
line="13"
column="20"/>
</issue>

Expand Down Expand Up @@ -276,6 +276,17 @@
column="31"/>
</issue>

<issue
id="EmbracePublicApiPackageRule"
message="Don&apos;t put classes in the io.embrace.android.embracesdk package unless they&apos;re part of the public API. Please move the new class to an appropriate package or (if you&apos;re adding to the public API) suppress this error via the lint baseline file."
errorLine1="internal interface ViewTrackingApi {"
errorLine2=" ~~~~~~~~~~~~~~~">
<location
file="src/main/java/io/embrace/android/embracesdk/ViewTrackingApi.kt"
line="6"
column="20"/>
</issue>

<issue
id="EmbracePublicApiPackageRule"
message="Don&apos;t put classes in the io.embrace.android.embracesdk package unless they&apos;re part of the public API. Please move the new class to an appropriate package or (if you&apos;re adding to the public API) suppress this error via the lint baseline file."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.embrace.android.embracesdk.annotation.InternalApi;
import io.embrace.android.embracesdk.internal.EmbraceInternalInterface;
import io.embrace.android.embracesdk.internal.Systrace;
import io.embrace.android.embracesdk.internal.api.SdkStateApi;
import io.embrace.android.embracesdk.network.EmbraceNetworkRequest;
import io.embrace.android.embracesdk.spans.EmbraceSpan;
import io.embrace.android.embracesdk.spans.EmbraceSpanEvent;
Expand All @@ -37,7 +38,8 @@ public final class Embrace implements
UserApi,
TracingApi,
EmbraceApi,
EmbraceAndroidApi {
EmbraceAndroidApi,
SdkStateApi {

/**
* Singleton instance of the Embrace SDK.
Expand Down
Loading