开发者

Check if a package exist in Ant script?

开发者 https://www.devze.com 2022-12-29 05:56 出处:网络
I am writing Ant script to generate Javadoc for my program. the ant script as: <javadoc access=\"public\"

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/${curr开发者_JAVA技巧ent.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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消