4

I'm trying to hide a method that should be visible only for test usage.

Is there any equivalent for javadoc's @hide

I'm not an expert using KDoc neither JavaDoc, If I'm missing any concept please point me to it.

/** @hide */
fun methodToHide() : String = "foo"
crgarridos
  • 8,758
  • 3
  • 49
  • 61
  • If it's available only for test, is it in the src/test/kotlin tree? And thus not built into your normal -src.jar file? If those conventions are followed, dokka won't build the doc files when you direct it to run only over your src/main/kotlin tree. – Paul Hicks Jan 18 '18 at 02:52

1 Answers1

3

If you really want to show that method/function is not part of public API and is exposed only t obe testable, it's considered to be a good practice to use annotation @VisibleForTesting. If you don't have guava or similar library in your project you can create such annotation easiily yourself.

asm0dey
  • 2,841
  • 2
  • 20
  • 33