Skip to content

Commit d2a5a7c

Browse files
authored
Remove Unity related code from the NDK upload tasks (#2209)
* Remove Unity related code from the NDK upload tasks * Remove unnecessary mustRunAfter from NdkUploadTasksRegistration * Move customSymbolsDirectory to EmbraceExtension
1 parent 2a8069f commit d2a5a7c

File tree

15 files changed

+70
-624
lines changed

15 files changed

+70
-624
lines changed

embrace-gradle-plugin-integration-tests/src/test/java/io/embrace/android/gradle/integration/testcases/AndroidNdkTest.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,8 @@ class AndroidNdkTest {
100100
)
101101
}
102102

103-
// When a 3rd party dependency has native libraries, but the project has no externalNativeBuild block, we don't send symbols (yet).
104103
@Test
105-
fun `don't send 3rd party native library symbols when the project has no native libraries`() {
104+
fun `send 3rd party native library symbols even when the project has no native libraries`() {
106105
rule.runTest(
107106
fixture = "android-3rd-party-symbols",
108107
task = "build",
@@ -116,8 +115,8 @@ class AndroidNdkTest {
116115
},
117116
assertions = {
118117
verifyBuildTelemetryRequestSent(defaultExpectedVariants)
119-
verifyNoHandshakes()
120-
verifyNoUploads()
118+
verifyHandshakes(defaultExpectedLibs, defaultExpectedArchs, defaultExpectedVariants)
119+
verifyUploads(defaultExpectedLibs, defaultExpectedArchs, defaultExpectedVariants)
121120
}
122121
)
123122
}

embrace-gradle-plugin-integration-tests/src/test/java/io/embrace/android/gradle/integration/testcases/ConfigInstrumentationTest.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ class ConfigInstrumentationTest {
5656
File(projectDir, "src/main/embrace-config.json").outputStream().buffered().use {
5757
ResourceReader.readResource("config-overrides.json").buffered().copyTo(it)
5858
}
59+
// TODO: why is libembrace-native uploaded in this fixture, but not in the rest?
60+
setupMockResponses(
61+
expectedLibs = listOf("libembrace-native.so"),
62+
expectedArchs = listOf("x86_64", "x86", "armeabi-v7a", "arm64-v8a"),
63+
expectedVariants = listOf("debug", "release")
64+
)
5965
},
6066
assertions = { projectDir ->
6167
verifyInstrumentedConfig(projectDir, "instrumented-config-overrides.json")

embrace-gradle-plugin/src/main/java/io/embrace/android/gradle/plugin/EmbraceGradlePluginDelegate.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ class EmbraceGradlePluginDelegate {
5252
project,
5353
behavior,
5454
embraceVariantConfigurationBuilder,
55-
variantConfigurationsListProperty,
56-
agpWrapper
55+
variantConfigurationsListProperty
5756
)
5857

5958
taskRegistrar.registerTasks()

embrace-gradle-plugin/src/main/java/io/embrace/android/gradle/plugin/api/EmbraceExtension.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ abstract class EmbraceExtension @Inject internal constructor(objectFactory: Obje
3535
*/
3636
val failBuildOnUploadErrors: Property<Boolean> = objectFactory.property(Boolean::class.java).convention(true)
3737

38+
/**
39+
* A custom directory that, if set, should contain architecture directories (arm64-v8a/, etc.) with shared object files (.so files).
40+
* This directory will be used to upload the shared object files to Embrace, and use them for crash symbolication.
41+
*/
42+
val customSymbolsDirectory: Property<String> = objectFactory.property(String::class.java)
43+
3844
/**
3945
* DSL for configuring how Embrace instruments bytecode.
4046
*/

embrace-gradle-plugin/src/main/java/io/embrace/android/gradle/plugin/config/PluginBehavior.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ interface PluginBehavior {
5757
val autoAddEmbraceComposeDependency: Boolean
5858

5959
/**
60-
* A custom directory containing SO files, set via `swazzler.customSymbolsDirectory`
60+
* A custom directory containing SO files, set via `embrace.customSymbolsDirectory`
6161
*/
6262
val customSymbolsDirectory: String?
6363

embrace-gradle-plugin/src/main/java/io/embrace/android/gradle/plugin/config/PluginBehaviorImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class PluginBehaviorImpl(
7373
}
7474

7575
override val customSymbolsDirectory: String? by lazy {
76-
extension.customSymbolsDirectory.orNull
76+
embrace.customSymbolsDirectory.orNull ?: extension.customSymbolsDirectory.orNull
7777
}
7878

7979
override fun isInstrumentationDisabledForVariant(variantName: String): Boolean {

embrace-gradle-plugin/src/main/java/io/embrace/android/gradle/plugin/config/ProjectType.kt

Lines changed: 0 additions & 12 deletions
This file was deleted.

embrace-gradle-plugin/src/main/java/io/embrace/android/gradle/plugin/config/ProjectTypeVerifier.kt

Lines changed: 0 additions & 50 deletions
This file was deleted.

embrace-gradle-plugin/src/main/java/io/embrace/android/gradle/plugin/config/UnitySymbolsDir.kt

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)