Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.
/ gradle-spoon-plugin Public archive

A Gradle plugin for running Android instrumentation tests with Spoon.

License

Notifications You must be signed in to change notification settings

x2on/gradle-spoon-plugin

Repository files navigation

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.

About

A Gradle plugin for running Android instrumentation tests with Spoon.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages