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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- Fix `Modifier.sentryTag()` not found warning ([#997](https://github.com/getsentry/sentry-android-gradle-plugin/pull/997))

## 6.0.0-alpha.4

### Dependencies
Expand Down
1 change: 1 addition & 0 deletions examples/android-instrumentation-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.ksp)
id("io.sentry.android.gradle")
id("io.sentry.kotlin.compiler.gradle")
}

if (getKotlinPluginVersion() >= "2.0.0") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.BasicText
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import io.sentry.samples.instrumentation.ui.ComposeActivity.Destination

class ComposeActivity : ComponentActivity() {

Expand All @@ -36,14 +39,7 @@ class ComposeActivity : ComponentActivity() {
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
BasicText(
modifier =
Modifier.border(2.dp, Color.Gray, pillShape)
.clip(pillShape)
.clickable { navController.navigate(Destination.Details.route) }
.padding(24.dp),
text = "Home. Tap to go to Details.",
)
HomeText(navController, pillShape)
}
}
composable(Destination.Details.route) {
Expand All @@ -52,14 +48,7 @@ class ComposeActivity : ComponentActivity() {
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
BasicText(
modifier =
Modifier.border(2.dp, Color.Gray, pillShape)
.clip(pillShape)
.clickable { navController.popBackStack() }
.padding(24.dp),
text = "Details. Tap or press back to return.",
)
DetailsText(navController, pillShape)
}
}
}
Expand All @@ -72,3 +61,27 @@ class ComposeActivity : ComponentActivity() {
object Details : Destination("details")
}
}

@Composable
fun HomeText(navController: NavController, pillShape: RoundedCornerShape) {
BasicText(
modifier =
Modifier.border(2.dp, Color.Gray, pillShape)
.clip(pillShape)
.clickable { navController.navigate(Destination.Details.route) }
.padding(24.dp),
text = "Home. Tap to go to Details.",
)
}

@Composable
fun DetailsText(navController: NavController, pillShape: RoundedCornerShape) {
BasicText(
modifier =
Modifier.border(2.dp, Color.Gray, pillShape)
.clip(pillShape)
.clickable { navController.popBackStack() }
.padding(24.dp),
text = "Details. Tap or press back to return.",
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@ import io.sentry.SpanStatus
import io.sentry.TransactionOptions
import io.sentry.samples.instrumentation.R
import io.sentry.samples.instrumentation.SampleApp
import io.sentry.samples.instrumentation.network.TrackService
import io.sentry.samples.instrumentation.ui.list.TrackAdapter
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.withContext

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
Expand All @@ -39,13 +35,14 @@ class MainActivity : ComponentActivity() {
SampleApp.database
.tracksDao()
.all()
.map {
val remote =
withContext(Dispatchers.IO) {
TrackService.instance.tracks("6188aa82-3102-436a-9a68-513e6ad9efcb")
}
remote + it
}
// TODO: this service doesn't work anymore, need to find a replacement
// .map {
// val remote =
// withContext(Dispatchers.IO) {
// TrackService.instance.tracks("6188aa82-3102-436a-9a68-513e6ad9efcb")
// }
// remote + it
// }
.collect {
(list.adapter as TrackAdapter).populate(it)
transaction.finish(SpanStatus.OK)
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ sample-androidx-recyclerView = "androidx.recyclerview:recyclerview:1.2.0"
sample-androidx-lifecycle = "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0"
sample-androidx-appcompat = "androidx.appcompat:appcompat:1.2.0"

sample-androidx-composeRuntime = "androidx.compose.runtime:runtime:1.1.1"
sample-androidx-composeRuntime = "androidx.compose.runtime:runtime:1.5.4"
sample-androidx-composeNavigation = "androidx.navigation:navigation-compose:2.5.2"
sample-androidx-composeActivity = "androidx.activity:activity-compose:1.4.0"
sample-androidx-composeFoundation = "androidx.compose.foundation:foundation:1.2.1"
sample-androidx-composeFoundationLayout = "androidx.compose.foundation:foundation-layout:1.2.1"
sample-androidx-composeFoundation = "androidx.compose.foundation:foundation:1.5.4"
sample-androidx-composeFoundationLayout = "androidx.compose.foundation:foundation-layout:1.5.4"

sample-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "sampleCoroutines" }
sample-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "sampleCoroutines" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ class JetpackComposeTracingIrExtension22(private val messageCollector: MessageCo

val sentryModifierClassId = FqName("io.sentry.compose").classId("SentryModifier")

val sentryModifierCompanionClass =
pluginContext.referenceClass(sentryModifierClassId)?.owner?.companionObject()
val sentryModifierCompanionClass = pluginContext.referenceClass(sentryModifierClassId)?.owner

val sentryModifierTagFunction = sentryModifierClassId.callableId("sentryTag")

Expand Down
7 changes: 6 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,9 @@ include(":examples:multi-module-sample:spring-boot-in-multi-module-sample2")

includeBuild("plugin-build")

includeBuild("sentry-kotlin-compiler-plugin")
// this is needed so we can use kotlin-compiler-plugin directly in the sample app without publishing
includeBuild("sentry-kotlin-compiler-plugin") {
dependencySubstitution {
substitute(module("io.sentry:sentry-kotlin-compiler-plugin")).using(project(":"))
}
}
Loading