I'm slowly converting some code to use this DSL and have found that I need access to the underlying nativeBuilder
field to ease the transition.
For example, whilst in the middle of defining a type using the DSL, I need to define another inner type. The DSL offers these functions:
override fun type(name: String, builder: (TypeSpecBuilder.() -> Unit)?) {
nativeBuilder.addType(buildTypeSpec(name, builder))
}
override fun type(className: ClassName, builder: (TypeSpecBuilder.() -> Unit)?) {
nativeBuilder.addType(buildTypeSpec(className, builder))
}
but these require me to rewrite the code for the type I'm trying to add in the DSL as well. What I'd rather do in the meantime is something like:
nativeBuilder.addType(generateFooTypeSpec())