Gradle nested extention with dynamic name

I would like to create a custom extension with some dynamic name as

myExt {
    firstname = 'toto'
     = 2
    firstname = 'tata'
     = 3

I use usually: project.extensions.create(“myExt”, APluginExtension) All choosen name has the same type Person as example. I would like lto iterate as it was a HashMap<String,Person> .

It is possible to do it with groovy/gradle ?


This question has been answered on stackoverflow.