Skip to content

Commit 14ea742

Browse files
committed
Update Compose Instrumentation functions references
1 parent ab1566b commit 14ea742

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

dd-sdk-android-gradle-plugin/src/main/kotlin/com/datadog/gradle/plugin/kcp/DefaultPluginContextUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ internal class DefaultPluginContextUtils(
129129
private const val MODIFIER_COMPANION_NAME = "Modifier.Companion"
130130
private val composableFqName = FqName("androidx.compose.runtime.Composable")
131131
private val datadogPackageName = FqName("com.datadog.android.compose")
132-
private val datadogModifierIdentifier = Name.identifier("datadog")
132+
private val datadogModifierIdentifier = Name.identifier("instrumentedDatadog")
133133
private val composeUiPackageName = FqName("androidx.compose.ui")
134134
private val modifierClassRelativeName = Name.identifier("Modifier")
135135
private val modifierThenIdentifier = Name.identifier("then")
136136
private val navigationPackageName = FqName("androidx.navigation")
137137
private val navHostControllerIdentifier = Name.identifier("NavHostController")
138138
private val navHostCallName = FqName("androidx.navigation.compose.NavHost")
139139
private val datadogTrackEffectPackageName = FqName("com.datadog.android.compose")
140-
private val datadogTrackEffectIdentifier = Name.identifier("NavigationViewTrackingEffect")
140+
private val datadogTrackEffectIdentifier = Name.identifier("InstrumentedNavigationViewTrackingEffect")
141141
private val kotlinPackageName = FqName("kotlin")
142142
private val applyFunctionIdentifier = Name.identifier("apply")
143143
private val foundationPackageName = FqName("androidx.compose.foundation")

dd-sdk-android-gradle-plugin/src/test/kotlin/com/datadog/gradle/plugin/kcp/KotlinCompilerTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ internal open class KotlinCompilerTest {
121121
import androidx.compose.ui.semantics.semantics
122122
import com.datadog.gradle.plugin.kcp.TestCallbackContainer
123123
124-
fun Modifier.datadog(name: String, isImageRole: Boolean = false): Modifier {
124+
fun Modifier.instrumentedDatadog(name: String, isImageRole: Boolean = false): Modifier {
125125
TestCallbackContainer.invokeCallback(isImageRole)
126126
return this.semantics {
127127
this.datadog = name
@@ -150,7 +150,7 @@ internal open class KotlinCompilerTest {
150150
151151
152152
@Composable
153-
fun NavigationViewTrackingEffect(
153+
fun InstrumentedNavigationViewTrackingEffect(
154154
navController: NavController
155155
) {
156156
TestCallbackContainer.invokeCallback()

instrumented/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ android {
5454
tasks.withType<KotlinCompile>().configureEach {
5555
kotlinOptions {
5656
freeCompilerArgs += listOf(
57-
"-P", "plugin:com.datadoghq.kotlin.compiler:INSTRUMENTATION_MODE=AUTO"
57+
// RUM-9513: This KCP is disabled to API change of SDK, Restore this test after the next release of SDK
58+
"-P", "plugin:com.datadoghq.kotlin.compiler:INSTRUMENTATION_MODE=DISABLE"
5859
)
5960
}
6061
}

instrumented/src/androidTest/java/com/datadog/android/instrumented/NavigationTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import androidx.navigation.NavHostController
1515
import androidx.test.platform.app.InstrumentationRegistry
1616
import fr.xgouchet.elmyr.junit5.ForgeExtension
1717
import org.assertj.core.api.Assertions.assertThat
18+
import org.junit.Ignore
1819
import org.junit.Rule
1920
import org.junit.Test
2021
import org.junit.jupiter.api.extension.ExtendWith
@@ -36,6 +37,7 @@ class NavigationTest {
3637
val composeTestRule = createComposeRule()
3738

3839
@Test
40+
@Ignore("RUM-9513: This test will fail due to API change of SDK, Restore this test after the next release of SDK")
3941
fun `M call function and have original components W instrument with the Plugin`() {
4042
// Given
4143
val latch = CountDownLatch(1)
@@ -67,6 +69,7 @@ class NavigationTest {
6769
}
6870

6971
@Test
72+
@Ignore("RUM-9513: This test will fail due to API change of SDK, Restore this test after the next release of SDK")
7073
fun `M call function and have original components W instrument nested NavHost with the Plugin`() {
7174
// Given
7275
val latch = CountDownLatch(1)

samples/lib-module/src/main/kotlin/com/datadog/android/compose/DatadogModifier.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import androidx.compose.ui.semantics.semantics
1212
* This function should have exactly the same package name, function signature and return type
1313
* with the production one.
1414
*/
15-
fun Modifier.datadog(name: String, isImageRole: Boolean = false): Modifier {
15+
internal fun Modifier.instrumentedDatadog(name: String, isImageRole: Boolean = false): Modifier {
1616
return this.semantics {
1717
this.datadog = name
1818
if (isImageRole) {

0 commit comments

Comments
 (0)