subprojects { def loginconfig = "$home/conf/login.conf" }
In one of my sub-projects I want to have its own build.gradle where to use loginconfig defined in root build.gradle. Is it possible to achieve? Something like the following in subproject build.gradle
You don’t want to declare loginconfig as a variable in your root project. The variable is only accessible in the scope it was declared. Therefore, it’s only available in the subprojects { } block, not to the actual subprojects.
If you wish to set a value from the root project that can only be used in the subprojects, you can set loginconfig as an extra property on just the subprojects: