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

Add support for build-level conventions for Property objects #28920

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

ghale
Copy link
Member

@ghale ghale commented Apr 22, 2024

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 the Settings 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

  • ❌ ❓must be fixed
  • 🤔 💅 should be fixed
  • 💭 may be fixed
  • 🎉 celebrate happy things

@ghale ghale added this to the 8.9 RC1 milestone Apr 22, 2024
@ghale ghale self-assigned this Apr 22, 2024
@ghale ghale force-pushed the gh/declarative/property-conventions branch from ccdf271 to 1fddb24 Compare April 23, 2024 15:16
@ghale ghale marked this pull request as ready for review April 24, 2024 12:44
@ghale ghale requested review from a team as code owners April 24, 2024 12:44
@ghale ghale requested review from bamboo, abstratt, a team and big-guy and removed request for a team April 24, 2024 12:44
@ghale ghale force-pushed the gh/declarative/property-conventions branch from 1fddb24 to 88bbf5e Compare April 24, 2024 12:56
@ghale
Copy link
Member Author

ghale commented Apr 24, 2024

@bot-gradle test this

@gradle gradle deleted a comment from ghale Apr 24, 2024
@bot-gradle
Copy link
Collaborator

I've triggered the following builds for you. Click here to see all build failures.

@ghale
Copy link
Member Author

ghale commented Apr 25, 2024

@bot-gradle test this

@gradle gradle deleted a comment from ghale Apr 25, 2024
@bot-gradle
Copy link
Collaborator

I've triggered the following builds for you. Click here to see all build failures.

id("com.example.test-software-type")
}

testSoftwareType {
Copy link
Member

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.

Copy link
Member Author

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...

@big-guy big-guy requested a review from tresat May 8, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants