LoadOptions introduced to control project loading. #7646
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 notNbGradleProject
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.