You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had to do a lot of experimenting. I think I finally got it:
If you write just the name of the extension property:
outside of a task, the current project's extension is searched, then the parent projects up to the root project.
inside of a task, the task's extension is searched first, then as in 1
If you prepend ext like this: 'ext.myprop', the ext object is used instead for your context, i.e. the task ext if within a task. The project.ext if not within a task. So only that ext object is asked for that property and the above search strategy does not take place.
I don't know about the other extension aware objects (SourceSet, DependencyHandler, Settings).
The text was updated successfully, but these errors were encountered:
Expected Behavior
Documentation should in detail explain how extension properties are search.
Current Behavior
The only hint I found was "Extra properties on a project are visible from its subprojects."
at https://docs.gradle.org/current/userguide/writing_build_scripts.html#sec:extra_properties
Context
I had to do a lot of experimenting. I think I finally got it:
If you write just the name of the extension property:
If you prepend ext like this: 'ext.myprop', the ext object is used instead for your context, i.e. the task ext if within a task. The project.ext if not within a task. So only that ext object is asked for that property and the above search strategy does not take place.
I don't know about the other extension aware objects (SourceSet, DependencyHandler, Settings).
The text was updated successfully, but these errors were encountered: