Hey,
Try this:
task generateRestApiDocs(type: Javadoc) {
//you need to specify the source. If you don't do it the task will have
nothing to do
//and 'build' folder may not be created at all as you noticed
source sourceSets.main.allJava
//if you want to use custom doclet please specify the docletpath
options.doclet = "com.lunatech.doclets.jax.jaxrs.JAXRSDoclet"
options.docletpath = configurations.jaxDoclet as List
...
}
>First off, I don't know how to set the argument "-jaxrscontext
http://localhost:8080/myapp"
Is this a command line arg you want to pass to 'javadoc' command? If that's
the case then I think you're out of luck :/ It seems that at the moment
gradle javadoc task does not offer a configuration of 'custom' javadoc
command line parameters.
If this arg is important you might have to use ant as you initially wanted.
In this case you need fix your initial script: generateRestApiDocs should
not be of type Javadoc and it should be declared with '<<' (execution vs
configuration).
>Second, when I run this with -d set, I find BUILD SUCCESSFUL, but there is
not even a build directory created--let alone a reports directory.
It's because of the missing 'source' attribute.
BTW. Please review the jaxDoclet dependencies. Not sure if you meant it but
you set the dependency to a 'parent' instead of the jar ('doclets').
Hope that helps!
Szczepan
On Thu, Mar 3, 2011 at 11:13 PM, Neil Chaudhuri <
[email protected]> wrote:
> So I tried the following:
>
> task generateRestApiDocs(type: Javadoc) {
> classpath = classpath + configurations.jaxDoclet
> destinationDirName = reportsDirName + "/rest-api-docs"
> options.doclet = "com.lunatech.doclets.jax.jaxrs.JAXRSDoclet"
> }
>
> First off, I don't know how to set the argument "-jaxrscontext
> http://localhost:8080/myapp"
>
> Second, when I run this with -d set, I find BUILD SUCCESSFUL, but there is
> not even a build directory created--let alone a reports directory. I do see
> a message:
>
> 17:04:55.281 [INFO] [org.gradle.api.internal.tasks.DefaultTaskExecuter]
> Execution stopped by some action with message: File collection does not
> contain any files.
>
> Any insight is appreciated.
>
> Thanks.
>
>
>
> -----Original Message-----
> From: Peter Niederwieser [mailto:[email protected]]
> Sent: Wednesday, March 02, 2011 8:39 PM
> To: [email protected]
> Subject: [gradle-user] Re: Executing jax-doclet as a Javadoc Task
>
>
> Neil Chaudhuri wrote:
> >
> > When I execute the task, I get "Cause: No source files and no packages
> > have been specified."
> >
>
> You need to get rid of the "ant.javadoc". A task of type "Javadoc" already
> knows how to generate Javadoc. With "ant.javadoc", you are generating it a
> second time, and even in the configuration phase.
>
>
> Neil Chaudhuri wrote:
> >
> > Second, how do I reference the source path. I have gone over the docs
> > thoroughly, and everything I try has failed.
> >
>
> The source path is set with the "source" property:
> http://gradle.org/0.9/docs/dsl/org.gradle.api.tasks.javadoc.Javadoc.html
>
> Typically you don't have to set it manually. The Java plugin does it for
> you.
>
> --
> Peter Niederwieser
> Developer, Gradle
> http://www.gradle.org
> Trainer & Consultant, Gradle Inc.
> http://www.gradle.biz
> Creator, Spock Framework
> http://spockframework.org
>
>
> --
> View this message in context:
> http://gradle.1045684.n5.nabble.com/Executing-jax-doclet-as-a-Javadoc-Task-tp3407363p3407392.html
> Sent from the gradle-user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>