Skip to content

Commit

Permalink
build: setup new modules
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Jul 5, 2024
1 parent cf8f9b4 commit 4300b9a
Show file tree
Hide file tree
Showing 42 changed files with 444 additions and 320 deletions.
4 changes: 4 additions & 0 deletions embrace-android-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# embrace-android-api

Contains public symbols that Embrace considers to be part of its public API.
Please pay extra attention when adding/changing code in this module - we don't want to get stuck with bad APIs.
200 changes: 200 additions & 0 deletions embrace-android-api/api/embrace-android-api.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
public final class io/embrace/android/embracesdk/LogExceptionType : java/lang/Enum {
public static final field HANDLED Lio/embrace/android/embracesdk/LogExceptionType;
public static final field NONE Lio/embrace/android/embracesdk/LogExceptionType;
public static final field UNHANDLED Lio/embrace/android/embracesdk/LogExceptionType;
public final fun getValue ()Ljava/lang/String;
public static fun valueOf (Ljava/lang/String;)Lio/embrace/android/embracesdk/LogExceptionType;
public static fun values ()[Lio/embrace/android/embracesdk/LogExceptionType;
}

public final class io/embrace/android/embracesdk/LogType : java/lang/Enum {
public static final field ERROR Lio/embrace/android/embracesdk/LogType;
public static final field INFO Lio/embrace/android/embracesdk/LogType;
public static final field WARNING Lio/embrace/android/embracesdk/LogType;
public static fun valueOf (Ljava/lang/String;)Lio/embrace/android/embracesdk/LogType;
public static fun values ()[Lio/embrace/android/embracesdk/LogType;
}

public final class io/embrace/android/embracesdk/Severity : java/lang/Enum {
public static final field ERROR Lio/embrace/android/embracesdk/Severity;
public static final field INFO Lio/embrace/android/embracesdk/Severity;
public static final field WARNING Lio/embrace/android/embracesdk/Severity;
public static fun valueOf (Ljava/lang/String;)Lio/embrace/android/embracesdk/Severity;
public static fun values ()[Lio/embrace/android/embracesdk/Severity;
}

public abstract interface annotation class io/embrace/android/embracesdk/annotation/BetaApi : java/lang/annotation/Annotation {
}

public abstract interface annotation class io/embrace/android/embracesdk/annotation/InternalApi : java/lang/annotation/Annotation {
}

public abstract interface annotation class io/embrace/android/embracesdk/annotation/StartupActivity : java/lang/annotation/Annotation {
}

public abstract interface class io/embrace/android/embracesdk/internal/api/BreadcrumbApi {
public abstract fun addBreadcrumb (Ljava/lang/String;)V
}

public abstract interface class io/embrace/android/embracesdk/internal/api/LogsApi {
public abstract fun logCustomStacktrace ([Ljava/lang/StackTraceElement;)V
public abstract fun logCustomStacktrace ([Ljava/lang/StackTraceElement;Lio/embrace/android/embracesdk/Severity;)V
public abstract fun logCustomStacktrace ([Ljava/lang/StackTraceElement;Lio/embrace/android/embracesdk/Severity;Ljava/util/Map;)V
public abstract fun logCustomStacktrace ([Ljava/lang/StackTraceElement;Lio/embrace/android/embracesdk/Severity;Ljava/util/Map;Ljava/lang/String;)V
public abstract fun logError (Ljava/lang/String;)V
public abstract fun logException (Ljava/lang/Throwable;)V
public abstract fun logException (Ljava/lang/Throwable;Lio/embrace/android/embracesdk/Severity;)V
public abstract fun logException (Ljava/lang/Throwable;Lio/embrace/android/embracesdk/Severity;Ljava/util/Map;)V
public abstract fun logException (Ljava/lang/Throwable;Lio/embrace/android/embracesdk/Severity;Ljava/util/Map;Ljava/lang/String;)V
public abstract fun logInfo (Ljava/lang/String;)V
public abstract fun logMessage (Ljava/lang/String;Lio/embrace/android/embracesdk/Severity;)V
public abstract fun logMessage (Ljava/lang/String;Lio/embrace/android/embracesdk/Severity;Ljava/util/Map;)V
public abstract fun logPushNotification (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Boolean;)V
public abstract fun logWarning (Ljava/lang/String;)V
}

public abstract interface class io/embrace/android/embracesdk/internal/api/MomentsApi {
public abstract fun endAppStartup ()V
public abstract fun endAppStartup (Ljava/util/Map;)V
public abstract fun endMoment (Ljava/lang/String;)V
public abstract fun endMoment (Ljava/lang/String;Ljava/lang/String;)V
public abstract fun endMoment (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)V
public abstract fun endMoment (Ljava/lang/String;Ljava/util/Map;)V
public abstract fun startMoment (Ljava/lang/String;)V
public abstract fun startMoment (Ljava/lang/String;Ljava/lang/String;)V
public abstract fun startMoment (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)V
}

public abstract interface class io/embrace/android/embracesdk/internal/api/NetworkRequestApi {
public abstract fun generateW3cTraceparent ()Ljava/lang/String;
public abstract fun getTraceIdHeader ()Ljava/lang/String;
public abstract fun recordNetworkRequest (Lio/embrace/android/embracesdk/network/EmbraceNetworkRequest;)V
}

public abstract interface class io/embrace/android/embracesdk/internal/api/OTelApi {
public abstract fun addLogRecordExporter (Lio/opentelemetry/sdk/logs/export/LogRecordExporter;)V
public abstract fun addSpanExporter (Lio/opentelemetry/sdk/trace/export/SpanExporter;)V
public abstract fun getOpenTelemetry ()Lio/opentelemetry/api/OpenTelemetry;
}

public abstract interface class io/embrace/android/embracesdk/internal/api/SessionApi {
public abstract fun addSessionProperty (Ljava/lang/String;Ljava/lang/String;Z)Z
public abstract fun endSession ()V
public abstract fun endSession (Z)V
public abstract fun getSessionProperties ()Ljava/util/Map;
public abstract fun removeSessionProperty (Ljava/lang/String;)Z
}

public abstract interface class io/embrace/android/embracesdk/internal/api/UserApi {
public abstract fun addUserPersona (Ljava/lang/String;)V
public abstract fun clearAllUserPersonas ()V
public abstract fun clearUserAsPayer ()V
public abstract fun clearUserEmail ()V
public abstract fun clearUserIdentifier ()V
public abstract fun clearUserPersona (Ljava/lang/String;)V
public abstract fun clearUsername ()V
public abstract fun setUserAsPayer ()V
public abstract fun setUserEmail (Ljava/lang/String;)V
public abstract fun setUserIdentifier (Ljava/lang/String;)V
public abstract fun setUsername (Ljava/lang/String;)V
}

public abstract interface class io/embrace/android/embracesdk/internal/api/ViewTrackingApi {
public abstract fun endView (Ljava/lang/String;)Z
public abstract fun logRnAction (Ljava/lang/String;JJLjava/util/Map;ILjava/lang/String;)V
public abstract fun logRnView (Ljava/lang/String;)V
public abstract fun logTap (Lkotlin/Pair;Ljava/lang/String;Lio/embrace/android/embracesdk/payload/TapBreadcrumb$TapBreadcrumbType;)V
public abstract fun registerComposeActivityListener (Landroid/app/Application;)V
public abstract fun startView (Ljava/lang/String;)Z
public abstract fun unregisterComposeActivityListener (Landroid/app/Application;)V
}

public abstract interface class io/embrace/android/embracesdk/internal/api/WebViewApi {
public abstract fun logWebView (Ljava/lang/String;)V
public abstract fun trackWebViewPerformance (Ljava/lang/String;Ljava/lang/String;)V
}

public final class io/embrace/android/embracesdk/internal/network/http/NetworkCaptureData {
public fun <init> (Ljava/util/Map;Ljava/lang/String;[BLjava/util/Map;[BLjava/lang/String;)V
public synthetic fun <init> (Ljava/util/Map;Ljava/lang/String;[BLjava/util/Map;[BLjava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ljava/util/Map;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()[B
public final fun component4 ()Ljava/util/Map;
public final fun component5 ()[B
public final fun component6 ()Ljava/lang/String;
public final fun copy (Ljava/util/Map;Ljava/lang/String;[BLjava/util/Map;[BLjava/lang/String;)Lio/embrace/android/embracesdk/internal/network/http/NetworkCaptureData;
public static synthetic fun copy$default (Lio/embrace/android/embracesdk/internal/network/http/NetworkCaptureData;Ljava/util/Map;Ljava/lang/String;[BLjava/util/Map;[BLjava/lang/String;ILjava/lang/Object;)Lio/embrace/android/embracesdk/internal/network/http/NetworkCaptureData;
public fun equals (Ljava/lang/Object;)Z
public final fun getCapturedRequestBody ()[B
public final fun getCapturedResponseBody ()[B
public final fun getDataCaptureErrorMessage ()Ljava/lang/String;
public final fun getRequestBodySize ()I
public final fun getRequestHeaders ()Ljava/util/Map;
public final fun getRequestQueryParams ()Ljava/lang/String;
public final fun getResponseBodySize ()I
public final fun getResponseHeaders ()Ljava/util/Map;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class io/embrace/android/embracesdk/network/EmbraceNetworkRequest {
public static fun fromCompletedRequest (Ljava/lang/String;Lio/embrace/android/embracesdk/network/http/HttpMethod;JJJJI)Lio/embrace/android/embracesdk/network/EmbraceNetworkRequest;
public static fun fromCompletedRequest (Ljava/lang/String;Lio/embrace/android/embracesdk/network/http/HttpMethod;JJJJILjava/lang/String;)Lio/embrace/android/embracesdk/network/EmbraceNetworkRequest;
public static fun fromCompletedRequest (Ljava/lang/String;Lio/embrace/android/embracesdk/network/http/HttpMethod;JJJJILjava/lang/String;Lio/embrace/android/embracesdk/internal/network/http/NetworkCaptureData;)Lio/embrace/android/embracesdk/network/EmbraceNetworkRequest;
public static fun fromCompletedRequest (Ljava/lang/String;Lio/embrace/android/embracesdk/network/http/HttpMethod;JJJJILjava/lang/String;Ljava/lang/String;Lio/embrace/android/embracesdk/internal/network/http/NetworkCaptureData;)Lio/embrace/android/embracesdk/network/EmbraceNetworkRequest;
public static fun fromIncompleteRequest (Ljava/lang/String;Lio/embrace/android/embracesdk/network/http/HttpMethod;JJLjava/lang/String;Ljava/lang/String;)Lio/embrace/android/embracesdk/network/EmbraceNetworkRequest;
public static fun fromIncompleteRequest (Ljava/lang/String;Lio/embrace/android/embracesdk/network/http/HttpMethod;JJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lio/embrace/android/embracesdk/network/EmbraceNetworkRequest;
public static fun fromIncompleteRequest (Ljava/lang/String;Lio/embrace/android/embracesdk/network/http/HttpMethod;JJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Lio/embrace/android/embracesdk/internal/network/http/NetworkCaptureData;)Lio/embrace/android/embracesdk/network/EmbraceNetworkRequest;
public static fun fromIncompleteRequest (Ljava/lang/String;Lio/embrace/android/embracesdk/network/http/HttpMethod;JJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lio/embrace/android/embracesdk/internal/network/http/NetworkCaptureData;)Lio/embrace/android/embracesdk/network/EmbraceNetworkRequest;
public fun getBytesIn ()Ljava/lang/Long;
public fun getBytesOut ()Ljava/lang/Long;
public fun getBytesReceived ()Ljava/lang/Long;
public fun getBytesSent ()Ljava/lang/Long;
public fun getEndTime ()Ljava/lang/Long;
public fun getError ()Ljava/lang/Throwable;
public fun getErrorMessage ()Ljava/lang/String;
public fun getErrorType ()Ljava/lang/String;
public fun getHttpMethod ()Ljava/lang/String;
public fun getNetworkCaptureData ()Lio/embrace/android/embracesdk/internal/network/http/NetworkCaptureData;
public fun getResponseCode ()Ljava/lang/Integer;
public fun getStartTime ()Ljava/lang/Long;
public fun getTraceId ()Ljava/lang/String;
public fun getUrl ()Ljava/lang/String;
public fun getW3cTraceparent ()Ljava/lang/String;
}

public final class io/embrace/android/embracesdk/network/http/HttpMethod : java/lang/Enum {
public static final field CONNECT Lio/embrace/android/embracesdk/network/http/HttpMethod;
public static final field DELETE Lio/embrace/android/embracesdk/network/http/HttpMethod;
public static final field GET Lio/embrace/android/embracesdk/network/http/HttpMethod;
public static final field HEAD Lio/embrace/android/embracesdk/network/http/HttpMethod;
public static final field OPTIONS Lio/embrace/android/embracesdk/network/http/HttpMethod;
public static final field PATCH Lio/embrace/android/embracesdk/network/http/HttpMethod;
public static final field POST Lio/embrace/android/embracesdk/network/http/HttpMethod;
public static final field PUT Lio/embrace/android/embracesdk/network/http/HttpMethod;
public static final field TRACE Lio/embrace/android/embracesdk/network/http/HttpMethod;
public static fun fromInt (Ljava/lang/Integer;)Lio/embrace/android/embracesdk/network/http/HttpMethod;
public static fun fromString (Ljava/lang/String;)Lio/embrace/android/embracesdk/network/http/HttpMethod;
public static fun valueOf (Ljava/lang/String;)Lio/embrace/android/embracesdk/network/http/HttpMethod;
public static fun values ()[Lio/embrace/android/embracesdk/network/http/HttpMethod;
}

public final class io/embrace/android/embracesdk/payload/TapBreadcrumb : io/embrace/android/embracesdk/capture/crumbs/Breadcrumb {
public fun <init> (Lkotlin/Pair;Ljava/lang/String;JLio/embrace/android/embracesdk/payload/TapBreadcrumb$TapBreadcrumbType;)V
public synthetic fun <init> (Lkotlin/Pair;Ljava/lang/String;JLio/embrace/android/embracesdk/payload/TapBreadcrumb$TapBreadcrumbType;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getLocation ()Ljava/lang/String;
public fun getStartTime ()J
public final fun getTappedElementName ()Ljava/lang/String;
public final fun getType ()Lio/embrace/android/embracesdk/payload/TapBreadcrumb$TapBreadcrumbType;
public final fun setLocation (Ljava/lang/String;)V
}

public final class io/embrace/android/embracesdk/payload/TapBreadcrumb$TapBreadcrumbType : java/lang/Enum {
public static final field LONG_PRESS Lio/embrace/android/embracesdk/payload/TapBreadcrumb$TapBreadcrumbType;
public static final field TAP Lio/embrace/android/embracesdk/payload/TapBreadcrumb$TapBreadcrumbType;
public final fun getValue ()Ljava/lang/String;
public static fun valueOf (Ljava/lang/String;)Lio/embrace/android/embracesdk/payload/TapBreadcrumb$TapBreadcrumbType;
public static fun values ()[Lio/embrace/android/embracesdk/payload/TapBreadcrumb$TapBreadcrumbType;
}

17 changes: 17 additions & 0 deletions embrace-android-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
plugins {
id("embrace-defaults")
}

description = "Embrace Android SDK: API"

android {
namespace = "io.embrace.android.embracesdk.api"
}

dependencies {
implementation(libs.androidx.annotation)
compileOnly(platform(libs.opentelemetry.bom))
compileOnly(libs.opentelemetry.api)
compileOnly(libs.opentelemetry.sdk)
compileOnly(libs.opentelemetry.context)
}
92 changes: 92 additions & 0 deletions embrace-android-api/lint-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.3.2" type="baseline" client="gradle" dependencies="false" name="AGP (8.3.2)" variant="all" version="8.3.2">

<issue
id="DefaultLocale"
message="Implicitly using the default locale is a common source of bugs: Use `toUpperCase(Locale)` instead. For strings meant to be internal use `Locale.ROOT`, otherwise `Locale.getDefault()`."
errorLine1=" return httpMethod != null ? httpMethod.name().toUpperCase() : null;"
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/io/embrace/android/embracesdk/network/EmbraceNetworkRequest.java"
line="431"
column="55"/>
</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="public enum class LogExceptionType(public val value: String) {"
errorLine2=" ~~~~~~~~~~~~~~~~">
<location
file="src/main/kotlin/io/embrace/android/embracesdk/LogExceptionType.kt"
line="13"
column="19"/>
</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="public enum class LogType {"
errorLine2=" ~~~~~~~">
<location
file="src/main/kotlin/io/embrace/android/embracesdk/LogType.kt"
line="10"
column="19"/>
</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="public enum class Severity {"
errorLine2=" ~~~~~~~~">
<location
file="src/main/kotlin/io/embrace/android/embracesdk/Severity.kt"
line="6"
column="19"/>
</issue>

<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static HttpMethod fromString(String method) {"
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/java/io/embrace/android/embracesdk/network/http/HttpMethod.java"
line="24"
column="19"/>
</issue>

<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static HttpMethod fromString(String method) {"
errorLine2=" ~~~~~~">
<location
file="src/main/java/io/embrace/android/embracesdk/network/http/HttpMethod.java"
line="24"
column="41"/>
</issue>

<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static HttpMethod fromInt(Integer method) {"
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/java/io/embrace/android/embracesdk/network/http/HttpMethod.java"
line="57"
column="19"/>
</issue>

<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static HttpMethod fromInt(Integer method) {"
errorLine2=" ~~~~~~~">
<location
file="src/main/java/io/embrace/android/embracesdk/network/http/HttpMethod.java"
line="57"
column="38"/>
</issue>

</issues>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import io.embrace.android.embracesdk.annotation.InternalApi
* @suppress
*/
@InternalApi
public enum class LogExceptionType(internal val value: String) {
public enum class LogExceptionType(public val value: String) {
NONE("none"),
HANDLED("handled"),
UNHANDLED("unhandled")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package io.embrace.android.embracesdk;
package io.embrace.android.embracesdk

/**
* The severity of the log message.
*/
public enum Severity {

public enum class Severity {
/**
* Reports log messages with info level severity.
*/
Expand Down
Loading

0 comments on commit 4300b9a

Please sign in to comment.