Disable all JavaDoc in Gradle

﹥>﹥吖頭↗ 提交于 2019-11-30 03:46:57

If you have a root project build script, then you can disable all the subprojects's tasks by it's type. In your case, by type Javadoc, like:

subprojects {
    tasks.withType(Javadoc).all { enabled = false }
}

I ran into this as well and after digging through Gradle's source code I found a solution that works in Gradle 2.9.

Instead of options.addStringOption('Xdoclint:none', '-quiet') try options.addBooleanOption('Xdoclint:none', true). That should properly pass the -Xdoclint:none option to the underlying javadoc invocation and ignore the errors while still producing Javadoc output. I did this directly in the javadoc task declaration, but it would probably work using the allprojects method that you tried above.

This is how I disabled it - in my my build.gradle file I added:

tasks.withType(Javadoc).all { enabled = false } // non ascii characters make it crash
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!