110 lines
2.8 KiB
Plaintext
110 lines
2.8 KiB
Plaintext
import ru.landgrafhomyak.kotlin.kmp_gradle_build_helper.configureAllCompilersOptionsOnAllTargets
|
|
import ru.landgrafhomyak.kotlin.kmp_gradle_build_helper.defineXomrkGiteaMavenRepo
|
|
|
|
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
maven("https://maven.landgrafhomyak.ru/")
|
|
}
|
|
|
|
dependencies {
|
|
classpath("ru.landgrafhomyak.kotlin:kotlin-mpp-gradle-build-helper:v0.3k2.1.10")
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
kotlin("multiplatform") version "2.2.20"
|
|
`maven-publish`
|
|
}
|
|
|
|
group = "ru.landgrafhomyak.multitasking"
|
|
version = "0.1"
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
kotlin {
|
|
explicitApi()
|
|
|
|
jvm()
|
|
mingwX64()
|
|
linuxX64()
|
|
linuxArm64()
|
|
macosX64()
|
|
macosArm64()
|
|
js {
|
|
browser()
|
|
nodejs()
|
|
}
|
|
|
|
|
|
configureAllCompilersOptionsOnAllTargets {
|
|
freeCompilerArgs.addAll(
|
|
"-Xexpect-actual-classes",
|
|
"-Xrender-internal-diagnostic-names", "-Xdont-warn-on-error-suppression",
|
|
"-XXLanguage:+ExpectRefinement", /*"-Xreport-output-files"*/
|
|
)
|
|
}
|
|
|
|
jvm().compilations.configureEach {
|
|
compileTaskProvider {
|
|
compilerOptions {
|
|
freeCompilerArgs.addAll("-Xjvm-default=all", "-Xdirect-java-actualization")
|
|
}
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
val commonMain by getting {
|
|
dependencies {
|
|
implementation("org.jetbrains.kotlin:kotlin-stdlib:${this@kotlin.coreLibrariesVersion}")
|
|
}
|
|
}
|
|
val commonTest by getting
|
|
|
|
this@kotlin.jvm().compilations.getByName("main").defaultSourceSet {
|
|
dependencies {
|
|
compileOnly("org.jetbrains.kotlin:kotlin-annotations-jvm:${this@kotlin.coreLibrariesVersion}")
|
|
}
|
|
}
|
|
|
|
|
|
val notJvmMain by creating { dependsOn(commonMain) }
|
|
val notJvmTest by creating { dependsOn(commonTest) }
|
|
|
|
val multithreadPlatformMain by creating { dependsOn(commonMain) }
|
|
val multithreadPlatformTest by creating { dependsOn(commonTest) }
|
|
val singleThreadPlatformMain by creating { dependsOn(commonMain) }
|
|
val singleThreadPlatformTest by creating { dependsOn(commonTest) }
|
|
|
|
targets.configureEach target@{
|
|
if (this@target in setOf(this@kotlin.metadata(), this@kotlin.jvm()))
|
|
return@target
|
|
|
|
this@target.compilations.getByName("main").defaultSourceSet.dependsOn(notJvmMain)
|
|
this@target.compilations.getByName("test").defaultSourceSet.dependsOn(notJvmTest)
|
|
}
|
|
|
|
targets.configureEach target@{
|
|
if (this@target == this@kotlin.metadata())
|
|
return@target
|
|
if (this@target in setOf(this@kotlin.js())) {
|
|
this@target.compilations.getByName("main").defaultSourceSet.dependsOn(singleThreadPlatformMain)
|
|
this@target.compilations.getByName("test").defaultSourceSet.dependsOn(singleThreadPlatformTest)
|
|
} else {
|
|
this@target.compilations.getByName("main").defaultSourceSet.dependsOn(multithreadPlatformMain)
|
|
this@target.compilations.getByName("test").defaultSourceSet.dependsOn(multithreadPlatformTest)
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
publishing {
|
|
repositories {
|
|
defineXomrkGiteaMavenRepo("Multitasking")
|
|
}
|
|
} |