diff --git a/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/plugin/GithubWikiPlugin.kt b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/plugin/GithubWikiPlugin.kt index 32854a4..6187afa 100644 --- a/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/plugin/GithubWikiPlugin.kt +++ b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/plugin/GithubWikiPlugin.kt @@ -21,7 +21,7 @@ class GithubWikiPlugin : Plugin { buildTask.setCombinedTypes(extension.types) } - target.tasks.named("dokka") { + target.tasks.named("dokkaGfm") { buildTask.dependsOn(this) } } diff --git a/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/plugin/GithubWikiTask.kt b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/plugin/GithubWikiTask.kt index 2ae1fb2..2ea8ea1 100644 --- a/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/plugin/GithubWikiTask.kt +++ b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/plugin/GithubWikiTask.kt @@ -34,7 +34,8 @@ open class GithubWikiTask : DefaultTask() { @InputDirectory internal fun getInputDir(): File { - return File(projectDokkaDir, projectName) + val gfmDir = File(projectDokkaDir, "gfm") + return File(gfmDir, projectName) } @OutputDirectory diff --git a/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/CommonConfig.kt b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/CommonConfig.kt index 749a904..41e2306 100644 --- a/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/CommonConfig.kt +++ b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/CommonConfig.kt @@ -8,4 +8,5 @@ fun Project.commonConfig() { junitConfig() ktLintConfig() dokkaConfig() + mavenConfig() } diff --git a/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/DokkaConfig.kt b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/DokkaConfig.kt index 8144dcb..7d0ad56 100644 --- a/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/DokkaConfig.kt +++ b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/DokkaConfig.kt @@ -2,26 +2,14 @@ package fr.xgouchet.buildsrc.settings import org.gradle.api.Project import org.gradle.jvm.tasks.Jar -import org.jetbrains.dokka.gradle.DokkaTask @Suppress("UnstableApiUsage") fun Project.dokkaConfig() { - tasks.register("generateJavadoc", Jar::class.java) { - dependsOn(":dd-sdk-android:dokka") + project.tasks.register("generateJavadoc", Jar::class.java) { + group = "publishing" + dependsOn("dokkaJavadoc") archiveClassifier.convention("javadoc") from("${buildDir.canonicalPath}/reports/javadoc") } - - tasks.withType(DokkaTask::class.java) { - outputFormat = "gfm" -// configuration { -// includeNonPublic = false -// skipDeprecated = false -// reportUndocumented = true -// skipEmptyPackages = true -// // targets = listOf("JVM") -// } -// outputDirectory = "${rootDir.path}/../Elmyr.wiki/" - } } diff --git a/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/MavenConfig.kt b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/MavenConfig.kt new file mode 100644 index 0000000..90438f9 --- /dev/null +++ b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/MavenConfig.kt @@ -0,0 +1,19 @@ +package fr.xgouchet.buildsrc.settings + +import org.gradle.api.Project +import org.gradle.api.publish.PublishingExtension +import org.gradle.api.publish.maven.MavenPublication +import org.gradle.kotlin.dsl.get + +fun Project.mavenConfig() { + extensionConfig { + publications.create("maven", MavenPublication::class.java) { + groupId = "com.github.xgouchet" + artifactId = project.name + version = "1.3.4" + from(components["kotlin"]) + artifact(tasks.findByName("kotlinSourcesJar")) + artifact(tasks.findByName("generateJavadoc")) + } + } +} \ No newline at end of file diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 78ac422..db130e4 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -7,7 +7,7 @@ plugins { id("org.jlleitschuh.gradle.ktlint") id("org.jetbrains.dokka") id("githubWiki") -// maven + `maven-publish` } dependencies { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3e33848..00dbdb7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ mockitoJunit5 = "4.2.0" detekt = "1.19.0" depsVersion = "0.41.0" -dokka = "0.10.1" +dokka = "1.6.21" ktlint = "9.1.0" [libraries] diff --git a/inject/build.gradle.kts b/inject/build.gradle.kts index 30cd63e..89314d5 100644 --- a/inject/build.gradle.kts +++ b/inject/build.gradle.kts @@ -5,7 +5,8 @@ plugins { id("com.github.ben-manes.versions") id("io.gitlab.arturbosch.detekt") id("org.jlleitschuh.gradle.ktlint") -// maven + id("org.jetbrains.dokka") + `maven-publish` } dependencies { diff --git a/junit4/build.gradle.kts b/junit4/build.gradle.kts index 043b002..ffadd69 100644 --- a/junit4/build.gradle.kts +++ b/junit4/build.gradle.kts @@ -7,7 +7,7 @@ plugins { id("org.jlleitschuh.gradle.ktlint") id("org.jetbrains.dokka") id("githubWiki") -// maven + `maven-publish` } dependencies { diff --git a/junit5/build.gradle.kts b/junit5/build.gradle.kts index e3ae6aa..417cddb 100644 --- a/junit5/build.gradle.kts +++ b/junit5/build.gradle.kts @@ -7,7 +7,7 @@ plugins { id("org.jlleitschuh.gradle.ktlint") id("org.jetbrains.dokka") id("githubWiki") -// maven + `maven-publish` } dependencies { diff --git a/jvm/build.gradle.kts b/jvm/build.gradle.kts index 3100c72..dc13c4a 100644 --- a/jvm/build.gradle.kts +++ b/jvm/build.gradle.kts @@ -6,7 +6,7 @@ plugins { id("io.gitlab.arturbosch.detekt") id("org.jlleitschuh.gradle.ktlint") id("org.jetbrains.dokka") -// maven + `maven-publish` } dependencies { diff --git a/semantics/build.gradle.kts b/semantics/build.gradle.kts index 3100c72..dc13c4a 100644 --- a/semantics/build.gradle.kts +++ b/semantics/build.gradle.kts @@ -6,7 +6,7 @@ plugins { id("io.gitlab.arturbosch.detekt") id("org.jlleitschuh.gradle.ktlint") id("org.jetbrains.dokka") -// maven + `maven-publish` } dependencies { diff --git a/spek/build.gradle.kts b/spek/build.gradle.kts index 42620a8..d743615 100644 --- a/spek/build.gradle.kts +++ b/spek/build.gradle.kts @@ -7,7 +7,7 @@ plugins { id("org.jlleitschuh.gradle.ktlint") id("org.jetbrains.dokka") id("githubWiki") -// maven + `maven-publish` } dependencies {