From aa5024a891d0d1064cfc1560fbb26bf96f97ec33 Mon Sep 17 00:00:00 2001 From: Sander Ploegsma Date: Tue, 23 Jan 2024 10:16:12 +0100 Subject: [PATCH] Build docs + javadoc into one folder --- .github/workflows/pages.yml | 10 +++++++--- build.gradle | 9 +++++++-- docs/contributing.md | 1 - src/doc/docs/contributing.md | 1 + {docs => src/doc/docs}/index.md | 0 mkdocs.yml => src/doc/mkdocs.yml | 3 ++- 6 files changed, 17 insertions(+), 7 deletions(-) delete mode 120000 docs/contributing.md create mode 120000 src/doc/docs/contributing.md rename {docs => src/doc/docs}/index.md (100%) rename mkdocs.yml => src/doc/mkdocs.yml (93%) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 777a8254..c8e931c3 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -18,12 +18,16 @@ jobs: with: java-version: "21" distribution: "temurin" - - name: Build Javadoc - run: ./gradlew --no-daemon javadoc + - name: Set up Python + uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c + with: + python-version: "3.12" + - name: Build documentation + run: ./gradlew --no-daemon clean mkdocsBuild javadoc - name: Upload artifact uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 with: - path: build/docs/javadoc + path: build/docs deploy: name: Deploy to GitHub Pages diff --git a/build.gradle b/build.gradle index 570abc8f..5c99f84d 100644 --- a/build.gradle +++ b/build.gradle @@ -46,7 +46,12 @@ python { } mkdocs { - sourcesDir = "." - buildDir = "build/docs/mkdocs" + sourcesDir = "src/doc" + buildDir = file("build/docs") publish.docPath = null } + +javadoc { + mustRunAfter(mkdocsBuild) + destinationDir = file("build/docs/api") +} diff --git a/docs/contributing.md b/docs/contributing.md deleted file mode 120000 index 44fcc634..00000000 --- a/docs/contributing.md +++ /dev/null @@ -1 +0,0 @@ -../CONTRIBUTING.md \ No newline at end of file diff --git a/src/doc/docs/contributing.md b/src/doc/docs/contributing.md new file mode 120000 index 00000000..c97564d9 --- /dev/null +++ b/src/doc/docs/contributing.md @@ -0,0 +1 @@ +../../../CONTRIBUTING.md \ No newline at end of file diff --git a/docs/index.md b/src/doc/docs/index.md similarity index 100% rename from docs/index.md rename to src/doc/docs/index.md diff --git a/mkdocs.yml b/src/doc/mkdocs.yml similarity index 93% rename from mkdocs.yml rename to src/doc/mkdocs.yml index cc813ce1..f41a676b 100644 --- a/mkdocs.yml +++ b/src/doc/mkdocs.yml @@ -5,7 +5,7 @@ site_url: https://exercism.github.io/java-analyzer repo_name: java-analyzer repo_url: https://github.com/exercism/java-analyzer -edit_uri: blob/main/docs/ +edit_uri: blob/main/docs/src/ copyright: 'Copyright © 2024 Exercism' @@ -40,3 +40,4 @@ markdown_extensions: nav: - Home: index.md - contributing.md + - API: /java-analyzer/api