From 113e05b7e6802d216b94d586675ba8df7a6a63d8 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Mon, 27 Feb 2023 17:30:57 +0000 Subject: [PATCH] Java11 javadoc generator (#18) --- .github/workflows/pages.yml | 47 ------------------- .github/workflows/publish-javadoc.yaml | 11 +++-- addon.gradle | 7 +++ .../structure/StructureUtility.java | 30 ++++++------ src/main/javadoc/overview.html | 4 +- 5 files changed, 31 insertions(+), 68 deletions(-) delete mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml deleted file mode 100644 index a204c39c..00000000 --- a/.github/workflows/pages.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: ["gh-pages"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow one concurrent deployment -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Pages - uses: actions/configure-pages@v2 - - name: Generate Index - shell: bash - run: | - find . -name javadoc -type d -print > index.txt - echo feature/doc >> index.txt - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - # Upload entire repository - path: '.' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 diff --git a/.github/workflows/publish-javadoc.yaml b/.github/workflows/publish-javadoc.yaml index 0196d82f..cd635557 100644 --- a/.github/workflows/publish-javadoc.yaml +++ b/.github/workflows/publish-javadoc.yaml @@ -20,13 +20,16 @@ jobs: outputs: result_hash: ${{ steps.deploy.outputs.hash }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-java@v2 + - uses: actions/setup-java@v3 with: - java-version: 8 + java-version: | + 8 + 11 + 17 distribution: 'temurin' cache: gradle @@ -51,7 +54,7 @@ jobs: echo Nothing to deploy exit 0 fi - find . -name javadoc -type d -print | sed 's#^\./\(.*\)/javadoc$#\1#' > index.txt + find . -name javadoc -type d -print | sed 's#^\./\(.*\)/javadoc$#\1#' | sort --version-sort --reverse > index.txt git add index.txt git config user.name "${GITHUB_ACTOR}" git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" diff --git a/addon.gradle b/addon.gradle index 35a01be0..32cd6394 100644 --- a/addon.gradle +++ b/addon.gradle @@ -1,4 +1,10 @@ javadoc { + javadocTool = javaToolchains.javadocToolFor { + // Last version with frames, but it also has search + languageVersion = JavaLanguageVersion.of(11) + vendor = JvmVendorSpec.ADOPTIUM + } + inputs.file "src/main/javadoc/overview.html" include "com/gtnewhorizon/structurelib/alignment/**" @@ -14,6 +20,7 @@ javadoc { overview "src/main/javadoc/overview.html" links 'https://docs.oracle.com/javase/8/docs/api/' links 'https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/' + addBooleanOption("-frames", true) } } diff --git a/src/main/java/com/gtnewhorizon/structurelib/structure/StructureUtility.java b/src/main/java/com/gtnewhorizon/structurelib/structure/StructureUtility.java index 460a2849..f8392660 100644 --- a/src/main/java/com/gtnewhorizon/structurelib/structure/StructureUtility.java +++ b/src/main/java/com/gtnewhorizon/structurelib/structure/StructureUtility.java @@ -42,54 +42,54 @@ import cpw.mods.fml.common.registry.GameRegistry; /** * A brief index of everything contained - *

Control blocks

A lot of these might seem to make more sense as a default function on + *

Control blocks

A lot of these might seem to make more sense as a default function on * {@link IStructureElement}. However, in that case javac generic will often fail to infer the type for you, so we have * to define them as static methods - *

If block

Provide if block, allowing downstream call only if user specified conditions are meet (i.e. + *

If block

Provide if block, allowing downstream call only if user specified conditions are meet (i.e. * predicate returns true) * - *

Switch block

Provide switch block, allowing to select a downstream element by using a key or index computed + *

Switch block

Provide switch block, allowing to select a downstream element by using a key or index computed * from trigger item and/or context object. * - *

Or Chain

Provide a short-circuiting OR chain. + *

Or Chain

Provide a short-circuiting OR chain. * - *

Side effect

Provide callbacks on various occasion + *

Side effect

Provide callbacks on various occasion * * - *

Other Primitives

- *

Error statement

Unconditionally return false. + *

Other Primitives

+ *

Error statement

Unconditionally return false. * - *

Context Object Change

Switch the context object. + *

Context Object Change

Switch the context object. * - *

Channel Change

Change the channel. See Channels section + *

Channel Change

Change the channel. See
Channels section * on overview for more information. * - *

Spawn hint particle

Just spawn a hint. Do nothing otherwise. Useful when you want to override the hint + *

Spawn hint particle

Just spawn a hint. Do nothing otherwise. Useful when you want to override the hint * provided by another structure element, or as a fallback to a structure element that is check only. * * - *

Actual Element

These elements are elements that can actually do structure check, spawn hint and do auto + *

Actual Element

These elements are elements that can actually do structure check, spawn hint and do auto * place. Elements listed in above 2 sections are not going to be helpful without elements like these. They also serve * as a reference implementation for your own custom {@link IStructureElement} implementations. - *

Simple Block Element

These accept one or more different block types in one location. + *

Simple Block Element

These accept one or more different block types in one location. * - *

Complex Block Element

In case your logic on determining which block is accepted is complex, use these. + *

Complex Block Element

In case your logic on determining which block is accepted is complex, use these. * * - *

Helper Methods

These don't construct a {@link IStructureElement}, but is helpful to the instantiation or + *

Helper Methods

These don't construct a {@link IStructureElement}, but is helpful to the instantiation or * implementation of these. *