A Gradle plugin for running Android instrumentation tests with Spoon.
Groovy
Latest commit 7811dc2 Jan 8, 2016 @x2on Merge pull request #17 from RomainPiel/noanimations
added support for noAnimations flag
Permalink
Failed to load latest commit information.
example
gradle/wrapper
src/main
.gitignore
.travis.yml
LICENSE
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

gradle-spoon-plugin Build Status Maven Central

A Gradle plugin for running Android instrumentation tests with Spoon.

Basic usage

Add to your build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'de.felixschulze.gradle:gradle-spoon-plugin:2.7.3'
    }
}

apply plugin: 'de.felixschulze.gradle.spoon'

Advanced usage

Add to your build.gradle

spoon {
    teamCityLog = true
    debug = true
    noAnimations = true
    failOnFailure = false
    testSizes = ['small', 'medium']
    adbTimeout = 10*60
    failIfNoDeviceConnected = false
    excludedDevices = ['f5adb1a1', 'a6asb224']
}
  • teamCityLog: Add features for TeamCity
  • debug: Activate debug output for spoon
  • noAnimations: Deactivate gif generation
  • failOnFailure: Deactivate exit code on failure
  • testSizes: Only run test methods annotated by testSize (small, medium, large)
  • adbTimeout: ADB timeout in seconds
  • failIfNoDeviceConnected: Fail if no device is connected
  • excludedDevices: List of devices which should be excluded
  • instrumentationArgs: List of arguments to pass to the Instrumentation Runner

Running specific test classes or test methods

-PspoonTestClass=fully_qualified_test_class_package_name
-PspoonTestMethod=testMethodName

Workaround for gradle-android-plugin 1.5.0 Multidex bug

// Workaround for Multidex bug in gradle-android-plugin
// Replace Multidex dependency with some dummy dependency to avoid dex problems
// @see https://code.google.com/p/android/issues/detail?id=194609
project.getConfigurations().all { config ->
    if (config.name.contains("AndroidTest")) {
        config.resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            if (details.requested.name == "multidex") {
                details.useTarget("de.felixschulze.teamcity:teamcity-status-message-helper:1.2")
            }
        }
    }
}

Changelog

Releases

License

gradle-spoon-plugin is available under the MIT license. See the LICENSE file for more info.