Skip to content

Commit 113e05b

Browse files
authored
Java11 javadoc generator (#18)
1 parent 080785a commit 113e05b

5 files changed

Lines changed: 31 additions & 68 deletions

File tree

.github/workflows/pages.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/publish-javadoc.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ jobs:
2020
outputs:
2121
result_hash: ${{ steps.deploy.outputs.hash }}
2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2424
with:
2525
fetch-depth: 0
2626

27-
- uses: actions/setup-java@v2
27+
- uses: actions/setup-java@v3
2828
with:
29-
java-version: 8
29+
java-version: |
30+
8
31+
11
32+
17
3033
distribution: 'temurin'
3134
cache: gradle
3235

@@ -51,7 +54,7 @@ jobs:
5154
echo Nothing to deploy
5255
exit 0
5356
fi
54-
find . -name javadoc -type d -print | sed 's#^\./\(.*\)/javadoc$#\1#' > index.txt
57+
find . -name javadoc -type d -print | sed 's#^\./\(.*\)/javadoc$#\1#' | sort --version-sort --reverse > index.txt
5558
git add index.txt
5659
git config user.name "${GITHUB_ACTOR}"
5760
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"

addon.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
javadoc {
2+
javadocTool = javaToolchains.javadocToolFor {
3+
// Last version with frames, but it also has search
4+
languageVersion = JavaLanguageVersion.of(11)
5+
vendor = JvmVendorSpec.ADOPTIUM
6+
}
7+
28
inputs.file "src/main/javadoc/overview.html"
39

410
include "com/gtnewhorizon/structurelib/alignment/**"
@@ -14,6 +20,7 @@ javadoc {
1420
overview "src/main/javadoc/overview.html"
1521
links 'https://docs.oracle.com/javase/8/docs/api/'
1622
links 'https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/'
23+
addBooleanOption("-frames", true)
1724
}
1825
}
1926

src/main/java/com/gtnewhorizon/structurelib/structure/StructureUtility.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,54 +42,54 @@
4242

4343
/**
4444
* A brief index of everything contained
45-
* <h1>Control blocks</h1> A lot of these might seem to make more sense as a default function on
45+
* <h2>Control blocks</h2> A lot of these might seem to make more sense as a default function on
4646
* {@link IStructureElement}. However, in that case javac generic will often fail to infer the type for you, so we have
4747
* to define them as static methods
48-
* <h1>If block</h1> Provide if block, allowing downstream call only if user specified conditions are meet (i.e.
48+
* <h2>If block</h2> Provide if block, allowing downstream call only if user specified conditions are meet (i.e.
4949
* predicate returns true)
5050
* <ul>
5151
* <li>{@link #onlyIf(Predicate, IStructureElement)} and its overloads</li>
5252
* </ul>
53-
* <h1>Switch block</h1> Provide switch block, allowing to select a downstream element by using a key or index computed
53+
* <h2>Switch block</h2> Provide switch block, allowing to select a downstream element by using a key or index computed
5454
* from trigger item and/or context object.
5555
* <ul>
5656
* <li>{@link #partitionBy(Function, IStructureElement[])} and its overloads</li>
5757
* </ul>
58-
* <h1>Or Chain</h1> Provide a short-circuiting OR chain.
58+
* <h2>Or Chain</h2> Provide a short-circuiting OR chain.
5959
* <ul>
6060
* <li>{@link #ofChain(IStructureElement[])} and its overloads</li>
6161
* </ul>
62-
* <h2>Side effect</h2> Provide callbacks on various occasion
62+
* <h3>Side effect</h3> Provide callbacks on various occasion
6363
* <ul>
6464
* <li>{@link #onElementPass(Consumer, IStructureElement)}: Call an callback upon element check success</li>
6565
* <li>{@link #onElementFail(Consumer, IStructureElement)}: Call an callback upon element check failure</li>
6666
* </ul>
6767
*
68-
* <h1>Other Primitives</h1>
69-
* <h2>Error statement</h2> Unconditionally return false.
68+
* <h2>Other Primitives</h2>
69+
* <h3>Error statement</h3> Unconditionally return false.
7070
* <ul>
7171
* <li>{@link #error()}</li>
7272
* </ul>
73-
* <h2>Context Object Change</h2> Switch the context object.
73+
* <h3>Context Object Change</h3> Switch the context object.
7474
* <ul>
7575
* <li>{@link #withContext(IStructureElement)}: switch context to the extended context</li>
7676
* </ul>
77-
* <h2>Channel Change</h2> Change the channel. See <a href="{@docRoot}/overview-summary.html#channels">Channels section
77+
* <h3>Channel Change</h3> Change the channel. See <a href="{@docRoot}/overview-summary.html#channels">Channels section
7878
* on overview</a> for more information.
7979
* <ul>
8080
* <li>{@link #withChannel(String, IStructureElement)}: switch channel using
8181
* {@link ChannelDataAccessor#withChannel(ItemStack, String)} when a trigger item is present.</li>
8282
* </ul>
83-
* <h2>Spawn hint particle</h2> Just spawn a hint. Do nothing otherwise. Useful when you want to override the hint
83+
* <h3>Spawn hint particle</h3> Just spawn a hint. Do nothing otherwise. Useful when you want to override the hint
8484
* provided by another structure element, or as a fallback to a structure element that is check only.
8585
* <ul>
8686
* <li>{@link #ofHint(int)}, {@link #ofHintDeferred(Supplier)} and its overloads</li>
8787
* </ul>
8888
*
89-
* <h1>Actual Element</h1> These elements are elements that can actually do structure check, spawn hint and do auto
89+
* <h2>Actual Element</h2> These elements are elements that can actually do structure check, spawn hint and do auto
9090
* place. Elements listed in above 2 sections are not going to be helpful without elements like these. They also serve
9191
* as a reference implementation for your own custom {@link IStructureElement} implementations.
92-
* <h2>Simple Block Element</h2> These accept one or more different block types in one location.
92+
* <h3>Simple Block Element</h3> These accept one or more different block types in one location.
9393
* <ul>
9494
* <li>{@link #ofBlock(Block, int, Block, int)}, {@link #ofBlocksFlat(Map, Block, int)},
9595
* {@link #ofBlocksMap(Map, Block, int)} and their overloads: the most basic form</li>
@@ -98,7 +98,7 @@
9898
* <li>{@link #isAir()}, {@link #notAir()}: They are supplied by default under the identifier {@code '-'} and
9999
* {@code '+'} respectively, but are provided here regardless in case you want to use them as a fallback.</li>
100100
* </ul>
101-
* <h2>Complex Block Element</h2> In case your logic on determining which block is accepted is complex, use these.
101+
* <h3>Complex Block Element</h3> In case your logic on determining which block is accepted is complex, use these.
102102
* <ul>
103103
* <li>{@link #ofBlockAdder(IBlockAdder, Block, int)}, {@link #ofBlockAdderHint(IBlockAdder, Block, int)} and their
104104
* overloads: hands off actual adder logic to an {@link IBlockAdder} you supplied. Save you the boilerplate of querying
@@ -110,7 +110,7 @@
110110
* Similar to block adder, but for tile entities.</li>
111111
* </ul>
112112
*
113-
* <h1>Helper Methods</h1> These don't construct a {@link IStructureElement}, but is helpful to the instantiation or
113+
* <h2>Helper Methods</h2> These don't construct a {@link IStructureElement}, but is helpful to the instantiation or
114114
* implementation of these.
115115
* <ul>
116116
* <li>{@link #survivalPlaceBlock(Block, int, World, int, int, int, IItemSource, EntityPlayer, Consumer)} and its
@@ -595,7 +595,7 @@ public static <T, TIER> IStructureElementCheckOnly<T> ofBlocksTiered(ITierConver
595595
* <b>Example:</b>
596596
* <p>
597597
* Assume you have 16 tier, each map to one block's 16 different meta. You will usually want something like this
598-
*
598+
*
599599
* <pre>
600600
* public class Tile extends TileEntity {
601601
* private static final Block B = getTargetBlock();

src/main/javadoc/overview.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
1+
<!DOCTYPE html>
22
<HTML>
33
<HEAD>
44
<TITLE>API Overview</TITLE>
@@ -219,7 +219,7 @@ <h4> Multi channel input Structure Element</h4>
219219
<pre>
220220
import com.gtnewhorizon.structurelib.structure.IStructureElement;
221221

222-
public class MyHatchElement&lt;T> implements IStructureElement&lt;T> {
222+
public class MyHatchElement&lt;T&gt; implements IStructureElement&lt;T&gt; {
223223
//...
224224
{@literal @}Override
225225
public PlaceResult survivalPlaceBlock(

0 commit comments

Comments
 (0)