Hello Neil,
The user mailinglist is deprecated. The forum is the place to go.

regards,
rené
10. April 2012 21:04
Oh OK I will try that. Incidentally, I have managed to accomplish the desired effect from the "other direction" by using an onlyIf closure. Is one preferred over the other?

I will post new questions to the forum. Is this mailing list deprecated? Can you help me distinguish which messages go here vs. the forum?

Thanks.


From: Rene Groeschke <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Tue, 10 Apr 2012 13:39:51 -0500
To: "[email protected]" <[email protected]>
Subject: Re: [gradle-user] Conditional Task Dependency

Hello Neil,
a dependsOn declaration in a doFirst closure has no effect, because the doFirst closure is executed, when the task graph is already created and gradle executes each task in that directed graph. try
-------------------
bar{
  def aFile = file("/path/to/file")
  if (!aFile.exists()) {
    println "Doesn't exist"
    dependsOn foo
  }
}
 

-------------------
instead. BTW.: the gradle forum (http://forums.gradle.org/gradle) is a much better place for this kind of question.

regards,
René


10. April 2012 20:39
Hello Neil,
a dependsOn declaration in a doFirst closure has no effect, because the doFirst closure is executed, when the task graph is already created and gradle executes each task in that directed graph. try
-------------------
bar{
  def aFile = file("/path/to/file")
  if (!aFile.exists()) {
    println "Doesn't exist"
    dependsOn foo
  }
}
 

-------------------
instead. BTW.: the gradle forum (http://forums.gradle.org/gradle) is a much better place for this kind of question.

regards,
René




Reply via email to