Check if package exists in Ant script?

I am writing an Ant script to generate Javadoc for my program. Ant script like:

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

      

But I'm having trouble if ${current.project} (packagenames="${current.project}")

doesn't exist and then Ant will throw an error and stop running.

I want to ask if there is a way to check that if the package name ( ${current.project}

) does not exist then Ant will continue to execute its jobs until the end?

+2


a source to share


1 answer


you can add an attribute failonerror="false"

to your javadoc task, so it will trump the entire build due to a failure - but the javadoc task won't work anyway.



0


a source







All Articles