For example we have some Android library in AAR format compiled with all required obfuscations applied. When we include this library into some project as dependency, the library's API documentations become unavailable. We can generate sources jar in this way for example:
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
But in this case all sources will be public and available to be reviewed by library's users.
Question: is there any way to generate some kind of header-only sources jar file in Gradle, which will have only methods and fields signatures with all required documentations, but with empty implementations?
This can be a possible solution: How to generate source.jar of the public API of a closed source AAR? But the best way in my opinion is not only in hiding of internal classes, but in removal of all implementations at all (even in public classes).