Skip to content

Instantly share code, notes, and snippets.

@sandipchitale
Last active May 18, 2022 03:19
Show Gist options
  • Save sandipchitale/4a9fc860190d0cfac8f3b8ea15de333d to your computer and use it in GitHub Desktop.
Save sandipchitale/4a9fc860190d0cfac8f3b8ea15de333d to your computer and use it in GitHub Desktop.
Create extensions and containers #gradle
class Thing {
String name
Thing(String name) {
this.name = name
}
}
extensions.create('thing', Thing.class, 'foo')
println thing.name
extensions.add('things', container(Thing.class))
things {
mama {
}
kaka {
}
dada {
}
}
println thing
things.each {
println it.name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment