tony
06/18/2024, 6:51 PMProject.findProperty()
(and related) APIs? Tracing that code, it looks like a holdover from the old Groovy/dynamic days, as it accesses project "properties" hierarchically from closest to farthest, all the way back to the root if necessary.
use-case: it is pretty common in a lot of repos to have subproject/gradle.properties
files to define properties that aren't global. However, properties defined there aren't available via providers.gradleProperty()
, they're only available via project.findProperty()
and whatnot.ephemient
06/18/2024, 7:08 PMJosh Friend
06/18/2024, 7:13 PMfindProperty()
searches upward through parent projects, so it will cause isolated projects violations if that happenstony
06/18/2024, 7:22 PMtony
06/18/2024, 7:23 PMJosh Friend
06/18/2024, 7:24 PMproviders.gradleProperty()
where the intent was to read from root gradle.properties
and it triggered Isolated Projects errors when using findProperty()Josh Friend
06/18/2024, 7:25 PMtony
06/18/2024, 7:25 PMtony
06/18/2024, 7:25 PMtony
06/18/2024, 7:33 PMfindProperty()
will get the value from the ROOT. It does NOT walk up the hierarchy getting the nearest valueAlex Semin
06/18/2024, 8:46 PMfindProperty()
overall.
If what you observe is the case, then it seems like a bug. At the same time, the contract in the Project.findProperty()
javadoc is rather elaborate and, probably, very historical.
Could you provide a minimal reproducer and create an issue if thatโs the case?tony
06/18/2024, 8:58 PMtony
06/18/2024, 9:30 PM