Skip to content

Commit

Permalink
test: Test documentation generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Runkang10 committed Oct 20, 2024
1 parent b0d5fc0 commit 0c490f7
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 7 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Generate Documentation

on:
workflow_run:
types:
- completed
workflows:
- build
branches:
- "**"

jobs:
doc:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}
- name: Set up SDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

- run: chmod +x ./gradlew

- name: Generate documentation
run: ./gradlew dokkaHtml

- name: Release documentation
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/dokka
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@


## Key Features
-**Latest Version Compatibility**: Works with Paper and Folia latest version.
- 🧰**Modular Design**: Easy-to-use API structure for rapid development and extension.
- 🔷**Reusable Classes**: Provides reusable classes and methods to handle common plugin functionalities.
- 🟩**Integrated dependencies**: External dependencies are built into the plugin to not let server administrators worry about installing dependencies on the server.
- **Latest Version Compatibility**: Works with Paper and Folia latest version.
- 🧰 **Modular Design**: Easy-to-use API structure for rapid development and extension.
- 🔷 **Reusable Classes**: Provides reusable classes and methods to handle common plugin functionalities.
- 🟩 **Integrated dependencies**: External dependencies are built into the plugin to not let server administrators worry about installing dependencies on the server.


## Requirements
Expand All @@ -16,9 +16,8 @@
- **Minecraft 1.21** and above


Currently this plugin is still on working in progress.
But with the first version you should be able to access `PaperPluginLoader`
class to load your `paper-plugin.yml` configuration like _name_, _version_ and _ect_.
### Links
- [Wiki](https://runkang10.github.io/universalmcapi/)


> I'm still learning Java and Kotlin and Minecraft development but this API plugin will be my first plugin available on Modrinth and Hangar. 👍
17 changes: 17 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
kotlin("jvm") version "2.1.0-Beta2"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("org.jetbrains.dokka") version "1.9.+"
id("com.modrinth.minotaur") version "2.+"
}

Expand Down Expand Up @@ -37,11 +38,27 @@ kotlin {
jvmToolchain(targetJavaVersion)
}

tasks.dokkaHtml {
outputDirectory.set(layout.buildDirectory.dir("dokka"))
dokkaSourceSets {
configureEach {
val baseUrl = "https://runkang10.github.io/universalmcapi/"
externalDocumentationLink("https://kotlinlang.org/api/latest/jvm/stdlib/")
moduleName.set("UniversalMCAPI")
perPackageOption {
matchingRegex.set(".*")
externalDocumentationLink(baseUrl)
}
}
}
}

tasks.modrinth {
dependsOn(tasks.build)
}

tasks.build {
dependsOn(tasks.dokkaHtml)
dependsOn("shadowJar")
}

Expand Down

0 comments on commit 0c490f7

Please sign in to comment.