Configuring compilation to java 8

This commit is contained in:
Andrew Golovashevich 2025-03-27 02:55:11 +03:00
parent 385436642f
commit 77b64046ae
2 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import ru.landgrafhomyak.kotlin.kmp_gradle_build_helper.* import ru.landgrafhomyak.kotlin.kmp_gradle_build_helper.*
import ru.landgrafhomyak.kotlin.kmp_gradle_build_helper.plugin.xomrk import ru.landgrafhomyak.kotlin.kmp_gradle_build_helper.plugin.xomrk
@ -14,7 +15,7 @@ buildscript {
} }
group = "ru.landgrafhomyak.db" group = "ru.landgrafhomyak.db"
version = "0.1" version = "0.2"
repositories { repositories {
mavenCentral() mavenCentral()
@ -27,11 +28,25 @@ xomrk {
optInContracts() optInContracts()
explicitApi() explicitApi()
jvm() jvmToolchain(8)
jvm {
compilations.configureEach {
compileJavaTaskProvider?.configure {
targetCompatibility = "1.8"
}
compileTaskProvider.configure {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}
}
}
sourceSets { sourceSets {
val kotlinStdlibDependency = "org.jetbrains.kotlin:kotlin-stdlib:${this@kotlin.coreLibrariesVersion}"
jvmMain { jvmMain {
dependencies { dependencies {
compileOnly(kotlinStdlibDependency)
compileOnly("com.intellij:annotations:9.0.4") compileOnly("com.intellij:annotations:9.0.4")
implementation("ru.landgrafhomyak.utility:highlevel-try-finally:0.5") implementation("ru.landgrafhomyak.utility:highlevel-try-finally:0.5")
} }

1
gradle.properties Normal file
View File

@ -0,0 +1 @@
kotlin.stdlib.default.dependency=false