Skip to content

Commit

Permalink
Upgrade publishing script
Browse files Browse the repository at this point in the history
  • Loading branch information
xgouchet committed May 5, 2022
1 parent 9ad35c1 commit db327a6
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class GithubWikiPlugin : Plugin<Project> {
buildTask.setCombinedTypes(extension.types)
}

target.tasks.named("dokka") {
target.tasks.named("dokkaGfm") {
buildTask.dependsOn(this)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ fun Project.commonConfig() {
junitConfig()
ktLintConfig()
dokkaConfig()
mavenConfig()
}
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
}
}
Original file line number Diff line number Diff line change
@@ -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<PublishingExtension> {
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"))
}
}
}
2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id("org.jlleitschuh.gradle.ktlint")
id("org.jetbrains.dokka")
id("githubWiki")
// maven
`maven-publish`
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion inject/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion junit4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id("org.jlleitschuh.gradle.ktlint")
id("org.jetbrains.dokka")
id("githubWiki")
// maven
`maven-publish`
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion junit5/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id("org.jlleitschuh.gradle.ktlint")
id("org.jetbrains.dokka")
id("githubWiki")
// maven
`maven-publish`
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion jvm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id("io.gitlab.arturbosch.detekt")
id("org.jlleitschuh.gradle.ktlint")
id("org.jetbrains.dokka")
// maven
`maven-publish`
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion semantics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id("io.gitlab.arturbosch.detekt")
id("org.jlleitschuh.gradle.ktlint")
id("org.jetbrains.dokka")
// maven
`maven-publish`
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion spek/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id("org.jlleitschuh.gradle.ktlint")
id("org.jetbrains.dokka")
id("githubWiki")
// maven
`maven-publish`
}

dependencies {
Expand Down

0 comments on commit db327a6

Please sign in to comment.