如何解决在Java / Kotlin项目中收集自定义Doc注释?
我将围绕Kotlin和Java项目的代码库使用大量自定义文档说明。似乎合理的选择是使用注释。
据我所知,注释是某种魔术,由构建工具处理。但是我需要在Kotlin / Java代码中使用它。
所以我们有两个文件/src/some/thing.kt
package some
annotation class Doc
@Doc
private fun some_doc() {
println("some doc")
}
和/src/generate_docs.kt
fun main() {
Find and call all the functions over all
the codebase marked with @Doc
And then run some other code to process
those notes and output HTML docs
}
怎么办?基本上,我可以通过手动编写所有这些调用来做到这一点,但我希望有更好的方法。
fun main() {
some_doc()
another_doc()
yet_another_doc()
...
couple tens or hundreds more lines
And then run some other code to process
those notes and output HTML docs
}
如果可能的话,我想避免使用Maven插件和魔术,而只使用普通的Java / Kotlin旧代码即可以java GenerateDocsKt
的身份运行。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。