dependencies - Skipping dependency execution of a disabled task in Gradle? -
is somehow possible not execute dependencies of task when task skipped?
in example below, i'd jar
(and dependencies of jar
) not executed if server running when executing runservertests
. server in case started process.
apply plugin: 'java' task startserverifnotrunning(dependson: jar) { onlyif { isservernotrunning() } ... } task runservertests(dependson: startserverifnotrunning) { ... }
i'd rather not add onlyif
jar
task, since other tasks should executed may depending on one. jar
task has dependencies of own.
to desired behavior, have exclude task task execution graph, rather skipping execution. can -x
command line or programmatically gradle.startparameter.excludedtasknames << "..."
or gradle.taskgraph.usefilter { task -> ... }
.