Hi Kenneth,

I think the easiest way to run wsimport during your build is to create a gradle task based on the wsimport ant task. If you declare the task like this:
---------
task wsimport(dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME)  {
    doLast{
        //define your ant task and execute it.
    }
}
compileJava.dependsOn(wsimport)
---------
the task should be executed just before your compileJava task is executed.
You can use gradles great (but unfurtunately not yet proper documented) "incremental build" feature to check during your build if the task must be executed or not. To use this feature you have to define output and input parameters of your task:

---------
task wsimport(dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME)  {
    outputs.files //your destdir / your srcdestdir
    inputs.files //your wsdl file
    doLast{
        //define your ant task and execute it.
    }
}
compileJava.dependsOn(wsimport)
---------

Now the task wsimport is only executed if the output wasn't created before or the wsdl file has changed.

regards,
René




Am 29.08.10 01:10, schrieb Kenneth Kousen:
I think this is easy, I'm not sure. I'm building a Java/Groovy project that's based on a SOAP-based web service. I normally generate the client stubs using the "wsimport" command from the command line ahead of time, but I'd like to make that part of the overall build process if the stubs don't already exist.

I'd like to define a task that checks to see if the stubs are already there (I know what the package is, so I can check whether it exists or not), and, if not, runs wsimport before the compile task. How do I do that?

Ken
--
Kenneth A. Kousen
President
Kousen IT, Inc.

Email: [email protected] <mailto:[email protected]>
Site: http://www.kousenit.com
Blog: http://kousenit.wordpress.com
Twitter: @kenkousen


--
------------------------------------
Rene Groeschke

[email protected]
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------

Reply via email to