Hello,
We have a multi-project build that loads a gradle file using “apply”.
I need to be able, in that plugin, to access a property set in a separate build.gradle.
The layout and contents of a simple example:
dir1:
…build.gradle
…settings.gradle
…dir4:
…build.gradle <---- set it here
dir2:
…foo.gradle <---- use it here
dir1/settings.xml:
include ‘:dir4’
dir1/build.xml:
apply from : ‘…/dir2/foo.gradle’
task DOIT << {
println “Just Did it!”
}
dir4/build.xml:
ext.set(‘DIR4_EXTVAR’, ‘DIR4_EXTVAR_VALUE’)
println ":dir4:DIR4_EXTVAR = " + DIR4_EXTVAR
dir2/foo.gradle:
println "DIR3: EXTVAR = " + project(’:dir4’).get(‘EXTVAR’)
I am sure that this is either order of elaboration or configtime vs runtime. Good examples to study will be fine…I understand that this is too basic for words!