v1.8.0
This release introduces the capability to distinguish the plugin API and implementation. The distinction can be made using two jar tasks or source sets. The following example shows a glance of what this new capability is about:
// Remove `api` packages from implementation JAR
tasks.named('jar', Jar) {
exclude('**\/api\/**')
}
// Configure Gradle plugin API as a custom JAR that only include `api` packages
gradlePlugin {
api {
jarTask = tasks.register('apiJar', Jar) {
from(sourceSet.flatMap { it.output.elements })
include('**\/api\/**')
archiveClassifier = 'api'
}
}
}
Note this feature may receive breaking changes over the next few releases. Feel free to give it a try and report any issue you encounter.