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
Post a Comment