2020-04-10 09:27:53 +00:00
|
|
|
name: Build documentation
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-06-21 12:24:47 +00:00
|
|
|
branches:
|
2022-11-08 16:43:27 +00:00
|
|
|
- mc-1.19.x
|
2020-04-10 09:27:53 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
make_doc:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-10-22 20:21:33 +00:00
|
|
|
- name: Clone repository
|
|
|
|
uses: actions/checkout@v3
|
2020-04-10 09:27:53 +00:00
|
|
|
|
2022-10-22 20:21:33 +00:00
|
|
|
- name: Set up Java
|
Generate documentation stubs from Javadocs
illuaminate does not handle Java files, for obvious reasons. In order to
get around that, we have a series of stub files within /doc/stub which
mirrored the Java ones. While this works, it has a few problems:
- The link to source code does not work - it just links to the stub
file.
- There's no guarantee that documentation remains consistent with the
Java code. This change found several methods which were incorrectly
documented beforehand.
We now replace this with a custom Java doclet[1], which extracts doc
comments from @LuaFunction annotated methods and generates stub-files
from them. These also contain a @source annotation, which allows us to
correctly link them back to the original Java code.
There's some issues with this which have yet to be fixed. However, I
don't think any of them are major blockers right now:
- The custom doclet relies on Java 9 - I think it's /technically/
possible to do this on Java 8, but the API is significantly uglier.
This means that we need to run javadoc on a separate JVM.
This is possible, and it works locally and on CI, but is definitely
not a nice approach.
- illuaminate now requires the doc stubs to be generated in order for
the linter to pass, which does make running the linter locally much
harder (especially given the above bullet point).
We could notionally include the generated stubs (or at least a cut
down version of them) in the repo, but I'm not 100% sure about that.
[1]: https://docs.oracle.com/javase/9/docs/api/jdk/javadoc/doclet/package-summary.html
2020-07-03 12:31:26 +00:00
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
2022-10-25 21:36:21 +00:00
|
|
|
java-version: 17
|
2022-10-22 20:21:33 +00:00
|
|
|
distribution: 'temurin'
|
Generate documentation stubs from Javadocs
illuaminate does not handle Java files, for obvious reasons. In order to
get around that, we have a series of stub files within /doc/stub which
mirrored the Java ones. While this works, it has a few problems:
- The link to source code does not work - it just links to the stub
file.
- There's no guarantee that documentation remains consistent with the
Java code. This change found several methods which were incorrectly
documented beforehand.
We now replace this with a custom Java doclet[1], which extracts doc
comments from @LuaFunction annotated methods and generates stub-files
from them. These also contain a @source annotation, which allows us to
correctly link them back to the original Java code.
There's some issues with this which have yet to be fixed. However, I
don't think any of them are major blockers right now:
- The custom doclet relies on Java 9 - I think it's /technically/
possible to do this on Java 8, but the API is significantly uglier.
This means that we need to run javadoc on a separate JVM.
This is possible, and it works locally and on CI, but is definitely
not a nice approach.
- illuaminate now requires the doc stubs to be generated in order for
the linter to pass, which does make running the linter locally much
harder (especially given the above bullet point).
We could notionally include the generated stubs (or at least a cut
down version of them) in the repo, but I'm not 100% sure about that.
[1]: https://docs.oracle.com/javase/9/docs/api/jdk/javadoc/doclet/package-summary.html
2020-07-03 12:31:26 +00:00
|
|
|
|
2022-10-22 20:21:33 +00:00
|
|
|
- name: Setup Gradle
|
|
|
|
uses: gradle/gradle-build-action@v2
|
Generate documentation stubs from Javadocs
illuaminate does not handle Java files, for obvious reasons. In order to
get around that, we have a series of stub files within /doc/stub which
mirrored the Java ones. While this works, it has a few problems:
- The link to source code does not work - it just links to the stub
file.
- There's no guarantee that documentation remains consistent with the
Java code. This change found several methods which were incorrectly
documented beforehand.
We now replace this with a custom Java doclet[1], which extracts doc
comments from @LuaFunction annotated methods and generates stub-files
from them. These also contain a @source annotation, which allows us to
correctly link them back to the original Java code.
There's some issues with this which have yet to be fixed. However, I
don't think any of them are major blockers right now:
- The custom doclet relies on Java 9 - I think it's /technically/
possible to do this on Java 8, but the API is significantly uglier.
This means that we need to run javadoc on a separate JVM.
This is possible, and it works locally and on CI, but is definitely
not a nice approach.
- illuaminate now requires the doc stubs to be generated in order for
the linter to pass, which does make running the linter locally much
harder (especially given the above bullet point).
We could notionally include the generated stubs (or at least a cut
down version of them) in the repo, but I'm not 100% sure about that.
[1]: https://docs.oracle.com/javase/9/docs/api/jdk/javadoc/doclet/package-summary.html
2020-07-03 12:31:26 +00:00
|
|
|
with:
|
2022-10-22 20:21:33 +00:00
|
|
|
cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/mc-') }}
|
2020-11-12 19:01:50 +00:00
|
|
|
|
|
|
|
- name: Build with Gradle
|
|
|
|
run: ./gradlew compileJava --no-daemon || ./gradlew compileJava --no-daemon
|
|
|
|
|
|
|
|
- name: Generate documentation
|
2022-11-08 16:43:27 +00:00
|
|
|
run: ./gradlew docWebsite :common-api:javadoc --no-daemon
|
2020-04-10 09:27:53 +00:00
|
|
|
|
|
|
|
- name: Upload documentation
|
|
|
|
run: .github/workflows/make-doc.sh 2> /dev/null
|
|
|
|
env:
|
|
|
|
SSH_KEY: ${{ secrets.SSH_KEY }}
|
|
|
|
SSH_USER: ${{ secrets.SSH_USER }}
|
|
|
|
SSH_HOST: ${{ secrets.SSH_HOST }}
|
|
|
|
SSH_PORT: ${{ secrets.SSH_PORT }}
|