https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
t

thana

01/21/2019, 9:01 AM
i'd love to you use
jtsgen
, a project written in java that allows to generate typscript typings from java- and kotlin classes. the problem: it uses
kapt
to generate them which drives it more or less impossible. i'd need to use it as
common
-dependency to use the annotations which isn't possible and OTOH using kapt seems to be impossible in MPP, too. But there is a glimmer of hope left: in fact we would need this dependency only at compiletime and there is nothing left at runtime. Can anyone imagine a way to use it?
o

orangy

01/21/2019, 9:29 AM
As far as I know, annotation processing is the only technique right now that allows circular dependencies, i.e. using generated code from code it was generated from. If you don’t need it, you can use a lot of various generation techniques.
t

thana

01/21/2019, 9:30 AM
i dont think i understood your answer...
o

orangy

01/21/2019, 9:36 AM
Do you plan to use TS typings in the same project, or do you want it for external consumption?
t

thana

01/21/2019, 9:37 AM
external consumption - the
d.ts
files would be a artefact of the MPP
o

orangy

01/21/2019, 9:47 AM
Then you might go with a Gradle plugin that will consume output of Kotlin compilation and generate d.ts
Here is a project I’m lazily working on to generate benchmarks in MPP: https://github.com/orangy/gradle-benchmarks I think it has everything you need, except for your specific code generation.
t

thana

01/21/2019, 10:06 AM
but i dont want to parse the output of something. it's the sorucecode itself that is process by kapt