1

We develop a closed sources library in Kotlin that is released as AAR. Unfortunatly our users can't see the KDoc (JavaDoc for Kotlin) in the IDE. Therefore we want to release the source of the public API only. The internals and the public API can be distingushed by there packages foo.bar.api.* and foo.bar.internal.*

Is this possible with gradle 3.4?

I found Create Android library AAR including javadoc and sources but we don't want to include all sources.

Chriss
  • 5,157
  • 7
  • 41
  • 75

1 Answers1

0

Let's assume you know already how to create and use the javadoc and sources artifacts. The Jar type only creates a special zip archive and copies the files for it. So you can exclude files as well:

task androidSourcesJar(type: Jar) {
    classifier = 'sources'
    baseName = artifact_id
    from android.sourceSets.main.java.srcDirs
    exclude 'foo./bar/internal/**'
}
tynn
  • 38,113
  • 8
  • 108
  • 143