Skip to content

Commit

Permalink
Fix docs (#347)
Browse files Browse the repository at this point in the history
* fixed docs generation so that it includes both public and purchases modules.

* updated dokka task

* fixes some issues in the doc generation

* cleanup and fixes

* cleanup of properties

* more cleanup and applied fixes to the other package

* updated circleci task for dokka

* update branch name in repo link

* unversioned docs/index.html
  • Loading branch information
aboedo authored Aug 18, 2021
1 parent 5ed61a6 commit 22a548b
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
- android/restore-build-cache
- run:
name: Dokka
command: ./gradlew dokka
command: ./gradlew dokkaHtmlMultiModule
- android-wordpress-orb/save-gradle-cache
- android/save-build-cache
- run:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ purchase-tester-java/.classpath
*.bck
fastlane/report.xml
/docs/*
!/docs/index.html
integration-tests/keystore

# share settings
Expand Down
9 changes: 8 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
classpath "com.vanniktech:gradle-maven-publish-plugin:0.15.1"
classpath "com.android.tools.build:gradle:4.1.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.10.0"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.32"
}
}

Expand Down Expand Up @@ -70,3 +70,10 @@ task detektAllBaseline(type: io.gitlab.arturbosch.detekt.DetektCreateBaselineTas
exclude("**/build/**")
exclude("**/test/**/*.kt")
}

apply plugin: 'org.jetbrains.dokka'

tasks.dokkaHtmlMultiModule.configure {
outputDirectory.set(file("docs"))
includes.from("README.md")
}
11 changes: 0 additions & 11 deletions docs/index.html

This file was deleted.

22 changes: 21 additions & 1 deletion public/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply from: "$rootProject.projectDir/library.gradle"
apply plugin: 'org.jetbrains.dokka'

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
Expand All @@ -18,4 +19,23 @@ dependencies {
testImplementation 'io.mockk:mockk:1.10.0'
testImplementation 'org.assertj:assertj-core:3.13.2'
testImplementation project(":test-utils")
}
}

tasks.dokkaHtmlPartial.configure {
dokkaSourceSets {
configureEach {
reportUndocumented.set(true)
includeNonPublic.set(false)
skipDeprecated.set(true)

externalDocumentationLink {
url.set(uri("https://developer.android.com/reference/package-list").toURL())
}
sourceLink {
localDirectory.set(file("src/main/java"))
remoteUrl.set(uri("https://github.com/revenuecat/purchases-android/blob/main/public/src/main/java").toURL())
remoteLineSuffix.set("#L")
}
}
}
}
63 changes: 16 additions & 47 deletions purchases/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply from: "$rootProject.projectDir/library.gradle"
apply plugin: 'kotlin-kapt'
apply plugin: 'org.jetbrains.dokka'

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
Expand Down Expand Up @@ -31,55 +32,23 @@ dependencies {
testImplementation 'org.assertj:assertj-core:3.13.2'
}

apply plugin: 'com.vanniktech.maven.publish'
apply plugin: 'org.jetbrains.dokka'

dokka {
outputFormat = 'html'
outputDirectory = "$rootDir/docs"

configuration {
moduleName = 'purchases'
includes = ['README.md']
reportUndocumented = true
includeNonPublic = false
skipDeprecated = true
// Allows linking to documentation of the project's dependencies (generated with Javadoc or Dokka)
// Repeat for multiple links
externalDocumentationLink {
// Root URL of the generated documentation to link with. The trailing slash is required!
packageListUrl = new URL("https://developer.android.com/reference/package-list")

// If package-list file is located in non-standard location
// packageListUrl = new URL("file:///home/user/localdocs/package-list")
}

// Specifies the location of the project source code on the Web.
// If provided, Dokka generates "source" links for each declaration.
// Repeat for multiple mappings
sourceLink {
// Source directory
path = "src/main/kotlin"

// URL showing where the source code can be accessed through the web browser
url = "https://github.com/revenuecat/purchases-android/blob/main/src/main/kotlin"

// Suffix which is used to append the line number to the URL. Use #L for GitHub
lineSuffix = "#L"
}
// Suppress a package
perPackageOption {
prefix = "com.revenuecat.purchases.util"
// will match kotlin.internal and all sub-packages of it
suppress = true
}
perPackageOption {
prefix = "com.revenuecat.purchases"
// will match kotlin.internal and all sub-packages of it
suppress = false
tasks.dokkaHtmlPartial.configure {
dokkaSourceSets {
configureEach {
reportUndocumented.set(true)
includeNonPublic.set(false)
skipDeprecated.set(true)

externalDocumentationLink {
url.set(uri("https://developer.android.com/reference/package-list").toURL())
}
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl.set(uri("https://github.com/revenuecat/purchases-android/blob/main/purchases/src/main/kotlin").toURL())
remoteLineSuffix.set("#L")
}
}
}

}

androidExtensions {
Expand Down

0 comments on commit 22a548b

Please sign in to comment.