Gradle can't build Kotlin


#1

When I try to build my kotlin project with Gradle it shows NO-SOURCE both for compileKotlin and compileJava
gradlew build output:

:clean
:compileKotlin NO-SOURCE
:compileJava NO-SOURCE
:copyMainKotlinClasses
:processResources NO-SOURCE
:classes UP-TO-DATE
:jar
:assemble
:compileTestKotlin NO-SOURCE
:compileTestJava NO-SOURCE
:copyTestKotlinClasses
:processTestResources NO-SOURCE
:testClasses UP-TO-DATE
:test NO-SOURCE
:check UP-TO-DATE
:build

BUILD SUCCESSFUL

My build.gradle:
group 'mysticlands’
version ‘1.0-SNAPSHOT’

buildscript {
    ext.kotlin_version = '1.1.3-2'

    ext.bungee_api_version = "1.12-SNAPSHOT"
    ext.kryonet_version = "2.21-2"

    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

apply plugin: 'kotlin'

repositories {
    mavenCentral()

    maven { url "https://oss.sonatype.org/content/groups/public/" }
    maven { url "http://clojars.org/repo/" }
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"

    compile "net.md-5:bungeecord-api:$bungee_api_version"
    compile "kryonet:kryonet:$kryonet_version"
}

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

Any my folder structure:
yes

I started in the default project IDEA generates when I select Kotlin under the Gradle project type.


#2

@glorantq Please make sure that the Gradle project directory is the one that contains src. You can do that by adding println projectDir to your build.gradle and running a Gradle build.

If you could share the project (even the basic structure, the build script and folders without all the actual source files), I would look at it more closely. Currently, I can’t figure out what else might be the cause.