Android Gradle plugin based on the talk "The other Android Getting Started Guide" in the Big Android BBQ (Europe). This plugin enables the following features in your android project:
- Some continuous integration tips
- Unit testing
- Unit test code coverage: Jacoco
- Code quality: Sonar
- Documentation: Doclava
- Library distribution in JCenter and MavenCentral
Add the classpath dependency:
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.github.droidpl:grillplugin:{version}'
}
}
Apply a plugin in the application or library:
apply plugin: "grill"
grill {
debug [Boolean]
codeQuality {
host [String Url]
projectKey [String]
projectName [String]
projectVersion [String version]
dbHost [String Url]
dbUser [String]
dbPassword [String]
}
documentation {
templateDir [String]
doclavaVersion [String version]
}
coverage {
excludes ([String[]]) // (["**/*$MyGeneratedClass*.*"])
}
googlePlay {
privateKeyId [String]
clientEmail [String]
privateKey [File (.pem file in your system]
customize { editor [AppEdit], editId [String], apk [Apk]
// find more doc here: http://jeremie-martinez.com/2016/01/14/devops-on-android/
}
}
disribute {
libVersion [String] (Optional if in project.version)
libPackaging [String] (Optional)
libGroupId [String] (Optional if in project.group)
libArtifact [String] (Optional)
libName [String]
libDescription [String] (Optional)
libLicName [String] (Optional: default apache v2)
libLicUrl [String] (Optional: default apache v2)
libDevId [String] (Optional)
libDevName [String] (Optional)
libDevEmail [String] (Optional)
libSiteUrl [String] (Optional)
bintrayRepoName [String]
bintrayUser [String]
bintrayKey [String]
bintrayRepo [String] (Optional: default maven)
bintrayMavenCentralUser [String] (Optional)
bintrayMavenCentralPassword [String] (Optional)
bintrayLicenses [String[]] (Optional)
bintrayArtifactJavadoc [Task]
bintrayArtifactSources [Task]
bintrayMavenSync [Boolean]
binrayGpgSign [Boolean]
bintrayGpgPassphrase [String]
}
}
To install the plugin use the following command line:
./gradlew -PpluginCompile grillplugin:install
To install the application in your device, you need to install the plugin first as stated in the previous section. After that you can execute one of the following commands to test the tasks explained in the talk.
- Unit testing reports with jacoco on JVM:
createDebugUnitTestCoverageReport
- Code quality information uploaded:
codeQualityDebug
- Documentation from doclava:
documentationDebug
- Google play publishing:
googlePlayPublishDebug
- Install the application with CI info:
installDebug
- Unit testing reports with jacoco on JVM:
createReleaseUnitTestCoverageReport
- Code quality information uploaded:
codeQualityRelease
- Documentation from doclava:
documentationRelease
- Google play publishing:
googlePlayPublishRelease
- Install the application with CI info:
./gradlew installRelease