Skip to content

Commit 3da985c

Browse files
committed
test: add gradle test case for dexguard
1 parent 171a46c commit 3da985c

File tree

2 files changed

+58
-0
lines changed
  • embrace-gradle-plugin-integration-tests

2 files changed

+58
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
plugins {
2+
id("com.android.application")
3+
id("io.embrace.swazzler")
4+
id("io.embrace.android.testplugin")
5+
}
6+
7+
integrationTest.configureAndroidProject(project)
8+
9+
10+
android {
11+
buildTypes {
12+
release {
13+
minifyEnabled = false
14+
}
15+
}
16+
}
17+
18+
// setup a fake dexguard task
19+
project.tasks.register("dexguardApkRelease") {
20+
def mappingFile = project.layout.buildDirectory.file("mapping.txt")
21+
outputs.file(mappingFile)
22+
23+
doLast {
24+
mappingFile.get().asFile.text = "Hello, World!"
25+
}
26+
}
27+
28+
project.tasks.named("assemble").configure {
29+
dependsOn("dexguardApkRelease")
30+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package io.embrace.android.gradle.integration.testcases
2+
3+
import io.embrace.android.gradle.integration.framework.PluginIntegrationTestRule
4+
import io.embrace.android.gradle.integration.framework.ProjectType
5+
import org.junit.Rule
6+
import org.junit.Test
7+
8+
class DexguardTest {
9+
10+
@Rule
11+
@JvmField
12+
val rule: PluginIntegrationTestRule = PluginIntegrationTestRule()
13+
14+
private val variants = listOf("debug", "release")
15+
16+
@Test
17+
fun `dexguard task`() {
18+
rule.runTest(
19+
fixture = "android-dexguard",
20+
task = "assemble",
21+
projectType = ProjectType.ANDROID,
22+
assertions = {
23+
verifyBuildTelemetryRequestSent(variants)
24+
verifyJvmMappingRequestsSent(1)
25+
}
26+
)
27+
}
28+
}

0 commit comments

Comments
 (0)