File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed
embrace-gradle-plugin-integration-tests
fixtures/android-dexguard
src/test/java/io/embrace/android/gradle/integration/testcases Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments