Hi there,

i have a some tasks in my build which are needing certain system properties. In case one of this tasks is executed and a property is not set, i want to stop the build with a message but without stacktrace.

I tried that with:
----------------------------------------------------
prop1 = System.getProperty("prop1")

build.taskGraph.whenReady {graph ->
  if (graph.hasTask(':task1')) {
    if (prop1 == null) {
throw new InvalidUserDataException("Please define -Dprop1 as vm variable");
    }
}
----------------------------------------------------
This shows a stacktrace because on top of the InvalidUserDataException there is a InvokerInvocationException since the code is a closure.

Accessing just build.taskGraph.hasTask(':task1') in the init task or in the plain build file gives me "Task information is not available, as this task execution graph has not been populated."

Any hints how to come around this ?
Johannes

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101tec GmbH
Halle (Saale), Saxony-Anhalt, Germany
http://www.101tec.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to