The full sample: sourceCompatibility = 1.7ĭef JDK_7 = System.getenv("JDK_7") // or some other way to get path to JDK 7 installation for all Test tasks specify executable as "/bin/java".specify the following options of all java compile tasks:.if your project contains java code specify sourceCompatibility, targetCompatibility convention properties of the Java plugin.specify path to JDK 7 in jdkHome in kotlinOptions.specify jvmTarget = "1.6" in kotlinOptions.A project compiled with Kotlin can target any Java starting from Java 6.Ī recipe to setup Gradle build of a project that runs on Java 7 is following: But which ones? Also, should I define a version for this guy? Or does it automatically picks up the kotlin-gradle-plugin version?Ĭurrently the compiler of the Kotlin language requires JDK 8 to run. The documentation says it contains "addition extension functions". What I don't understand though is the difference between stdlib and stdlib-jdk7. kotlin-stdlib-jdk7: I'm guessing this is Kotlin lib of functions, classes, etc.apply plugin: 'kotlin': As far as I know from Gradle, this should add tasks to work with Kotlin but running gradle tasks I didn't see anything different.kotlin-gradle-plugin: Is used to define which version of Kotlin I will be using(?).I want to understand the 3 kotlin stuff I had to setup on the script. Is that right? Is 1.1.1 the right version to use here or is there a way to use 1.2.70 that would work with Java 7? Will I be missing a lot of stuff for using it? I'm guessing then this is due to Kotlin 1.2.X only being able to "compile" (is that the word?) with Java 8+. I have tried using kotlin_version = '1.2.70' (released last few days!) and I got the error KotlinPluginWrapper : Unsupported major.minor version 52.0. TestCompile group: 'javax.inject', name: 'javax.inject', version: '1' Right now I have the following adle file that is working but I want to ask a few things that I couldn't find anywhere else: buildscript "Ĭlasspath ":kotlin-gradle-plugin:$kotlin_version"Ĭompile(':spring-boot-starter-data-rest')Ĭompile(':spring-boot-starter-security')Ĭompile ":kotlin-stdlib-jdk7" I need to configure a project that should run on Java 7 (client limitations -_-) and I want to use Kotlin with it. Ok, so I'm new to Gradle and Kotlin and I am having a hard time understanding how things glue together here.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |