kobalt icon indicating copy to clipboard operation
kobalt copied to clipboard

Ability to specify language level and SDK version in Kobalt build script

Open dmitry-zhuravlev opened this issue 8 years ago • 2 comments
trafficstars

As discussed here https://github.com/cbeust/kobalt-intellij-plugin/issues/59 It would be great to have the ability to specify language level (and probably SDK version).

E.g. in Gradle it could be done like this:

allprojects {
    tasks.withType(JavaCompile) {
        sourceCompatibility = '1.7'
        targetCompatibility = '1.7'
    } 
}

This language level can be used in Kobalt build to choose the right SDK version to compile project because e.g. it still could be some legacy projects which require 1.6 source level.

This language level/ sdk name can be used in IDEA plugin as well to determine correct language level after import/reimport from Kobalt project model.

dmitry-zhuravlev avatar Mar 30 '17 09:03 dmitry-zhuravlev

You can already specify compiler flags:

  javaCompiler {
    args("-source", "1.7", "-target", "1.7")
  }

Isn't this sufficient?

cbeust avatar Apr 06 '17 20:04 cbeust

Yep, it is sufficient for java compiler. But maybe we need additional jdkVersion flag? In the most cases jdkVersion=languageLevel=source compiler flag but there is some use cases in which the project uses the latest jdk but with less language level. E.g. it is some kind of temporal setup for migration of big legacy project.

So I need languageLevel and sdkVersion sended from Kobalt server to plugin to configure project during the import: image

dmitry-zhuravlev avatar Apr 07 '17 10:04 dmitry-zhuravlev