Gradle Plugin for Continuous Integration of AppSweep App Testing.
Configuring the Plugin • Initiate the Scan • Further Configuration
Configuring the Plugin
The AppSweep plugin is published in the Gradle Public Repository, and can be easily added to your Android project by adding
plugins {
id "com.guardsquare.appsweep" version "0.1.4"
// Apply other plugins here
}
Next, you need to configure the plugin by providing an API key for your project.
appsweep {
apiKey "gs_appsweep_SOME_API_KEY"
}
Initiate the Scan
When the Gradle plugin is enabled and configured, some multiple uploadToAppSweep*
Gradle tasks are registered.
More specifically, one task will be registered for each build variant of your app. For example, if you want to upload your release build variant, you can run:
gradle uploadToAppSweepRelease
in the root folder of your app.
Moreover, if you have DexGuard configured in your project to create a protected build of your app, additional Gradle tasks will be registered for the protected builds. For example, to upload your protected release build, run:
gradle uploadToAppSweepReleaseProtected
To see all available AppSweep tasks, use
gradle tasks --group=AppSweep
Further Configuration
In the appsweep
-block in your build.gradle(.kts)
file, you can make additional configurations.
Tags
By default, the Gradle plugin will tag each uploaded build with the variant name (e.g. Debug
or Release
). Additionally it will add a Protected
tag for builds uploaded using the uploadToAppSweep{variant}Protected
tasks. You can override this behavior and set your own tags:
appsweep {
apiKey "gs_appsweep_SOME_API_KEY"
configurations {
release {
tags "Public"
}
}
}
This will tag all builds of the release variant with Public
.
Commit hash
By default, the Gradle plugin will keep track of the current commit hash. This will then be displayed along with your build results so you can easily identify which version was analysed. By default the command git rev-parse HEAD
is used to obtain this commit hash.
If you don't want to keep track of the commit hash, you can turn off this feature by specifying the addCommitHash
option:
appsweep {
apiKey "gs_appsweep_SOME_API_KEY"
addCommitHash false
}
You can also use an alternative command to retrieve the commit hash by overriding the commitHashCommand
option:
appsweep {
apiKey "gs_appsweep_SOME_API_KEY"
commitHashCommand "hg id -i"
}