101 lines
2.1 KiB
Plaintext
101 lines
2.1 KiB
Plaintext
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
|
import ru.landgrafhomyak.kotlin.kmp_gradle_build_helper.*
|
|
import ru.landgrafhomyak.kotlin.kmp_gradle_build_helper.plugin.xomrk
|
|
|
|
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
maven("https://maven.landgrafhomyak.ru/")
|
|
}
|
|
|
|
dependencies {
|
|
classpath("ru.landgrafhomyak.kotlin:kotlin-mpp-gradle-build:v0.3k2.1.10")
|
|
}
|
|
}
|
|
|
|
group = "ru.landgrafhomyak.utility"
|
|
version = "0.5"
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
xomrk {
|
|
kotlin {
|
|
setCompatibilityWithKotlin(KotlinVersion.KOTLIN_2_0)
|
|
optInContracts()
|
|
noWarnExpectActual()
|
|
warningsAsErrors()
|
|
|
|
defineAllMultiplatformTargets()
|
|
|
|
jvmToolchain(8)
|
|
jvm {
|
|
withJava()
|
|
|
|
compilations.configureEach {
|
|
compileJavaTaskProvider?.configure {
|
|
targetCompatibility = "1.8"
|
|
}
|
|
compileTaskProvider.configure {
|
|
compilerOptions {
|
|
jvmTarget = JvmTarget.JVM_1_8
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.named { t -> t == "${this@jvm.name}Test" }.configureEach {
|
|
this as Test
|
|
useTestNG()
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
// if use kotlin("stdlib") gitea ui brokes at paragraph with dependency versions
|
|
val kotlinStdlibDependency = "org.jetbrains.kotlin:kotlin-stdlib:${this@kotlin.coreLibrariesVersion}"
|
|
|
|
val commonMain by getting {
|
|
dependencies {
|
|
compileOnly(kotlinStdlibDependency)
|
|
}
|
|
}
|
|
val jvmMain by getting {
|
|
dependsOn(commonMain)
|
|
dependencies {
|
|
compileOnly(kotlinStdlibDependency)
|
|
}
|
|
}
|
|
|
|
val nonJvmMain by creating {
|
|
dependsOn(commonMain)
|
|
dependencies {
|
|
implementation(kotlinStdlibDependency)
|
|
}
|
|
}
|
|
|
|
jvmTest {
|
|
dependencies {
|
|
implementation("org.testng:testng:7.5.1")
|
|
}
|
|
}
|
|
|
|
configureEach {
|
|
when {
|
|
// commonMain !in dependsOn -> return@configureEach
|
|
!name.endsWith("Main") -> return@configureEach
|
|
this@configureEach === commonMain -> return@configureEach
|
|
this@configureEach === jvmMain -> return@configureEach
|
|
this@configureEach === nonJvmMain -> return@configureEach
|
|
}
|
|
dependsOn(nonJvmMain)
|
|
}
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
repositories {
|
|
defineXomrkGiteaMavenRepo()
|
|
}
|
|
}
|
|
} |