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

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

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

javascript - Restarting Supervisor and effect on FlaskSocketIO -