Skip to content

Commit 9905674

Browse files
Add github pages for javadoc
1 parent a899839 commit 9905674

File tree

3 files changed

+52
-4
lines changed

3 files changed

+52
-4
lines changed

.github/workflows/docs.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Generate javadoc github pages
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up JDK 11
13+
uses: actions/setup-java@v2
14+
with:
15+
java-version: 11
16+
distribution: temurin
17+
- name: Grant execute permission for gradlew
18+
run: chmod +x gradlew
19+
- name: Generate documentation directory
20+
uses: gradle/gradle-build-action@v2
21+
with:
22+
arguments: javadoc
23+
- name: Deploy
24+
uses: peaceiris/actions-gh-pages@v3
25+
with:
26+
github_token: ${{ secrets.GITHUB_TOKEN }}
27+
publish_dir: ./build/docs/javadoc
28+
allow_empty_commit: true

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Discord Webhook API.
1515

1616
Here we will give a small overview of the proper usage and applicability of the resources provided by this library.
1717

18+
Documentation is available via the GitHub pages on this repository: [Javadoc](https://minndevelopment.github.io/discord-webhooks/overview-tree.html)
19+
1820
## Limitations
1921

2022
Webhooks on discord are only capable of sending messages, nothing more. For anything else you either have to use OAuth2 or a bot account. This library does not provide any functionality for creating or modifying webhooks.

build.gradle.kts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,28 @@ val sources = tasks.create("sources", Copy::class.java) {
8787
filter<ReplaceTokens>("tokens" to tokens)
8888
}
8989

90-
javadoc.dependsOn(sources)
91-
javadoc.source = fileTree(sources.destinationDir)
92-
if (!System.getProperty("java.version").startsWith("1.8"))
93-
(javadoc.options as CoreJavadocOptions).addBooleanOption("html5", true)
90+
javadoc.apply {
91+
dependsOn(sources)
92+
isFailOnError = false
93+
source = fileTree(sources.destinationDir)
94+
options.encoding = "UTF-8"
95+
options.memberLevel = JavadocMemberLevel.PUBLIC
96+
97+
if (options is StandardJavadocDocletOptions) {
98+
val opt = options as StandardJavadocDocletOptions
99+
100+
val extLinks = arrayOf(
101+
"https://docs.oracle.com/en/java/javase/11/docs/api/",
102+
"https://square.github.io/okhttp/3.x/okhttp/",
103+
)
104+
opt.links(*extLinks)
105+
if (JavaVersion.current().isJava9Compatible)
106+
opt.addBooleanOption("html5", true)
107+
if (JavaVersion.current().isJava11Compatible)
108+
opt.addBooleanOption("-no-module-directories", true)
109+
}
110+
}
111+
94112

95113
val javadocJar = tasks.create("javadocJar", Jar::class.java) {
96114
dependsOn(javadoc)

0 commit comments

Comments
 (0)