tags:

views:

60

answers:

1

I am writing Ant script to generate javadoc for my program. the ant script as:

<javadoc access="public" 
    source="1.6" 
    sourcepath="${basedir}/../${current.project}/src" 
    destdir="${basedir}/dist/doc/${current.project}" 
    packagenames="${current.project}" />

But I got trouble if the ${current.project} (packagenames="${current.project}") does not exist, then Ant will throw error and stop the progress.

I want to ask is there any way to check that if the package name (${current.project}) does not exist, then Ant will continue to do its jobs until end?

A: 

Hi, you could add the attribute failonerror="false" to your javadoc task, so it will prevend the whole build from failing - but the javadoc task won´t run anyway.

CodeSeavers
But that is not what I want. My need is to want to keep javadoc task running even if some packages do not exist.
ipkiss
Is it possible for you to work with wildcards in a default value for ${current.project} - like com.yourcompany.project.* ?
CodeSeavers
I have not tried that yet. But does it mean that by placing com.yourcompany.project.*, it means generate javadoc for package starting with "com.yourcompany.project". If so, this is not what I am trying to do as I just want to generate for the package "com.yourcompany.project" only.
ipkiss