How to convert pure java String which includes groovy expression in runtime? -


let's if defined property value includes groovy expression in gradle.properties file:

databasefile = ${system.properties['user.home']}/.derby 

later when want access property value in gradle build script,
seems loaded pure java string in groovy runtime without string evaluation.

are there methods me evaluate pure java string before property value via gradle dsl?
or have evaluate java string i've got in runtime? how make that?

thank you~

assuming:

databasefile_unevaluated = '${system.properties[\'user.home\']}/.derby' 

you might able evaluate gstring using eval:

databasefile = eval.me(""" "$databasefile_unevaluated" """) 

this written as:

databasefile = eval.me("\"$databasefile_unevaluated\"") 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -