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
Add support for build-level conventions for Property objects #28920
base: master
Are you sure you want to change the base?
Conversation
ccdf271
to
1fddb24
Compare
This is necessary because class generation needs access to the NestedRestricted annotation.
1fddb24
to
88bbf5e
Compare
@bot-gradle test this |
I've triggered the following builds for you. Click here to see all build failures. |
@bot-gradle test this |
I've triggered the following builds for you. Click here to see all build failures. |
id("com.example.test-software-type") | ||
} | ||
|
||
testSoftwareType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it would be clearer if the software types would be exposed not in the immediate scope of Settings
but in a nested scope with a clearer name like conventions {...}
. But that's not something we should finalize right now, anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel strongly about this either way. I had originally thought I would add a top-level conventions {}
block, but then decided it wasn't adding any value beyond simply nesting the configuration and thought it might be simpler for users if the convention blocks were at the top-level just like they are in the project scripts. I could easily be convinced to move it into a nested block, though. I'd be interested if anyone else has any strong opinions about this...
This adds support for build-level conventions for
Property
objects exposed by software type model objects. For each software type registered, a corresponding convention object is registered as an extension on theSettings
object. These can be configured in the declarative settings script. Then, when the software type is referenced in a project (and the corresponding plugin applied) the convention properties from the settings object are wired as the conventions of the properties on the project model object.This also introduces a
@NestedRestricted
to specify nested objects in software types that should be visited while navigating the properties of the object.Note that we will support additional types (such as
Dependencies
objects) in follow up work.Reviewing cheatsheet
Before merging the PR, comments starting with