我正在尝试将Kotlin集成到我们的构建系统中,该系统使用自定义插件来封装特定构建原型所需的一组插件。示例:
import org.gradle.api.plugins.GroovyPlugin
import org.gradle.api.plugins.JavaPlugin
import {our internal Java path}.OurBasePlugin
class OurJavaPlugin implements Plugin<Project> {
@Override
void apply(Project project) {
project.plugins.apply OurBasePlugin
project.plugins.apply JavaPlugin
project.plugins.apply GroovyPlugin
}
}
对于Kotlin,我需要执行相同的操作,但是对于要导入和应用的插件我感到困惑:
import org.gradle.api.plugins.GroovyPlugin
import org.jetbrains.kotlin.[what goes here?]
import {our internal Java path}.OurBasePlugin
class OurKotlinPlugin implements Plugin<Project> {
@Override
void apply(Project project) {
project.plugins.apply OurBasePlugin
project.plugins.apply [what goes here?]
project.plugins.apply GroovyPlugin
}
}
答案 0 :(得分:0)
org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin
是您要寻找的班级。 Here is the example在哪里做类似的事情。
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin
class OurKotlinPlugin implements Plugin<Project> {
@Override
void apply(Project project) {
project.plugins.apply KotlinPlatformJvmPlugin
}
}