Single gradle.properties for all subprojects


(george.maggessy) #1

All,

I’m trying to use a single property file for all subprojects. The idea is to have gradle.properties in the root folder and reference it from various build.gradle files in different subfolders. Is there a way to do that?

Thanks.


(Dirk Hoffmann) #2

I have a similar problem:

in my master/settings.gradle I includeFlat all participating projects

in my master/build.gradle I try to pass an apply from to every subproject

subprojects {

apply from: ‘…/master/.globalGradleProperties.gradle’

.

.

. }

but when I call a # gradle clean cleanEclipse eclipse from within one of my participating projects (A) which itself relies on some other participating project (B) it turns out that my .globalGradleProperties.gradle file has not been applied yet …

any ideas ?

by the way, my base problem beside that is, that the generated .classpath of participating projects which depend on other participating projects do not have a eclipse dependency to say

any ideas there?


(Peter Niederwieser) #3

@gmaggess Properties defined in ‘gradle.properties’ are automatically available in all subprojects.

@Dirk Hoffmann

ad1. It will have been applied at that point. Chances are that something else is wrong with the build configuration. For example, the subproject might not be correctly registered as such.

ad2. Sounds like another problem with the build configuration. Note that the Eclipse plugin must be applied to the root project as well (i.e. ‘allprojects’ instead of ‘subprojects’).

PS: This would have been worth a new topic.