From 69739416a4c504fbadf00103afd4af77db3ba8cc Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Tue, 10 Dec 2024 10:41:20 -0500 Subject: [PATCH] fix docs generation & publishing --- .github/workflows/gradle.yml | 2 +- .github/workflows/release.yml | 4 ++-- build.gradle | 18 ++++++++++++------ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 84e19be0..3f930b01 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -62,5 +62,5 @@ jobs: TARGET_REPOSITORY: ${{ github.repository }} GH_TOKEN: ${{ secrets.GH_TOKEN }} BRANCH: gh-pages - FOLDER: build/asciidoc + FOLDER: build/docs DOC_FOLDER: gh-pages \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f8839dfb..ff72a98c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -113,7 +113,7 @@ jobs: uses: micronaut-projects/github-actions/export-gradle-properties@master - name: "📜 Generate User Guide Documentation" id: docs - run: ./gradlew asciidoctor + run: ./gradlew docs - name: "🚀 Publish to Github Pages" id: docs if: success() @@ -123,7 +123,7 @@ jobs: TARGET_REPOSITORY: ${{ github.repository }} GH_TOKEN: ${{ secrets.GH_TOKEN }} BRANCH: gh-pages - FOLDER: build/asciidoc + FOLDER: build/docs DOC_FOLDER: gh-pages COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }} COMMIT_NAME: ${{ env.GIT_USER_NAME }} diff --git a/build.gradle b/build.gradle index ec3945b5..68b87b2a 100644 --- a/build.gradle +++ b/build.gradle @@ -9,6 +9,7 @@ buildscript { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" } } + plugins { id 'org.asciidoctor.jvm.convert' version '4.0.3' id 'java-library' @@ -19,7 +20,6 @@ group 'org.grails.plugins' apply plugin: 'org.grails.grails-plugin' apply plugin: 'org.grails.grails-gsp' -apply plugin: "org.grails.grails-doc" apply plugin: "org.grails.grails-publish" compileJava.options.release = 17 @@ -67,6 +67,7 @@ grailsPublish { } tasks.named('asciidoctor', AsciidoctorTask) { it -> + it.dependsOn(tasks.withType(Groovydoc)) it.jvm { jvmArgs("--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED") } @@ -85,12 +86,17 @@ tasks.named('asciidoctor', AsciidoctorTask) { it -> 'version': project.projectVersion, 'sourcedir': 'src/main/groovy' baseDirFollowsSourceDir() - outputDir = "${buildDir}/asciidoc" + outputDir = "${buildDir}/docs" } -tasks.register('apiDocs', Copy) { - from groovydoc.outputs.files - into file("${buildDir}/asciidoc/api") +groovydoc { + includeAuthor = false + includeMainForScripts = true + processScripts = true + destinationDir = file("${rootProject.buildDir}/docs/api") } -asciidoctor.dependsOn(apiDocs) +tasks.register('docs') { + group = JavaBasePlugin.DOCUMENTATION_GROUP + dependsOn = ['groovydoc', 'asciidoctor'] +} \ No newline at end of file