Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged build config changes from dataforge
- Loading branch information
Showing
15 changed files
with
236 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension | ||
|
||
plugins { | ||
id("org.jetbrains.dokka") | ||
`maven-publish` | ||
} | ||
|
||
afterEvaluate { | ||
|
||
extensions.findByType<KotlinMultiplatformExtension>()?.apply{ | ||
val dokka by tasks.getting(DokkaTask::class) { | ||
outputFormat = "html" | ||
outputDirectory = "$buildDir/javadoc" | ||
jdkVersion = 8 | ||
|
||
kotlinTasks { | ||
// dokka fails to retrieve sources from MPP-tasks so we only define the jvm task | ||
listOf(tasks.getByPath("compileKotlinJvm")) | ||
} | ||
sourceRoot { | ||
// assuming only single source dir | ||
path = sourceSets["commonMain"].kotlin.srcDirs.first().toString() | ||
platforms = listOf("Common") | ||
} | ||
// although the JVM sources are now taken from the task, | ||
// we still define the jvm source root to get the JVM marker in the generated html | ||
sourceRoot { | ||
// assuming only single source dir | ||
path = sourceSets["jvmMain"].kotlin.srcDirs.first().toString() | ||
platforms = listOf("JVM") | ||
} | ||
} | ||
|
||
val kdocJar by tasks.registering(Jar::class) { | ||
group = JavaBasePlugin.DOCUMENTATION_GROUP | ||
dependsOn(dokka) | ||
archiveClassifier.set("javadoc") | ||
from("$buildDir/javadoc") | ||
} | ||
|
||
configure<PublishingExtension> { | ||
|
||
targets.all { | ||
val publication = publications.findByName(name) as MavenPublication | ||
|
||
// Patch publications with fake javadoc | ||
publication.artifact(kdocJar.get()) | ||
} | ||
} | ||
} | ||
|
||
|
||
extensions.findByType<KotlinJvmProjectExtension>()?.apply{ | ||
val dokka by tasks.getting(DokkaTask::class) { | ||
outputFormat = "html" | ||
outputDirectory = "$buildDir/javadoc" | ||
jdkVersion = 8 | ||
} | ||
|
||
val kdocJar by tasks.registering(Jar::class) { | ||
group = JavaBasePlugin.DOCUMENTATION_GROUP | ||
dependsOn(dokka) | ||
archiveClassifier.set("javadoc") | ||
from("$buildDir/javadoc") | ||
} | ||
|
||
configure<PublishingExtension> { | ||
publications.filterIsInstance<MavenPublication>().forEach { publication -> | ||
publication.artifact(kdocJar.get()) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.