Last active
April 30, 2018 21:11
-
-
Save patrickhammond/f7d7c3f1a3cb7af4a1e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put this at the end of your project build.gradle | |
// Execute on your CI server with something like: | |
// ./gradlew continuousIntegration -Pfingerprint=asdf -PbuildNumber=2 -PdisablePreDex | |
evaluationDependsOnChildren(); | |
task staticAnalysis() { | |
def appProject = subprojects.find { project -> 'app' == project.name } | |
dependsOn appProject.getTasksByName('findbugs', true) | |
dependsOn appProject.getTasksByName('pmd', true) | |
dependsOn appProject.getTasksByName('lint', true) | |
} | |
task testing() { | |
def appProject = subprojects.find { project -> 'app' == project.name } | |
def unitTestTasks = appProject.getTasksByName('testAppDebugUnitTest', true); | |
def integrationTestTasks = appProject.getTasksByName('spoonAppDebugAndroidTest', true); | |
dependsOn unitTestTasks | |
dependsOn integrationTestTasks | |
// Run unit tests first | |
integrationTestTasks.each { task -> task.mustRunAfter unitTestTasks } | |
} | |
task release() { | |
def appProject = subprojects.find { project -> 'app' == project.name } | |
dependsOn appProject.getTasksByName('assembleAppRelease', true) | |
} | |
task continuousIntegration() { | |
dependsOn staticAnalysis | |
dependsOn testing | |
dependsOn release | |
// Static analysis first, then testing, then release | |
testing.mustRunAfter staticAnalysis | |
release.mustRunAfter testing | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment