Skip to content

Instantly share code, notes, and snippets.

@talenguyen
Created March 20, 2019 10:45
Show Gist options
  • Save talenguyen/a51fc1f847ffe30c07a4d6a28215255a to your computer and use it in GitHub Desktop.
Save talenguyen/a51fc1f847ffe30c07a4d6a28215255a to your computer and use it in GitHub Desktop.
Run lint/test on module
// Define custom lint task, say customLintCheck and includes all lint tasks from module
def customLintCheck = tasks.register("customLintCheck") {
group "verification" // Add task to verification group.
description "Run lint check for all"
dependsOn gradle.includedBuild('productdetail').task(':productdetail:lintDebug')
}
// Make customLintCheck run along with :app:lintDebug
subprojects {
if (project.name == 'app') {
tasks.whenTaskAdded { task ->
if (task.name == 'lintDebug') {
task.configure {
dependsOn customLintCheck
}
}
}
}
}
# Do same with test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment