Created
March 20, 2019 10:45
-
-
Save talenguyen/a51fc1f847ffe30c07a4d6a28215255a to your computer and use it in GitHub Desktop.
Run lint/test on module
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
// 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