Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Md docs test #44

Merged
merged 5 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/add-md-docs-to-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Add mod docs to repo

on:
push:
branches:
- main
- test-docs-job

jobs:
docs:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
cache: gradle

- name: Create docs
run: |
./gradlew :hmkit-fleet:dokkaGfm

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,5 @@ private-key.json
credentialsPrivateKey.json
credentialsOAuth.json
hmkit-fleet/bin
.vscode
docs
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Telematics API to help car companies manage their fleet.
* [Requirements](#requirements)
* [Getting Started](#getting-started)
* [Architecture](#architecture)
* [API Reference](/docs/hmkit-fleet/com.highmobility.hmkitfleet/-h-m-kit-fleet/index.md)
* [License](#License)
* [Contributing](#contributing)

Expand Down
17 changes: 13 additions & 4 deletions hmkit-fleet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
// CI
id "org.barfuin.gradle.jacocolog" version "3.1.0"
id "io.gitlab.arturbosch.detekt" version "1.23.0"
id "org.jetbrains.dokka" version "1.8.20"
id "org.jetbrains.dokka" version "1.9.20"
}

kotlin {
Expand Down Expand Up @@ -68,6 +68,16 @@ dokkaJavadoc {
outputDirectory.set(file("$buildDir/dokka/html/v2/javadoc"))
}

dokkaGfm {
outputDirectory.set(file("$rootDir/docs/"))
}

tasks.register('renameDokkaReadme') {
doLast {
file("$rootDir/docs/index.md").renameTo("$rootDir/docs/README.md")
}
}

tasks.register('writeRedirectIndexHtml') {
doLast {
String content = "<html>\n" +
Expand All @@ -77,6 +87,5 @@ tasks.register('writeRedirectIndexHtml') {
}
}

tasks.dokkaHtml {
finalizedBy writeRedirectIndexHtml
}
tasks.dokkaHtml.finalizedBy writeRedirectIndexHtml
tasks.dokkaGfm.finalizedBy renameDokkaReadme
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import okhttp3.OkHttpClient
* @param environment The SDK environment. Default is Production.
* @param client Optionally, set the OkHttpClient to be used for network requests.
*
* [javadoc](https://highmobility.github.io/hmkit-fleet/v2/javadoc/com/highmobility/hmkitfleet/HMKitConfiguration.html)
* [Check out the Javadoc](https://highmobility.github.io/hmkit-fleet/v2/javadoc/com/highmobility/hmkitfleet/HMKitConfiguration.html)
*/
class HMKitConfiguration private constructor(builder: Builder) {
val credentials = builder.credentials ?: throw IllegalArgumentException("credentials must be set")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import java.util.Base64
* The credentials to be used for the SDK. Choose from either [HMKitOAuthCredentials] or
* [HMKitPrivateKeyCredentials].
*
* [javadoc](https://highmobility.github.io/hmkit-fleet/v2/javadoc/com/highmobility/hmkitfleet/HMKitCredentials.html)
* [Check out the Javadoc](https://highmobility.github.io/hmkit-fleet/v2/javadoc/com/highmobility/hmkitfleet/HMKitCredentials.html)
*
*/
abstract class HMKitCredentials {
Expand All @@ -29,7 +29,7 @@ abstract class HMKitCredentials {
/**
* The OAuth credentials to be used for the SDK.
*
* [javadoc](https://highmobility.github.io/hmkit-fleet/v2/javadoc/com/highmobility/hmkitfleet/HMKitOAuthCredentials.html)
* [Check out the Javadoc](https://highmobility.github.io/hmkit-fleet/v2/javadoc/com/highmobility/hmkitfleet/HMKitOAuthCredentials.html)
*/
@Serializable
data class HMKitOAuthCredentials(
Expand Down Expand Up @@ -57,7 +57,7 @@ data class HMKitOAuthCredentials(
/**
* The private key credentials to be used for the SDK.
*
* [javadoc](https://highmobility.github.io/hmkit-fleet/v2/javadoc/com/highmobility/hmkitfleet/HMKitPrivateKeyCredentials.html)
* [Check out the Javadoc](https://highmobility.github.io/hmkit-fleet/v2/javadoc/com/highmobility/hmkitfleet/HMKitPrivateKeyCredentials.html)
*/
@Serializable
data class HMKitPrivateKeyCredentials(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import java.util.concurrent.CompletableFuture
* );
* ```
*
* [javadoc](https://highmobility.github.io/hmkit-fleet/v2/javadoc/com/highmobility/hmkitfleet/HMKitFleet.html)
* [Check out the Javadoc](https://highmobility.github.io/hmkit-fleet/v2/javadoc/com/highmobility/hmkitfleet/HMKitFleet.html)
*
*/
class HMKitFleet constructor(
Expand Down Expand Up @@ -160,7 +160,7 @@ class HMKitFleet constructor(
/**
* The Fleet SDK environment.
*
* [javadoc](https://highmobility.github.io/hmkit-fleet/v2/javadoc/com/highmobility/hmkitfleet/HMKitFleet.Environment.html)
* [Check out the Javadoc](https://highmobility.github.io/hmkit-fleet/v2/javadoc/com/highmobility/hmkitfleet/HMKitFleet.Environment.html)
*/
enum class Environment {
PRODUCTION, SANDBOX;
Expand Down