diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 83b0ec1..5d31f72 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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 diff --git a/.gitignore b/.gitignore index 46790d6..64a8917 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,6 @@ proguard/ # Android Studio captures folder captures/ + +# Generated Dokka docs +/docs/ diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..f09c2cf --- /dev/null +++ b/build.gradle.kts @@ -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().configureEach { + dokkaSourceSets.configureEach { + includes.from("README.md") + } + } +} + +tasks.withType().configureEach { + outputDirectory.set(rootProject.file("docs")) +} diff --git a/kapsule-core/build.gradle.kts b/kapsule-core/build.gradle.kts index 7ba2f40..2a52185 100644 --- a/kapsule-core/build.gradle.kts +++ b/kapsule-core/build.gradle.kts @@ -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 { @@ -24,16 +16,8 @@ dependencies { testRuntimeOnly("org.junit.platform:junit-platform-launcher") } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } -} - -tasks.register("dokkaJavadocJar") { - dependsOn(tasks.dokkaJavadoc) - from(tasks.dokkaJavadoc.flatMap { it.outputDirectory }) - archiveClassifier.set("javadoc") +tasks.named("test") { + useJUnitPlatform() } mavenPublishing { @@ -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 { @@ -77,20 +61,3 @@ mavenPublishing { } } } - -tasks.named("test") { - useJUnitPlatform() -} - -tasks.register("exportDocs") { - duplicatesStrategy = DuplicatesStrategy.INCLUDE - into("../docs") - with(copySpec { - from("build/dokka/html") - }) - from(tasks.getByName("deleteDocs"), tasks.dokkaHtml) -} - -tasks.register("deleteDocs") { - delete("../docs") -} diff --git a/kapsule-core/gradle.properties b/kapsule-core/gradle.properties deleted file mode 100644 index fd8d21a..0000000 --- a/kapsule-core/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -# Project -publishArtifactId=kapsule-core