2020-10-28 08:47:12 +00:00
|
|
|
plugins {
|
|
|
|
id "org.jetbrains.kotlin.multiplatform"
|
|
|
|
id "org.jetbrains.kotlin.plugin.serialization"
|
2020-11-10 11:09:14 +00:00
|
|
|
id "com.android.library"
|
2020-11-23 12:46:52 +00:00
|
|
|
id "org.jetbrains.dokka"
|
2020-10-28 08:47:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenLocal()
|
2020-11-10 11:09:14 +00:00
|
|
|
google()
|
2020-10-28 08:47:12 +00:00
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlin {
|
|
|
|
jvm()
|
2023-06-09 06:01:11 +00:00
|
|
|
js(IR) {
|
|
|
|
browser()
|
|
|
|
nodejs()
|
|
|
|
}
|
2022-12-05 00:57:29 +00:00
|
|
|
android {}
|
2020-10-28 08:47:12 +00:00
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
commonMain {
|
|
|
|
dependencies {
|
|
|
|
implementation kotlin('stdlib')
|
|
|
|
|
|
|
|
project.parent.subprojects.forEach {
|
|
|
|
if (
|
2023-06-09 06:01:11 +00:00
|
|
|
it != project
|
|
|
|
&& it.hasProperty("kotlin")
|
|
|
|
&& it.kotlin.sourceSets.any { it.name.contains("commonMain") }
|
|
|
|
&& it.kotlin.sourceSets.any { it.name.contains("jsMain") }
|
|
|
|
&& it.kotlin.sourceSets.any { it.name.contains("jvmMain") }
|
|
|
|
&& it.kotlin.sourceSets.any { it.name.contains("androidMain") }
|
2020-11-10 11:09:14 +00:00
|
|
|
) {
|
|
|
|
api it
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-06-09 06:01:11 +00:00
|
|
|
jsMain {
|
|
|
|
dependencies {
|
|
|
|
implementation kotlin('stdlib')
|
2020-11-10 11:09:14 +00:00
|
|
|
|
2023-06-09 06:01:11 +00:00
|
|
|
project.parent.subprojects.forEach {
|
|
|
|
if (
|
|
|
|
it != project
|
|
|
|
&& it.hasProperty("kotlin")
|
|
|
|
&& it.kotlin.sourceSets.any { it.name.contains("commonMain") }
|
|
|
|
&& it.kotlin.sourceSets.any { it.name.contains("jsMain") }
|
|
|
|
) {
|
|
|
|
api it
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-11-10 11:09:14 +00:00
|
|
|
jvmMain {
|
|
|
|
dependencies {
|
|
|
|
implementation kotlin('stdlib')
|
|
|
|
|
|
|
|
project.parent.subprojects.forEach {
|
|
|
|
if (
|
2023-06-09 06:01:11 +00:00
|
|
|
it != project
|
|
|
|
&& it.hasProperty("kotlin")
|
|
|
|
&& it.kotlin.sourceSets.any { it.name.contains("commonMain") }
|
|
|
|
&& it.kotlin.sourceSets.any { it.name.contains("jvmMain") }
|
2020-11-10 11:09:14 +00:00
|
|
|
) {
|
|
|
|
api it
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
androidMain {
|
|
|
|
dependencies {
|
|
|
|
implementation kotlin('stdlib')
|
|
|
|
|
|
|
|
project.parent.subprojects.forEach {
|
|
|
|
if (
|
2023-06-09 06:01:11 +00:00
|
|
|
it != project
|
|
|
|
&& it.hasProperty("kotlin")
|
|
|
|
&& it.kotlin.sourceSets.any { it.name.contains("commonMain") }
|
|
|
|
&& it.kotlin.sourceSets.any { it.name.contains("androidMain") }
|
2020-10-28 08:47:12 +00:00
|
|
|
) {
|
|
|
|
api it
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private List<SourceDirectorySet> findSourcesWithName(String... approximateNames) {
|
|
|
|
return parent.subprojects
|
|
|
|
.findAll { it != project && it.hasProperty("kotlin") }
|
|
|
|
.collectMany { it.kotlin.sourceSets }
|
|
|
|
.findAll { sourceSet ->
|
|
|
|
approximateNames.any { nameToFilter ->
|
|
|
|
sourceSet.name.contains(nameToFilter)
|
|
|
|
}
|
|
|
|
}.collect { it.kotlin }
|
|
|
|
}
|
|
|
|
|
2022-12-05 00:57:29 +00:00
|
|
|
tasks.dokkaHtml {
|
2020-10-28 08:47:12 +00:00
|
|
|
dokkaSourceSets {
|
|
|
|
configureEach {
|
|
|
|
skipDeprecated.set(true)
|
|
|
|
|
|
|
|
sourceLink {
|
2023-09-01 22:04:04 +00:00
|
|
|
localDirectory.set(file("../"))
|
2020-10-28 08:47:12 +00:00
|
|
|
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/MicroUtils/blob/master/"))
|
|
|
|
remoteLineSuffix.set("#L")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
named("commonMain") {
|
|
|
|
sourceRoots.setFrom(findSourcesWithName("commonMain"))
|
|
|
|
}
|
|
|
|
|
2023-06-09 06:01:11 +00:00
|
|
|
named("jsMain") {
|
|
|
|
sourceRoots.setFrom(findSourcesWithName("jsMain"))
|
|
|
|
}
|
2020-10-28 08:47:12 +00:00
|
|
|
|
|
|
|
named("jvmMain") {
|
2022-12-05 01:47:35 +00:00
|
|
|
sourceRoots.setFrom(findSourcesWithName("jvmMain"))
|
2020-10-28 08:47:12 +00:00
|
|
|
}
|
2020-11-10 11:09:14 +00:00
|
|
|
|
|
|
|
named("androidMain") {
|
2022-12-05 01:47:35 +00:00
|
|
|
sourceRoots.setFrom(findSourcesWithName("androidMain"))
|
2020-11-10 11:09:14 +00:00
|
|
|
}
|
2020-10-28 08:47:12 +00:00
|
|
|
}
|
|
|
|
}
|
2020-11-10 11:09:14 +00:00
|
|
|
|
2024-08-27 12:57:59 +00:00
|
|
|
apply from: "$defaultAndroidSettings"
|