Along the lines of this:
Build.Gradle
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion = 19
...
}
android.buildTypes {
debug
release
}
...
}
//How to access model.android.buildTypes outside model?
$(model.android.buildTypes).each { buildType ->
task "task$buildType" << {
...
}
}
This document briefly explains the $() syntax within the model for accessing other model.android.* properties: gradle experimental
I'm using gradle 2.10
My attempts with "${}" and $("") syntax are not working, and usually fail along the lines of:
Could not find property 'android' on task ':app:model'.
I believe property access outside of that block used to work with 'apply plugin: com.android.application' instead of the new model.
Since model is a task, I looked up Task (see the dynamic properties section) and tried model.property(android) but that didn't work either. I'm guessing it's in there somewhere but I can't query for a list of properties.
I understand this is gradle-experimental; any tips on where to look in the gradle source code for an answer would be graciously accepted!