diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index 682864f6..28d797c1 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -33,6 +33,9 @@ jobs: ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} run: ./gradlew uploadArchives --no-daemon --no-parallel --stacktrace + - name: Build HTML Docs + run: ./gradlew dokkaHtml --stacktrace + - name: Stop Gradle run: ./gradlew --stop diff --git a/.gitignore b/.gitignore index 5060c502..d923ab47 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ build/ # OSX .DS_Store + +# MkDocs +/docs/api diff --git a/README.md b/README.md index 4f0bfdbd..0cec18f2 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ fun main(context: Context) { // Prints "109yd 1ft 1in". val humanReadableDistance: String = distance.format(context) - // Prints "109yd 1ft 1in". + // Prints "100.00m". val humanReadableLength: String = length.format(context) } ``` diff --git a/build.gradle b/build.gradle index c26f6235..21e7b558 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { classpath libs.android.gradlePlugin classpath libs.kotlinGradlePlugin classpath libs.mavenPublishGradlePlugin - classpath libs.dokkaGradlePlugin + classpath libs.dokka.gradlePlugin classpath libs.detekt.gradlePlugin classpath libs.gradleVersions.gradlePlugin } diff --git a/docs/index.md b/docs/index.md index eebaff49..6f7c1ae5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -33,7 +33,7 @@ fun main(context: Context) { // Prints "109yd 1ft 1in". val humanReadableDistance: String = distance.format(context) - // Prints "109yd 1ft 1in". + // Prints "100.00m". val humanReadableLength: String = length.format(context) } ``` diff --git a/gradle.properties b/gradle.properties index ea5b2ce3..54e2b742 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,7 +16,8 @@ POM_DEVELOPER_ID=michalsikora90 POM_DEVELOPER_NAME=Michal Sikora # Increase the build VMs heap size. Default is 512m. -org.gradle.jvmargs=-Xmx2g +# Increase metaspace for Dokka https://github.com/Kotlin/dokka/issues/1405 +org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=1g org.gradle.parallel=true android.useAndroidX=true diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 5efc8ba3..515e7fdd 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -14,7 +14,10 @@ ext.libs = [ "xTestCoreKtx": "androidx.test:core-ktx:1.3.0" ], "kotlinGradlePlugin": "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21", - "dokkaGradlePlugin": "org.jetbrains.dokka:dokka-gradle-plugin:1.4.20", + "dokka": [ + "gradlePlugin": "org.jetbrains.dokka:dokka-gradle-plugin:1.4.20", + "gradlePluginId": "org.jetbrains.dokka", + ], "kotest": [ "runnerJunit5": "io.kotest:kotest-runner-junit5-jvm:${versions.kotest}", "assertions": "io.kotest:kotest-assertions-core-jvm:${versions.kotest}", diff --git a/gradle/dokka-config.gradle b/gradle/dokka-config.gradle new file mode 100644 index 00000000..eaaca325 --- /dev/null +++ b/gradle/dokka-config.gradle @@ -0,0 +1,14 @@ +apply plugin: libs.dokka.gradlePluginId + +dokkaHtml { + outputDirectory.set(file("$rootDir/docs/api/${project.name}")) + + dokkaSourceSets { + configureEach { + jdkVersion.set(8) + reportUndocumented.set(false) + skipDeprecated.set(true) + skipEmptyPackages.set(true) + } + } +} diff --git a/library/android/build.gradle b/library/android/build.gradle index 32c189aa..ff5497dd 100644 --- a/library/android/build.gradle +++ b/library/android/build.gradle @@ -21,4 +21,5 @@ dependencies { testImplementation libs.junit } +apply from: "$rootDir/gradle/dokka-config.gradle" apply from: "$rootDir/gradle/gradle-mvn-push.gradle" diff --git a/library/ruler/build.gradle b/library/ruler/build.gradle index 42fcbb90..3ff3dff7 100644 --- a/library/ruler/build.gradle +++ b/library/ruler/build.gradle @@ -10,4 +10,5 @@ dependencies { testImplementation libs.kotest.property } +apply from: "$rootDir/gradle/dokka-config.gradle" apply from: "$rootDir/gradle/gradle-mvn-push.gradle" diff --git a/mkdocs.yml b/mkdocs.yml index 114d58ca..5e608d5e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -38,6 +38,8 @@ plugins: nav: - 'Quick start': index.md - 'User guide': user-guide.md - - 'API': api.md + - 'API': + - 'ruler': api/ruler/ruler/index.html + - 'ruler-android': api/android/android/index.html - 'Changelog': changelog.md - 'Releasing': releasing.md