Move precommit dependencies to precommit for clarity.

This commit is contained in:
Dawid Weiss 2020-01-08 14:20:16 +01:00
parent 7e4c841aa7
commit 7a12c89ce6
5 changed files with 14 additions and 10 deletions

View File

@ -64,9 +64,8 @@ allprojects { prj ->
]
}
// Attach validation to check and precommit tasks.
// Attach validation to check task.
check.dependsOn forbiddenApisMain, forbiddenApisTest
precommit.dependsOn forbiddenApisMain, forbiddenApisTest
// Disable sysout signatures for these projects.
if (prj.path in [

View File

@ -49,7 +49,4 @@ configure(rootProject) {
}
}
}
// Attach to precommit.
precommit.dependsOn checkWorkingCopyPristine
}

View File

@ -53,7 +53,6 @@ allprojects {
description = "Apply all dependency/ license checks."
}
check.dependsOn(licenses)
precommit.dependsOn(licenses)
}
subprojects {

View File

@ -1,12 +1,23 @@
// This adds top-level 'precommit' task.
// Validation tasks attach themselves to it in their own
// respective build scripts.
configure(rootProject) {
task precommit() {
group = 'Precommit'
description = "All precommit checks"
// Root-level dependencies.
dependsOn verifyLocks
dependsOn ":versionsPropsAreSorted"
dependsOn ":checkWorkingCopyPristine"
// Attach tasks from other projects using lazy collection
// as they may not yet be defined.
dependsOn allprojects.collect { prj ->
prj.tasks.matching { task -> task.name in [
"forbiddenApisMain",
"forbiddenApisTest",
"licenses",
]}
}
}
}

View File

@ -14,6 +14,4 @@ configure(rootProject) {
}
}
}
precommit.dependsOn versionsPropsAreSorted
}