Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
Open
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ spoon {

// To grant permissions to Android M >= devices */
grantAllPermissions = true

// Define build variant to be used for testing. Useful when working with apk splits */
testVariant = "x86Screenshot"
}
```

Expand Down
4 changes: 4 additions & 0 deletions src/main/groovy/com/stanfy/spoon/gradle/SpoonExtension.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@ class SpoonExtension {

/** Grants all permisions for Android M >= devices */
boolean grantAllPermissions

/** Define build variant to be used for testing (ex. testVariant = "x86Screenshot"). Useful when working with apk splits **/
String testVariant

}
6 changes: 5 additions & 1 deletion src/main/groovy/com/stanfy/spoon/gradle/SpoonPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ class SpoonPlugin implements Plugin<Project> {
throw new UnsupportedOperationException("Spoon plugin for gradle currently does not support abi/density splits for test apks")
}
SpoonExtension config = project.spoon
return testVariant.testedVariant.outputs.collect { def projectOutput ->
return testVariant.testedVariant.outputs
.findAll { def projectOutput ->
config.testVariant == null || config.testVariant.isEmpty() || (projectOutput.getName() == config.testVariant)
}
.collect { def projectOutput ->
SpoonRunTask task = project.tasks.create("${TASK_PREFIX}${testVariant.name.capitalize()}${suffix}", SpoonRunTask)
task.configure {
group = JavaBasePlugin.VERIFICATION_GROUP
Expand Down