Skip to content

Commit

Permalink
Dokka multimodule and switch back to OSSRH
Browse files Browse the repository at this point in the history
  • Loading branch information
gouline committed Sep 13, 2024
1 parent ff3bdd1 commit c0e576c
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Export docs
env:
ORG_GRADLE_PROJECT_publishVersion: ${{ github.event.release.tag_name }}
run: ./gradlew exportDocs
run: ./gradlew dokkaHtmlMultiModule

- name: Setup Pages
uses: actions/configure-pages@v5
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ proguard/

# Android Studio captures folder
captures/

# Generated Dokka docs
/docs/
29 changes: 29 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.gradle.DokkaTaskPartial

plugins {
alias(libs.plugins.dokka)
}

allprojects {
repositories {
mavenCentral()
}
}

subprojects {
apply(plugin = "org.jetbrains.dokka")

group = property("publishGroupId").toString()
version = property("publishVersion").toString()

tasks.withType<DokkaTaskPartial>().configureEach {
dokkaSourceSets.configureEach {
includes.from("README.md")
}
}
}

tasks.withType<DokkaMultiModuleTask>().configureEach {
outputDirectory.set(rootProject.file("docs"))
}
45 changes: 6 additions & 39 deletions kapsule-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ plugins {
alias(libs.plugins.kotlin.jvm)
`java-library`
alias(libs.plugins.maven.publish)
alias(libs.plugins.dokka)
}

group = property("publishGroupId").toString()
version = property("publishVersion").toString()

repositories {
mavenCentral()
}

dependencies {
Expand All @@ -24,16 +16,8 @@ dependencies {
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

tasks.register<Jar>("dokkaJavadocJar") {
dependsOn(tasks.dokkaJavadoc)
from(tasks.dokkaJavadoc.flatMap { it.outputDirectory })
archiveClassifier.set("javadoc")
tasks.named<Test>("test") {
useJUnitPlatform()
}

mavenPublishing {
Expand All @@ -44,14 +28,14 @@ mavenPublishing {
)
)

publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
publishToMavenCentral(SonatypeHost.DEFAULT)

signAllPublications()

coordinates(
property("publishGroupId").toString(),
property("publishArtifactId").toString(),
property("publishVersion").toString(),
artifactId = name,
groupId = group.toString(),
version = version.toString(),
)

pom {
Expand All @@ -77,20 +61,3 @@ mavenPublishing {
}
}
}

tasks.named<Test>("test") {
useJUnitPlatform()
}

tasks.register<Copy>("exportDocs") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
into("../docs")
with(copySpec {
from("build/dokka/html")
})
from(tasks.getByName("deleteDocs"), tasks.dokkaHtml)
}

tasks.register<Delete>("deleteDocs") {
delete("../docs")
}
2 changes: 0 additions & 2 deletions kapsule-core/gradle.properties

This file was deleted.

0 comments on commit c0e576c

Please sign in to comment.