Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to run when using kotlin v1.1.3 #13

Closed
lexinator opened this issue Jul 3, 2017 · 1 comment
Closed

fails to run when using kotlin v1.1.3 #13

lexinator opened this issue Jul 3, 2017 · 1 comment

Comments

@lexinator
Copy link

:lintKotlinMain FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':lintKotlinMain'.
> org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(Lorg/jetbrains/kotlin/com/intellij/openapi/Disposable;Lorg/jetbrains/kotlin/config/CompilerConfiguration;Ljava/util/List;)Lorg/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment;

and in some situation says:

 ./gradlew check
:lintKotlinMain FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':lintKotlinMain'.
> Could not initialize class com.github.shyiko.ktlint.core.KtLint

gradle.properties:

version=1.0
group=com.foo.example

kotlinVersion=1.1.3

junitVersion = 5.0.0-M4
junitPlatformVersion = 1.0.0-M4

ktlintVersion = 0.8.3
kotlinterPluginVersion = 1.1.0

build.gradle:

buildscript {
  dependencies {
    classpath "gradle.plugin.org.jmailen.gradle:kotlinter-gradle:$kotlinterPluginVersion"

    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
    classpath "org.junit.platform:junit-platform-gradle-plugin:$junitPlatformVersion"
  }
}

apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: "org.jmailen.kotlinter"
apply plugin: 'org.junit.platform.gradle.plugin'

dependencies {
  compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
  compile "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"

  testCompile "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
  testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"

  testCompile "org.junit.platform:junit-platform-runner:$junitPlatformVersion"
  testCompile "org.junit.platform:junit-platform-launcher:$junitPlatformVersion"
  testCompile "org.junit.platform:junit-platform-engine:$junitPlatformVersion"
  testCompile "org.junit.platform:junit-platform-console:$junitPlatformVersion"

  testCompile "org.junit.jupiter:junit-jupiter-api:$junitVersion"

  testRuntime "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
}

sourceCompatibility = 1.8

junitPlatform {
  platformVersion "$junitPlatformVersion"
}

kotlinter {
  indentSize = 4
}

task wrapper(type: Wrapper) {
  gradleVersion = '3.5.1'
}
@jeremymailen
Copy link
Owner

Thanks for letting me know and sorry about the delay.

I believe the issue is that ktlint depends on an older version of the embeddable kotlin compiler and there's been an incompatible change. I'll make an upstream pull request and try to incorporate and fix here.

jeremymailen added a commit that referenced this issue Aug 5, 2017
* Version 1.2.0: compatibility with Kotlin 1.1.3 plugins

Fixes #13

* Upgrade ktlint to 0.9.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants