Section 13.5.4, “List and map literals”, tries to show examples of using both list and map literals. It seems to show examples of list literals, but the map literal example isn’t really a “literal” as I would expect.
For the "Map Literal’ section, it just shows this:
// Map literal apply plugin: 'java' Map<String, String> map = new HashMap<String, String>() map.put('plugin', 'java') apply(map)
I tried several variations of that “map” declaration and initialization, but I couldn’t find any reasonable alternatives. For instance, I tried this:
Map<String, String> map = [name:"Gromit", likes:"cheese", id:1234]
But that fails with “No such property: name for class: org.gradle.api.internal.plugins.DefaultObjectConfigurationAction”. I’m not sure what is reasonable to do here.
This is obviously more of a Groovy question, but we need to address this in the user guide.