Skip to content

Use Project.ext as a fallback for property lookups#316

Open
isXander wants to merge 2 commits into
neoforged:NG_7.1from
isXander:feat/extra-sourced-conventions
Open

Use Project.ext as a fallback for property lookups#316
isXander wants to merge 2 commits into
neoforged:NG_7.1from
isXander:feat/extra-sourced-conventions

Conversation

@isXander

Copy link
Copy Markdown

What

I have made WithPropertyLookup source from a configuration-time snapshot value
of Project.ext as a fallback for property lookups, when providers.gradleProperty() has no value.

Why

This change allows for programmatic configuration of NeoGradle conventions.

Such uses include:

  • Plugins that apply before NeoGradle may set conventions required for NeoGradle to correctly behave in conjunction with it.
  • build-logic conventions plugins may set the same set of conventions across all applied projects.

@neoforged-pr-publishing

Copy link
Copy Markdown
  • Publish PR to GitHub Packages

@marchermans marchermans enabled auto-merge (rebase) May 23, 2026 12:36

@marchermans marchermans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can improve this a little bit.

@lukebemish

Copy link
Copy Markdown
Contributor

This suggestion breaks project isolation, and current Gradle work seems to be moving heavily away from project properties and especially from project.ext n general (I'll try and find the recent issues/PRs when I have a chance). I am heavily opposed to this suggestion.

Use of project properties in general is a bad idea. In addition to breaking project isolation in certain scenarios when loaded from subprojects (see: arch loom, for details), this whole scenario makes a bunch of logic now order-dependent that was entirely declarative before.

If the goal is simply to be able to configure them per-project -- you should prefer having a Property<Boolean> extension field somewhere that is convention-ed to the gradleProperty. My understanding is that most of these fields already are? If they need to be loaded too early for that -- a Settings extension to configure values on the project extensions would likely suffice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants