gradle-plugins / toolbox

Painless and fast Gradle plugin development :rocket:
https://nokee.dev/docs/toolbox
Apache License 2.0
20 stars 3 forks source link

Introduce versioned source set and optional API source set #88

Open lacasseio opened 1 year ago

lacasseio commented 1 year ago

Plugin authors will now be able to split their API and implementation, effectively hiding any implementation details from consumers of the plugin. This feature is only available if the build specifies an apiSourceSet:

gradlePlugin {
    apiSourceSet = sourceSets.create('api')
}

This PR also introduced versioned source sets, meaning the source sets will be tied to a specific Gradle version. The Gradle API dependency will reflect the selected Gradle version. At the moment, we rely on a naming convention:

sourceSets {
    'v6.7' {} // Gradle 6.7
    'v7.0' {} // Gradle 7.0
}

The main source set will automatically include an implementation dependency on each versioned source set. If an API source set is declared, then each versioned source set will have a compileOnly dependency on the API source set.