[英]What is the purpose of Intellij IDEA (Android Studio) Kotlin plugin?
I want to create a Kotlin project in Android Studio.我想在 Android Studio 中创建一个 Kotlin 项目。 To use Kotlin I need to install a Kotlin plugin and apply it inside the project (in .gradle
file).要使用 Kotlin,我需要安装一个 Kotlin 插件并将其应用到项目中(在.gradle
文件中)。
Can anyone explain what exact functionality Kotlin plugin adds to Android Studio and why we don't need a similar plugin for Java?谁能解释一下 Kotlin 插件添加到 Android Studio 的确切功能以及为什么我们不需要类似的 Java 插件?
You seem to be confusing the Gradle Kotlin plugin and the IDEA/AS Kotlin plugin .您似乎混淆了Gradle Kotlin 插件和IDEA/AS Kotlin 插件。 They are entirely different.它们完全不同。
what exact functionality Kotlin plugin adds to Android Studio Kotlin 插件添加到 Android Studio 的确切功能
The Gradle plugin doesn't know anything about IDEA and so doesn't add any functionality to it (AFAIK). Gradle 插件对 IDEA 一无所知,因此不会为其添加任何功能(AFAIK)。 Except of course when building with Gradle it'll compile the Kotlin part of the project.除了使用 Gradle 构建时,它会编译项目的 Kotlin 部分。
The IDEA plugin adds support for the language (parsing, highlighting, compiling, finding errors while you type, actions, etc. etc. etc.) into IDEA and Android Studio and doesn't add anything to Gradle. IDEA 插件在 IDEA 和 Android Studio 中添加了对语言的支持(解析、突出显示、编译、在键入时查找错误、操作等),并且没有向 Gradle 添加任何内容。
why we don't need a similar plugin for Java为什么我们不需要类似的 Java 插件
You do.你做。 For Gradle, see https://docs.gradle.org/current/userguide/java_plugin.html (Gradle Android plugin includes it).对于 Gradle,请参阅https://docs.gradle.org/current/userguide/java_plugin.html(Gradle Android 插件包含它)。 For IDEA/Android Studio, Java support is also really done by plugins, they are just built-in.对于 IDEA/Android Studio,Java 支持也是真正由插件完成的,它们只是内置的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.