Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Intellij idea 如何使gradle中的idea插件为Kotlin生成适当的项目配置?_Intellij Idea_Gradle_Kotlin - Fatal编程技术网

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
,就可以了