Intellij idea 如何使gradle中的idea插件为Kotlin生成适当的项目配置?
我已将我的Intellij idea 如何使gradle中的idea插件为Kotlin生成适当的项目配置?,intellij-idea,gradle,kotlin,Intellij Idea,Gradle,Kotlin,我已将我的build.gradle配置为正确运行gradle测试和gradle运行。但是,在导入由gradle IDEA生成的配置后,IDEA不会显示任何运行/测试任务。这些任务似乎根本不包括在ipr/iws中 这是我的build.gradle: buildscript { ext.kotlin_version = '1.2.0' repositories { maven { url "http://maven.aliyun.com/nexus/content/
build.gradle
配置为正确运行gradle测试
和gradle运行
。但是,在导入由gradle IDEA
生成的配置后,IDEA不会显示任何运行/测试任务。这些任务似乎根本不包括在ipr
/iws
中
这是我的build.gradle
:
buildscript {
ext.kotlin_version = '1.2.0'
repositories {
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.2'
}
}
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'application'
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: 'idea'
dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/javadoc"
}
sourceSets {
test.kotlin.srcDirs += 'src/test/kotlin'
}
junitPlatform {
enableStandardTestTask true
}
defaultTasks 'run'
mainClassName = 'simpledb.server.Startup'
repositories {
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testCompile 'org.junit.jupiter:junit-jupiter-api:5.0.2'
testRuntime (
'org.junit.jupiter:junit-jupiter-engine:5.0.2',
'org.junit.platform:junit-platform-launcher:1.0.2'
)
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}
我想知道有没有办法让生成的项目配置包含这些任务(run
/test
)?我还听到有人说,那么是否不可能使用gradle idea
来实现这一点呢?在您的情况下,这根本就没有必要。只要用IDEA打开build.gradle文件,一切都应该很顺利。idea
Gradle插件有点不受欢迎。不是官方的,但它是由Gradle团队创建的,并没有积极开发以适应新的想法版本和功能等。因此,如果您不需要特殊的定制,只需使用IDEA打开build.gradle
,您就可以开始了。在您的情况下根本不需要这样做。只要用IDEA打开build.gradle文件,一切都应该很顺利。idea
Gradle插件有点不受欢迎。不是官方的,但它是由Gradle团队创建的,并没有积极开发以适应新的想法版本和功能等。因此,如果您不需要特殊定制,只需使用IDEA打开build.gradle
,就可以了