[GRADLE-3530] Extra properties do not inherit to grand children Created: 19/Aug/16  Updated: 25/Aug/16  Resolved: 25/Aug/16

Status: Resolved
Project: Gradle
Affects Version/s: 2.14.1, 3.0
Fix Version/s: 3.1-rc-1

Type: Bug
Reporter: Stefan Wolf Assignee: Stefan Wolf
Resolution: Fixed Votes: 0


 Description   

See https://discuss.gradle.org/t/extra-properties-inheritance-problem/18990

For gradle 2.13 and earlier, when an extra properties is override in a project, all sub project get value from it's parent. Since 2.14 the value is override only for the given project and all other project get value from root project.
Why the behaviour has changed?

Example :

settings.gradle:

include 'sub1'
include 'sub1:sub1p1'
include 'sub1:sub1p2'
include 'sub2'
include 'sub2:sub2p1'
include 'sub2:sub2p2'

build.gradle:

ext.testProp='root value'
configure(project(':sub1')){
    ext.testProp='sub1 value'
}

allprojects{
    println(name + ' : ' + testProp)
}

For 2.13 and earlier, the output is :

gradle-inheritance : root value
sub1 : sub1 value
sub2 : root value
sub1p1 : sub1 value
sub1p2 : sub1 value
sub2p1 : root value
sub2p2 : root value

Since 2.14 :

gradle-inheritance : root value
sub1 : sub1 value
sub2 : root value
sub1p1 : root value
sub1p2 : root value
sub2p1 : root value
sub2p2 : root value

Generated at Wed Jun 30 12:51:12 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.