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

LoadOptions introduced to control project loading. #7646

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

sdedic
Copy link
Member

@sdedic sdedic commented Aug 8, 2024

The motivation for the change was introduction of an additional flag "offline" for loading, since LegacyProjectLoader did not allow for authoritative ban on online operations - it reads settings and decides on its own, mostly doing ON_DEMAND operation - but in some cases it is desired not to go online explicitly even though the option permit that for the default/standard operation.

I have decided to export a LoadOptions object that is passed into the loading infrastructures and replaces a number of parameters passed down from NbGradleProjectImpl to loaders etc.

Two minor additional API additions are in this PR:

  • NbGradleProject exposes timestamp of the metadata load. The motivation is to be able to compare the metadata timestamp against GradleFiles timestamps to check if project reload should be done or not
  • NbGradleProject exposes full current Lookup, that can be used to get the instances of GradleBaseProject, GradleJavaProject - essentially the snapshot of data loaded by the loading infrastructure. Though GradleJavaProject.get(prj) can be used, it always works against 'most recent' load, while the Lookup allows consistency between BaseProject, JavaProject even if another reload happens.

@sdedic sdedic added API Change [ci] enable extra API related tests Gradle [ci] enable "build tools" tests labels Aug 8, 2024
@sdedic sdedic added this to the NB24 milestone Aug 8, 2024
@sdedic sdedic self-assigned this Aug 8, 2024
@sdedic sdedic requested review from lkishalmi and dbalek August 8, 2024 10:26
@sdedic sdedic assigned MartinBalin and sdedic and unassigned MartinBalin and sdedic Aug 8, 2024
@sdedic sdedic requested a review from MartinBalin August 8, 2024 10:26
Copy link
Contributor

@dbalek dbalek left a comment

Choose a reason for hiding this comment

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

Looks reasonable.

@sdedic
Copy link
Member Author

sdedic commented Aug 14, 2024

@lkishalmi last call, the dependent PR #7665 can be done even without this API change (the LoadOptions would just remain private to the module) through impl dependency ... but still I think theLoadOptions are useful.
If no objections / suggestions are posted, I'll merge tonight.

@lkishalmi
Copy link
Contributor

I'm on the road discovering the great Pacific Northwest. Can we hold this a bit longer?

@sdedic
Copy link
Member Author

sdedic commented Aug 26, 2024

@lkishalmi any updates ?

@sdedic
Copy link
Member Author

sdedic commented Aug 27, 2024

No update, merging. If unhappy with the API there's still time to revert in the NB24 timeframe and come up with a better / smaller idea.

@sdedic sdedic merged commit 3182e8e into apache:master Aug 27, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Change [ci] enable extra API related tests Gradle [ci] enable "build tools" tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants