diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..8928d40 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index 2ac5a5a..14be800 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. 👍 \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index a946034..c3b792d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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.+" } @@ -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") }