groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Kumar <Rahul.Ku...@progress.com>
Subject Read and write a Groovy config file (ConfigSlurper?)
Date Mon, 20 Jul 2020 11:01:18 GMT
Hi,

We have some Gradle based plugins (written in Groovy) where we choose to go with a Groovy
config file for maintaining our build configurations. We require to read the Groovy config
file and write back based some on events. The config file has variables defined in it as well,
example: workDir = “${ROOT}”.

The variables (or any other statements) gets resolved while reading the file using ConfigSlurper
and then we can’t write it back as we expect the variables (other statements) to be intact.

Is there a good/native way to read and write a Groovy config file? We expected ConfigSlurper
to handle both but unfortunately it doesn’t. (We will have to move to some other format
if we can’t get a proper writer for the config file)

Any help will be really appreciated.

Thanks in advance,
Rahul



Mime
View raw message