From 2b21701e9e18c197d4bcfa9c86bea1845a0c2553 Mon Sep 17 00:00:00 2001
From: Cedric Beust
- The difference between runAfter
and wrapAfter
is subtle but important. runAfter
+ The difference between runAfter
and alwaysRunAfter
is subtle but important. runAfter
is just a declaration of dependency. It's basically the reverse of runBefore
but it's useful in case
you are not the author of the task you want to run before (if you were, you would just use the runBefore
annotation on it). Since you can't say "a runBefore b"
because you don't own task "a",
@@ -414,8 +414,8 @@ fun lineCount(project: Project): TaskResult {
For example, you could have a signJarFile
task that should always be invoked if someone builds a jar
file. You don't expect users to invoke that target explicitly, but whenever they invoke the assemble
target, you want your signJarFile
target to be invoked. When you want such a task to always be invoked
- even if the user didn't explicitly request it, you should use wrapAfter
. You are essentially wrapping
- an existing task with your own task. Note that there is no wrapBefore
annotation since runBefore
+ even if the user didn't explicitly request it, you should use alwaysRunAfter
.
+ Note that there is no alwaysRunBefore
annotation since runBefore
achieves the same functionality.