MicroUtils/dokka/build.gradle

134 lines
4.0 KiB
Groovy
Raw Normal View History

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()
// js(IR) {
// browser()
// nodejs()
// }
android {}
2020-10-28 08:47:12 +00:00
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
project.parent.subprojects.forEach {
if (
it != project
&& it.hasProperty("kotlin")
&& it.kotlin.sourceSets.any { it.name.contains("commonMain") }
2021-10-18 16:57:25 +00:00
// && 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
}
}
}
}
// jsMain {
// dependencies {
// implementation kotlin('stdlib')
// 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 (
it != project
&& it.hasProperty("kotlin")
&& it.kotlin.sourceSets.any { it.name.contains("commonMain") }
2020-11-10 11:09:14 +00:00
&& it.kotlin.sourceSets.any { it.name.contains("jvmMain") }
) {
api it
}
}
}
}
androidMain {
dependencies {
implementation kotlin('stdlib')
project.parent.subprojects.forEach {
if (
it != project
&& it.hasProperty("kotlin")
&& it.kotlin.sourceSets.any { it.name.contains("commonMain") }
2020-11-10 11:09:14 +00:00
&& 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 }
}
tasks.dokkaHtml {
2020-10-28 08:47:12 +00:00
dokkaSourceSets {
configureEach {
skipDeprecated.set(true)
sourceLink {
localDirectory.set(file("./"))
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/MicroUtils/blob/master/"))
remoteLineSuffix.set("#L")
}
}
named("commonMain") {
sourceRoots.setFrom(findSourcesWithName("commonMain"))
}
// named("jsMain") {
// sourceRoots.setFrom(findSourcesWithName("jsMain", "commonMain"))
// }
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
apply from: "$defaultAndroidSettingsPresetPath"