Skip to content

Commit

Permalink
Add API docs to the generate page
Browse files Browse the repository at this point in the history
  • Loading branch information
MiSikora committed Dec 27, 2020
1 parent 431428d commit 4570142
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ build/

# OSX
.DS_Store

# MkDocs
/docs/api
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
```
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
```
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down
14 changes: 14 additions & 0 deletions gradle/dokka-config.gradle
Original file line number Diff line number Diff line change
@@ -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)
}
}
}
1 change: 1 addition & 0 deletions library/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ dependencies {
testImplementation libs.junit
}

apply from: "$rootDir/gradle/dokka-config.gradle"
apply from: "$rootDir/gradle/gradle-mvn-push.gradle"
1 change: 1 addition & 0 deletions library/ruler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ dependencies {
testImplementation libs.kotest.property
}

apply from: "$rootDir/gradle/dokka-config.gradle"
apply from: "$rootDir/gradle/gradle-mvn-push.gradle"
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4570142

Please sign in to comment.