Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix docs generation & publishing #389

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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 }}
Expand Down
18 changes: 12 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -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")
}
Expand All @@ -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']
}
Loading