Is there a way to dynamically add class properties...
# scripting
s
Is there a way to dynamically add class properties (that are not present in the template class) within a
createJvmCompilationConfigurationFromTemplate
lambda block, similar to like in JSR223 I can do
engine.put("name", value)
?
I was playing around with
providedProperties
but couldn't get it to work.
@ilya.chernikov maybe?
i
providedProperties
should work, this is how the JSR223 case is implemented. See https://github.com/JetBrains/kotlin/blob/master/libraries/scripting/jvm-host/src/kotlin/script/experimental/jvmhost/jsr223/propertiesFromContext.kt for details. (note that there should be compilation and evaluation part in it).
s
Thanks, I'll have a look right away!