A Guide to Groovy DSL: Configuration

In part 1, we saw how to design a declarative API to be consumed as a Groovy DSL at a compiled environment. This part focuses on how to load them dynamically as “configuration”.

“Literally”, Configuration as code

Note: This is not same as configuration as code, which refers to checking-in your configuration as a SCM repository.

def slurper = new ConfigSlurper()def appConfig = appSlurper.parse(new File('application.groovy'));

Product Engineer @ Gojek. Open-source contributor. Find me at https://amitosh.in/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store