https://kotlinlang.org logo
Title
j

jw

09/09/2018, 11:48 PM
Compile-testing
a

Allan Wang

09/09/2018, 11:49 PM
Can that also compare kotlin output with javasourceobjects? I’m using it now, though I’m still getting errors before the point it actually makes the comparison
j

jw

09/10/2018, 3:51 PM
Yeah it only works on Java. You'd have to do file matching for Kotlin which means you need an exact string you expect
t

tschuchort

09/11/2018, 6:38 PM
If you ever find a good way let me know. Right now I'm driving blind with no tests shudder. String matching would be extremely brittle so I think I'm just gonna test that the output at least compiles
j

jw

09/11/2018, 7:14 PM
you could use UAST to parse the two trees and do a comparison
t

tschuchort

09/11/2018, 7:21 PM
I will take a look at that but at first glance it doesn't seem worth the effort with so little documentation
a

Allan Wang

09/11/2018, 7:46 PM
I’m trying to test stuff based on the kotlin example: https://github.com/JetBrains/kotlin-examples/tree/master/gradle/kotlin-code-generation But with this way, the kapt folder option is unavailable for any java based tests. I’ve also never gotten any files to generate beyond the compile-test library