Skip to content

Commit 0b4c980

Browse files
authored
Autodocs (#266)
Automated update the API documentation published to https://aws.github.io/aws-iot-device-sdk-java-v2/ **Issue:** - Docs weren't updated unless someone remembered to do it manually. - Manually updating docs whenever you update code pollutes the diff, making it hard to review - Having HTML docs in `main` branch can cause issues. - Bloats size. - Generated docs might contain licenses we don't want to be redistributing. **Description of changes:** - Docs are kept in `docs` branch now - New `docs.yml` Github Workflow updates the `docs` branch whenever the `main` branch changes. - New `check-docs` job in `ci.yml` checks pull-requests for anything that would break docs. - delete the `docs/` folder in `main` and use `.gitignore` to prevent someone from accidentally resurrecting it. **TODO:** Turn on warnings as errors (in mavan-javadoc-plugin configuration add `<failsOnError>true</failsOnError>`). I tried turning it on but it was too much work to tackle today, since a lot of warnings were in the generated code.
1 parent c04ce42 commit 0b4c980

File tree

339 files changed

+59
-176422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+59
-176422
lines changed

.github/workflows/ci.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches-ignore:
66
- 'main'
7+
- 'docs'
78

89
env:
910
BUILDER_VERSION: v0.9.14
@@ -110,4 +111,16 @@ jobs:
110111
- name: Build ${{ env.PACKAGE_NAME }} + consumers
111112
run: |
112113
java -version
113-
mvn -B test
114+
mvn -B test
115+
116+
# check that docs can still build
117+
check-docs:
118+
runs-on: ubuntu-20.04 # latest
119+
steps:
120+
- uses: actions/checkout@v2
121+
with:
122+
submodules: true
123+
- name: Check docs
124+
run: |
125+
mvn install -Dmaven.test.skip
126+
./make-docs.py

.github/workflows/docs.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Update the API documentation whenever the `main` branch changes.
2+
# This documentation lives in its own `docs` branch.
3+
name: docs
4+
5+
on:
6+
push:
7+
branches:
8+
- 'main'
9+
10+
jobs:
11+
update-docs-branch:
12+
runs-on: ubuntu-20.04 # latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
submodules: true
18+
19+
- name: Update docs branch
20+
run: |
21+
mvn install -Dmaven.test.skip
22+
./make-docs.py
23+
24+
- name: Commit
25+
run: |
26+
git config --local user.email "[email protected]"
27+
git config --local user.name "GitHub Action"
28+
git add --force docs/
29+
git commit --message="update docs"
30+
31+
- name: Push to docs branch
32+
uses: ad-m/[email protected]
33+
with:
34+
github_token: ${{ github.token }}
35+
branch: docs
36+
# Force push so that `docs` branch always looks like `main`,
37+
# but with 1 additional "update docs" commit.
38+
# This seems simpler than trying to cleanly merge `main` into
39+
# `docs` each time.
40+
force: true

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,6 @@ bin/
182182
.settings
183183

184184
*.log
185+
186+
# docs are updated automatically by .github/workflows/docs.yml
187+
docs/

docs/allclasses-index.html

-1,402
This file was deleted.

docs/allclasses.html

-287
This file was deleted.

docs/allpackages-index.html

-212
This file was deleted.

0 commit comments

Comments
 (0)