Issues with project specific behavior(object-attribute) definition called for in subprojects

Setting of property in project specific closure not taking effect in task defined in subprojects.

Project Structure: parent-child1-(child11,child12)

parent build file --------------------

allprojects {

Obj obj = new Obj()


//for n attributes }

child1 build file ----------------- subprojects.each { project.evaluationDependsOn( }

subprojects{ task packageAsRpm(type: Rpm){

project.ext.artifact = archivePath } }


newOne }

dependencies {

newOne …external dependency… }


newOne file: archivePath, name: ‘my-artifact’, type: ‘text’, builtBy: generate }


…ivy upload… } }

project(‘child1’) {

obj.setSomething(someValue) //of the same object used instantiated in allprojects }

— I guess I’m going wrong somewhere. Been trying to fix this issue for couple of days. Not getting it. Could I get some help on this?

It’s not clear what you’re trying to achieve and how the code doesn’t achieve it.

Also, you can wrap code in <code> tags to get better formatting that is much easier to read.