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