Groovy using variable in import command -


there same question python language on web-site, need same thing in groovy:

env = system.getenv("instance") cp = ${env} + ".vars" import "${cp}" 

this of course doesn't work, there possibility use variable inside import command in groovy? i'm novice in groovy , can't figure out, googled lot, without success. grateful helps.

no can not import via string. can load class there via class.forname(cp) (then use e.g. via newinstance().


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -