[英]How can I add my own version of dukat in intellij idea
I am trying to generate external Declaration for a NPM package but it is giving errors But when I tried the same with dukat@next version it worked Tell me either how can I include my generated declarations to my kotlinJs project or how can I update to dukat@next in IDE to automatically generate declarations and use it我正在尝试为 NPM package 生成外部声明但是它给出了错误但是当我尝试使用 dukat@next 版本时它起作用了告诉我如何将生成的声明包含到我的 kotlinJs 项目中或者我如何更新到 dukat @next in IDE 自动生成声明并使用
I am expecting for dukat to generate my Declarations and i can work with my npm module我期待 dukat 生成我的声明,我可以使用我的 npm 模块
The Kotlin/JS Gradle plugin configures the version of Dukat via an extension on the root Gradle project (even if the root project does not have the Kotlin/JS plugin applied). Kotlin/JS Gradle 插件通过根项目 Gradle 上的扩展配置 Dukat 的版本(即使根项目没有应用 Kotlin/JS 插件)。
The latest version of Dukat can be found on npmjs.com .最新版本的 Dukat 可以在npmjs.com上找到。 Right now, the latest version is 0.5.8-rc.4-dev.20221020
现在,最新版本是0.5.8-rc.4-dev.20221020
// build.gradle.kts
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
rootProject.plugins.withType<NodeJsRootPlugin> {
configure<NodeJsRootExtension> {
versions.apply {
dukat.version = "0.5.8-rc.4-dev.20221020"
}
}
}
There are actually a lot of versions that can be configured.其实有很多版本可以配置。 The full list (for Kotlin v1.8.0) can be viewed in NpmVersions.kt完整列表(Kotlin v1.8.0)可以在NpmVersions.kt查看
I wouldn't rely on Dukat too much though.不过我不会太依赖杜卡特。 It's still highly experimental, and is updated rarely.它仍然是高度实验性的,并且很少更新。 Further development has been postponed a number of times.进一步的开发已被多次推迟。 It rarely generates correct code, but it can be used as a good starting point ( read more ).它很少生成正确的代码,但可以用作一个很好的起点(阅读更多)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.