This message was deleted.
# community-support
s
This message was deleted.
c
one approach for this is to always have taskA depend on taskB, but disable taskB (
onlyIf
) as necessary.
z
the problem is
taskB
may or may not exist
I can’t disable a task that does not exist!
I guess I could have a dedicated no-op task, but that seems a bit sloppy
c
Can you make it always exist, but make the execution conditional?
z
yep! looks like a no-op task would be the way to go here, which is unfortunate
c
Shouldn't need to be a no-op, make the execution conditional with onlyIf
z
yep! either a real task or a no-op one that is
onlyIf = false
c
Typically it would always be the real task, with an appropriate onlyIf to execute it when needed.
v
How is it defined whether taskA depends on taskB and how is it defined whether taskB exists? If if for example is, that taskA always depends if taskB exists and taskB always exists if plugin X is applied, then use
pluginManager.withPlugin
to react to X being applied and add the dependency in there.