Last active
May 18, 2022 03:19
-
-
Save sandipchitale/4a9fc860190d0cfac8f3b8ea15de333d to your computer and use it in GitHub Desktop.
Create extensions and containers #gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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