-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Deprecate Convention
concept
#3425
Comments
@oehme Any idea on how to tackle the deprecation message issue described above? I don't actually expect a lot of users to create their own |
We shouldn't do something ad hoc here for deprecation warnings. We should do whatever we do everywhere else (and make that "whatever" better). |
We shouldn't be deprecating as long as they are the only way to do certain things, like defining custom source set types. Once that is done, we deprecate like everything else. |
The Kotlin plugin defines a custom |
I use
Replacing convention with extension I would have to use extra block in each build script, which is not nice. |
The point is exactly to have an extra block to reduce the clutter on the Project API. It makes it much clearer what you are configuring. Please never use Groovy metaclass, as that makes your plugin unusable from Kotlin. |
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution. |
I think we still want to do that |
@eskatos is this something that would be helpful with configuration caching? |
@big-guy Not really. It is mostly helpful because extensions are a better replacement and for good Kotlin DSL support. |
We have the following conventions in the codebase:
Before we can deprecate the concept of conventions we need to make sure that properties stored in a convention are also available as an extension. TODOs:
|
🎉 This is in for Gradle 7.1! |
Expected Behavior
The
Convention
concept should be deprecated for removal. A deprecation message is rendered when accessing theConvention
through theProject
API.There's a usability issue here. Builds that use plugins configuring Gradle core plugins through
Convention
would always render the deprecation warning. Users and plugin authors cannot fix this by switching to a different API. Potentially this situation could be mitigated by implementing #3332. Alternatively, we should probably not render a deprecation warning at all.Current Behavior
Conventions are used by Gradle core plugins. Users (more specifically plugin authors) have to use a cumbersome API to access convention values. For example:
Context
Convention
is a legacy concept and has been effectively been replaced by extensions. Some Gradle core plugins still use this concept and should be migrated to extensions in the long run.Convention
should be deprecated.The text was updated successfully, but these errors were encountered: