Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ body:
- sentry-android-ndk
- sentry-android-timber
- sentry-android-fragment
- sentry-android-navigation3
- sentry-android-sqlite
- sentry-apollo
- sentry-apollo-3
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ The repository is organized into multiple modules:
- **Logging**: `sentry-logback`, `sentry-log4j2`, `sentry-jul`, `sentry-android-timber`
- **Web**: `sentry-servlet*`, `sentry-okhttp`, `sentry-openfeign`, `sentry-apache-http-client-5`
- **GraphQL**: `sentry-graphql*`, `sentry-apollo*`
- **Android UI**: `sentry-android-fragment`, `sentry-android-navigation`, `sentry-compose`
- **Android UI**: `sentry-android-fragment`, `sentry-android-navigation`, `sentry-android-navigation3`, `sentry-compose`
- **Session Replay**: `sentry-android-replay`
- **Database**: `sentry-jdbc`, `sentry-android-sqlite`, `sentry-jcache`
- **Reactive**: `sentry-reactor`, `sentry-ktor-client`
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ object Config {
"sentry-android-ndk",
"sentry-android-fragment",
"sentry-android-navigation",
"sentry-android-navigation3",
"sentry-android-timber",
"sentry-compose-android",
"sentry-android-sqlite",
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ androidx-activity-compose = { module = "androidx.activity:activity-compose", ver
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidxCompose" }
androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "androidxCompose" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3", version = "1.4.0" }
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "androidxCompose" }
androidx-compose-material-icons-core = { module = "androidx.compose.material:material-icons-core", version="1.7.8" }
androidx-compose-material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version="1.7.8" }
androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "androidxCompose" }
Expand Down
51 changes: 51 additions & 0 deletions sentry-android-navigation3/api/sentry-android-navigation3.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
public final class io/sentry/compose/navigation3/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 <init> ()V
}

public abstract interface class io/sentry/compose/navigation3/RouteArgumentsExtractor {
public abstract fun extract (Ljava/lang/Object;)Ljava/util/Map;
}

public abstract interface class io/sentry/compose/navigation3/RouteNameExtractor {
public abstract fun extract (Ljava/lang/Object;)Ljava/lang/String;
}

public final class io/sentry/compose/navigation3/SentryNavEffectKt {
public static final fun SentryNavEffect (Ljava/util/List;Lio/sentry/compose/navigation3/RouteNameExtractor;Lio/sentry/compose/navigation3/RouteArgumentsExtractor;Lio/sentry/compose/navigation3/SentryNavOptions;Landroidx/compose/runtime/Composer;II)V
}

public final class io/sentry/compose/navigation3/SentryNavOptions {
public static final field $stable I
public synthetic fun <init> (ZZZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun equals (Ljava/lang/Object;)Z
public final fun getCaptureBackStack ()Z
public final fun getEnableNavigationBreadcrumbs ()Z
public final fun getEnableNavigationTransactions ()Z
public final fun getMaxCapturedBackStackEntries ()I
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class io/sentry/compose/navigation3/SentryNavOptions$Builder {
public static final field $stable I
public fun <init> ()V
public final fun build ()Lio/sentry/compose/navigation3/SentryNavOptions;
public final fun getCaptureBackStack ()Z
public final fun getEnableNavigationBreadcrumbs ()Z
public final fun getEnableNavigationTransactions ()Z
public final fun getMaxCapturedBackStackEntries ()I
public final fun setCaptureBackStack (Z)V
public final fun setEnableNavigationBreadcrumbs (Z)V
public final fun setEnableNavigationTransactions (Z)V
public final fun setMaxCapturedBackStackEntries (I)V
}

public final class io/sentry/compose/navigation3/SentryNavOptionsKt {
public static final fun SentryNavOptions (Lkotlin/jvm/functions/Function1;)Lio/sentry/compose/navigation3/SentryNavOptions;
public static synthetic fun SentryNavOptions$default (Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/sentry/compose/navigation3/SentryNavOptions;
}

78 changes: 78 additions & 0 deletions sentry-android-navigation3/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
id("com.android.library")
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.gradle.versions)
alias(libs.plugins.detekt)
}

android {
compileSdk = libs.versions.compileSdk.get().toInt()
namespace = "io.sentry.compose.navigation3"

defaultConfig {
minSdk = libs.versions.minSdk.get().toInt()

buildConfigField("String", "VERSION_NAME", "\"${project.version}\"")
}

buildTypes {
getByName("release") { consumerProguardFiles("proguard-rules.pro") }
}

// AGP 9 only generates unit tests for the testBuildType. The debug variant is
// disabled, so unit tests must target release to run at all.
testBuildType = "release"

kotlin {
compilerOptions.jvmTarget = JVM_1_8
compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9
compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9
}

testOptions {
unitTests.isReturnDefaultValues = 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
}

buildFeatures {
Comment thread
0xadam-brown marked this conversation as resolved.
buildConfig = true
compose = true
}

androidComponents.beforeVariants {
it.enable = !Config.Android.shouldSkipDebugVariant(it.buildType)
}
}

kotlin { explicitApi() }

dependencies {
implementation(projects.sentry)

compileOnly(libs.androidx.compose.runtime)

testImplementation(libs.androidx.compose.ui.test.junit4)
testImplementation(libs.androidx.test.core)
testImplementation(libs.androidx.test.ext.junit)
testImplementation(libs.google.truth)
testImplementation(libs.mockito.inline)
testImplementation(libs.mockito.kotlin)
testImplementation(libs.roboelectric)
}

tasks.withType<Detekt>().configureEach {
// Target version of the generated JVM bytecode. It is used for type resolution.
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
7 changes: 7 additions & 0 deletions sentry-android-navigation3/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
##---------------Begin: proguard configuration for Compose ----------

# To ensure that stack traces is unambiguous
# https://developer.android.com/studio/build/shrink-code#decode-stack-trace
-keepattributes LineNumberTable,SourceFile

##---------------End: proguard configuration for Compose ----------
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package io.sentry.compose.navigation3

/**
* A key for distinguishing back stacks over time.
*
* Lets `*Effect`s restart when either the identity of a stack entry changes or the stack's entries
* are reordered.
*/
internal class BackStackKey<T : Any>(private val backStack: List<T>) {

override fun equals(other: Any?): Boolean {
// Use of identity rather than structural equality frees us from entries' equals() and
// hashCode() implementations, which are provided by the host app and may be incomplete,
// expensive, or incorrect for our purposes.
if (this === other) {
return true
}
if (other !is BackStackKey<*>) {
return false
}
if (backStack.size != other.backStack.size) {
return false
}

return backStack.indices.all { index -> backStack[index] === other.backStack[index] }
}

override fun hashCode(): Int {
var result = backStack.size
for (entry in backStack) {
result = 31 * result + System.identityHashCode(entry)
}
return result
}
}
Loading
Loading