gpt4 book ai didi

gradle - 如何在 Gradle 插件上使用 PSI/UAST

转载 作者:行者123 更新时间:2023-12-02 01:00:38 28 4
gpt4 key购买 nike

我正在编写一个 Gradle 插件,它应该检查一些 Kotlin 文件并根据该检查报告一些数据。我打算使用 UAST 来执行检查,遵循 Android 中的 Lint 工具所做的( https://github.com/JetBrains/uasthttps://groups.google.com/forum/#!topic/lint-dev/7nLiXa04baM )。
但是,我找不到将 UAST 甚至 PSI 添加到 Gradle 插件的方法或任何在线资源。有什么帮助吗?

最佳答案

我建议将此添加到您的存储库中(版本是那些 atm - 查看最新版本 here):

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

还有其他工具用于测试并将其与 Idea 集成,用于 Intellij 插件。进口的也是 here

关于gradle - 如何在 Gradle 插件上使用 PSI/UAST,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50768185/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com