gradle - 如何在我的 Gradle 插件上使用 PSI/UAST
问题描述
我正在编写一个 Gradle 插件,它应该检查一些 Kotlin 文件并根据该检查报告一些数据。我计划使用 UAST 来执行检查,遵循 Android 中的 Lint 工具所做的(https://github.com/JetBrains/uast和https://groups.google.com/forum/#!topic/lint-开发/7nLiXa04baM)。但是,我找不到将 UAST 甚至 PSI 添加到我的 Gradle 插件的方法或任何在线资源。有什么帮助吗?
解决方案
我建议将此添加到您的存储库(版本是那些 atm - 在此处查看最新版本):
repositories {
maven { url "https://dl.bintray.com/kotlin/uast/"}
}
这对您的依赖项:
dependencies {
implementation "org.jetbrains.uast:uast-kotlin:1.0.10"
}
如果您进入 MPP,您可以添加:
implementation "org.jetbrains.uast:uast-common:1.0.12"
implementation "org.jetbrains.uast:uast-java:1.0.12"
但不要忘记 UAST 仍然是基于 jvm 的,AFAIK
对于 Intellij 插件,还有其他用于测试并将其与 Idea 集成的工具。进口的也在这里
推荐阅读
- java - javafx 模块 javafx.scene.media.AudioClip 未找到
- mysql - mysql更新条件:失败
- python - Python路径更改斜杠
- javascript - 表单提交取消,因为表单没有连接 Vue js 和 Laravel
- django - 数据不能在 django/bootstrap 4 中工作
- python - 使用 python 从文件中获取有偏选择的最佳方法
- spring-boot - Thymeleaf - url 问题:如何使用对象变量命名 url
- ios - 我可以从 Swift 中的地址获取用户的经度和纬度吗?
- python - 使用列表理解时,有没有办法自己提及它?
- flutter - 如何在颤动中设置背景图像?