Skip to content
Draft
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Features

- Add sentry-android-navigation3 module for Android Navigation 3 integration ([#5023](https://github.com/getsentry/sentry-java/pull/5023))

### Fixes

- [ANR] Removed AndroidTransactionProfiler lock ([#4817](https://github.com/getsentry/sentry-java/pull/4817))
Expand Down
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
apollo = "2.5.9"
androidxLifecycle = "2.2.0"
androidxNavigation = "2.4.2"
androidxNavigation3 = "1.0.0"
androidxTestCore = "1.7.0"
androidxCompose = "1.6.3"
composeCompiler = "1.5.14"
Expand Down Expand Up @@ -89,6 +90,8 @@ androidx-lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-commo
androidx-lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "androidxLifecycle" }
androidx-navigation-runtime = { module = "androidx.navigation:navigation-runtime", version.ref = "androidxNavigation" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidxNavigation" }
androidx-navigation3-runtime = { module = "androidx.navigation3:navigation3-runtime", version.ref = "androidxNavigation3" }
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "androidxCompose" }
androidx-sqlite = { module = "androidx.sqlite:sqlite", version = "2.5.2" }
androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version = "1.2.1" }
androidx-browser = { module = "androidx.browser:browser", version = "1.8.0" }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
public final class io/sentry/android/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 final class io/sentry/android/navigation3/SentryNavigation3IntegrationKt {
public static final fun SentryNavigation3Traced (Ljava/util/List;ZZLkotlin/jvm/functions/Function1;Lio/sentry/IScopes;Landroidx/compose/runtime/Composer;II)V
}

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

plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.compose)
id("com.android.library")
alias(libs.plugins.kover)
alias(libs.plugins.gradle.versions)
alias(libs.plugins.detekt)
alias(libs.plugins.dokka)
alias(libs.plugins.dokka.javadoc)
`maven-publish` // necessary for publishMavenLocal task to publish correct artifacts
}

kotlin {
explicitApi()

androidTarget {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
apiVersion.set(KotlinVersion.KOTLIN_1_9)
languageVersion.set(KotlinVersion.KOTLIN_1_9)
}
publishLibraryVariants("release")
}
jvm("desktop") {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
apiVersion.set(KotlinVersion.KOTLIN_1_9)
languageVersion.set(KotlinVersion.KOTLIN_1_9)
}
}

coreLibrariesVersion = "1.8"

sourceSets.all {
// Allow all experimental APIs, since MPP projects are themselves experimental
languageSettings.apply {
optIn("kotlin.Experimental")
optIn("kotlin.ExperimentalMultiplatform")
}
}

sourceSets {
val commonMain by getting {
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_1_9)
languageVersion.set(KotlinVersion.KOTLIN_1_9)
}
}
val androidMain by getting {
dependencies {
api(projects.sentry)

compileOnly(libs.androidx.navigation3.runtime)
compileOnly(libs.androidx.compose.runtime)
implementation(libs.kotlinx.coroutines)
}
}
val androidUnitTest by getting {
dependencies {
implementation(libs.androidx.navigation3.runtime)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.test.ext.junit)
implementation(libs.androidx.test.rules)
implementation(libs.androidx.test.runner)
implementation(libs.kotlin.test.junit)
implementation(libs.mockito.inline)
implementation(libs.mockito.kotlin)
implementation(libs.roboelectric)
}
}
}
}

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

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

// for AGP 4.1
buildConfigField("String", "VERSION_NAME", "\"${project.version}\"")
}

sourceSets["main"].apply { manifest.srcFile("src/androidMain/AndroidManifest.xml") }

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

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
}

buildFeatures { buildConfig = true }

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

tasks.withType<Detekt>().configureEach {
// Target version of the generated JVM bytecode. It is used for type resolution.
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

tasks.withType<DokkaTask>().configureEach {
// suppress unattached source sets for docs
dokkaSourceSets {
matching {
it.name.contains("androidandroid", ignoreCase = true) ||
it.name.contains("testfixtures", ignoreCase = true)
}
.configureEach { suppress.set(true) }
}
}
1 change: 1 addition & 0 deletions sentry-android-navigation3/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# no-op
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
Loading
Loading