Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce versioned source set and optional API source set #88

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

lacasseio
Copy link
Member

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.

Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Consumer of this plugin will only get the API classes when an API source
set is declared.

Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
Signed-off-by: Daniel Lacasse <daniel@lacasse.io>
@lacasseio lacasseio self-assigned this Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant