Is there some easy way to list the public members ...
# announcements
s
Is there some easy way to list the public members (classes, funs, vals) of a kotlin module ?
g
Only using reflections
s
Im fine with a gradle task or similar report
g
Oh, you mean on compile time
s
Yeah. As a library author I would want to catch any unintented public members
g
You can check Detekt, that has some static code analyzer and provide code statistics
Maybe you could reuse some code for this https://github.com/arturbosch/detekt
s
Thanks. Will check it out
g
n
if you are fine with making it by hand in a gradle task..
g
kotlinx.coroutines uses it to keep binary compatibility
you can modify it if you want, it’s pretty straightforward and just uses ASM
n
jar -tf
to list classes and
javap -classpath file.jar packagename.classname
to list members
g
Solution from kotlinx.coroutines more smart than just print every member info
n
definitly.. and the output also looks very similar