Skip to content

Commit

Permalink
Merge pull request #389 from jdaugherty/build-fixes
Browse files Browse the repository at this point in the history
fix docs generation & publishing
  • Loading branch information
jdaugherty authored Dec 10, 2024
2 parents 2ed4aa6 + 6973941 commit f245991
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
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']
}

0 comments on commit f245991

Please sign in to comment.