I’m looking to tweak the javadocs for the library my company produces. We’re looking to exclude javadocs from classes that aren’t really meant for public consumption (mostly classes used internally).
I’ve marked the packages/classes that we want to exclude in the build.gradle file. However, this is causing errors to happen. I expect to get a warning, or error if there’s @link to a class which is excluded, but it’s also throwing errors when those excluded classes are simply imported. Is there a way to “include” the classes/packages, but NOT export the javadoc for them?
Error:
SweetBlue/src/com/idevicesinc/sweetblue/BleCharacteristic.java:5: error: cannot find symbol
import com.idevicesinc.sweetblue.utils.Utils;
symbol: class Utils
location: package com.idevicesinc.sweetblue.utils
So is there any reason why gradle fails at this task, compared to doing it in the command line? We were hoping to keep as much as possible in our gradle script, but if it can’t exclude packages/classes properly without screwing up the whole build, then we’ll have to just generate the docs outside of gradle.
I’m not positive, but I think this might be related to gradle feeding javadoc individual files rather than whole packages, and the exclude directive being gradle SourceTask's rather than javadoc’s.
@fab1an 's answer and specifically, classpath += sourceSets.main.output made it work for me for Java modules.
However, I can’t use that configuration on an Android-library module for javadoc generation. In my case, this is the Javadoc configuration I use for an Android-library module: