Gradle Spoon Plugin

A Gradle plugin for running Android instrumentation tests with Spoon.

License

License

Categories

Categories

Gradle Build Tools Spoon Application Testing & Monitoring Code Analysis
GroupId

GroupId

de.felixschulze.gradle
ArtifactId

ArtifactId

gradle-spoon-plugin
Last Version

Last Version

2.7.3
Release Date

Release Date

Type

Type

jar
Description

Description

Gradle Spoon Plugin
A Gradle plugin for running Android instrumentation tests with Spoon.
Project URL

Project URL

https://github.com/x2on/gradle-spoon-plugin
Source Code Management

Source Code Management

https://github.com/x2on/gradle-spoon-plugin

Download gradle-spoon-plugin

How to add to project

<!-- https://jarcasting.com/artifacts/de.felixschulze.gradle/gradle-spoon-plugin/ -->
<dependency>
    <groupId>de.felixschulze.gradle</groupId>
    <artifactId>gradle-spoon-plugin</artifactId>
    <version>2.7.3</version>
</dependency>
// https://jarcasting.com/artifacts/de.felixschulze.gradle/gradle-spoon-plugin/
implementation 'de.felixschulze.gradle:gradle-spoon-plugin:2.7.3'
// https://jarcasting.com/artifacts/de.felixschulze.gradle/gradle-spoon-plugin/
implementation ("de.felixschulze.gradle:gradle-spoon-plugin:2.7.3")
'de.felixschulze.gradle:gradle-spoon-plugin:jar:2.7.3'
<dependency org="de.felixschulze.gradle" name="gradle-spoon-plugin" rev="2.7.3">
  <artifact name="gradle-spoon-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.felixschulze.gradle', module='gradle-spoon-plugin', version='2.7.3')
)
libraryDependencies += "de.felixschulze.gradle" % "gradle-spoon-plugin" % "2.7.3"
[de.felixschulze.gradle/gradle-spoon-plugin "2.7.3"]

Dependencies

compile (3)

Group / Artifact Type Version
com.android.tools.build : gradle jar 1.5.0
com.squareup.spoon : spoon-runner jar 1.2.1
de.felixschulze.teamcity : teamcity-status-message-helper jar 1.2

Project Modules

There are no modules declared in this project.

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.

Versions

Version
2.7.3
2.7.2
2.7.1
2.7
2.6.1
2.6
2.5
2.4
2.3
2.2
2.1
2.0
1.4
1.3
1.2
1.1.2
1.1.1
1.1.0
1.0.1
1.0.0
0.9.7
0.9.6
0.9.5
0.9.1
0.9