Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.JandemX:gradle-spoon-plugin:2.7.3'
}
dependencies {
implementation("com.github.JandemX:gradle-spoon-plugin:2.7.3")
}
<dependency>
<groupId>com.github.JandemX</groupId>
<artifactId>gradle-spoon-plugin</artifactId>
<version>2.7.3</version>
</dependency>
libraryDependencies += "com.github.JandemX" % "gradle-spoon-plugin" % "2.7.3"
:dependencies [[com.github.JandemX/gradle-spoon-plugin "2.7.3"]]
A Gradle plugin for running Android instrumentation tests with Spoon.
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'
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 TeamCitydebug
: Activate debug output for spoonnoAnimations
: Deactivate gif generationfailOnFailure
: Deactivate exit code on failuretestSizes
: Only run test methods annotated by testSize (small, medium, large)adbTimeout
: ADB timeout in secondsfailIfNoDeviceConnected
: Fail if no device is connectedexcludedDevices
: List of devices which should be excludedinstrumentationArgs
: List of arguments to pass to the Instrumentation Runner-PspoonTestClass=fully_qualified_test_class_package_name
-PspoonTestMethod=testMethodName
// 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")
}
}
}
}
gradle-spoon-plugin is available under the MIT license. See the LICENSE file for more info.