Skip to content

Commit

Permalink
Merge pull request #634 from grails/build-docs
Browse files Browse the repository at this point in the history
Fix building documentation
  • Loading branch information
puneetbehl authored Oct 10, 2023
2 parents 9217056 + 05f1c96 commit d1011de
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
25 changes: 15 additions & 10 deletions docs/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ext {
githubBranch = "8.0.x"
datastoreGithubBranch = "8.0.x"
checkOutDir = "build/checkout"
explicitGormSrc = System.getProperty("gorm.src") ?: (project.hasProperty('gorm.src') ? project.getProperty("gorm.src") : null)
gormSrc = explicitGormSrc ? file(explicitGormSrc).absolutePath : "$checkOutDir/gorm-src"
Expand Down Expand Up @@ -75,7 +75,7 @@ asciidoctor {
task fetchSource {

outputs.dir layout.buildDirectory.dir('checkout')
inputs.properties(branch: githubBranch)
inputs.properties(branch: datastoreGithubBranch)

onlyIf {
println "GORM SRC=$explicitGormSrc"
Expand All @@ -88,22 +88,27 @@ task fetchSource {

println "Downloading GORM source code."
if (isReleaseVersion) {
ant.get src: "https://github.com/grails/grails-data-mapping/archive/v${datastoreVersion}.zip", dest: zipFile, verbose: true
ant.get src: "https://github.com/grails/grails-data-mapping/archive/refs/tags/v${datastoreVersion}.zip", dest: zipFile, verbose: true
} else {
ant.get src: "https://github.com/grails/grails-data-mapping/zipball/${githubBranch}", dest: zipFile, verbose: true
ant.get src: "https://github.com/grails/grails-data-mapping/archive/refs/heads/${datastoreGithubBranch}.zip", dest: zipFile, verbose: true
}

ant.unzip src: zipFile, dest: checkOutDir, {
mapper type: "regexp", from: "(grails-\\S*?/)(.*)", to: "gorm-src/\\2"
}

println "GORM source code downloaded."
}
}

task copyDocs(type: Copy, dependsOn:asciidoctor) {
from "${project.buildDir}/asciidoc/html5"
into "${project.buildDir}/docs/manual"
mustRunAfter('asciidoctor', 'groovydoc')
finalizedBy "cleanAsciidoc"
from project(":docs").layout.buildDirectory.dir("docs/asciidoc")
into project(":docs").layout.buildDirectory.dir("docs/manual")
}

task cleanAsciidoc(type: Delete, dependsOn: copyDocs) {
mustRunAfter "copyDocs"
delete project(":docs").layout.buildDirectory.dir("docs/asciidoc")
}

tasks.withType(Groovydoc) {
Expand Down Expand Up @@ -146,11 +151,11 @@ task copyResources(type:Copy) {
into "${project.buildDir}/docs"
}

task docs(dependsOn:[asciidoctor, copyDocs, groovydoc, copyResources] + subprojects.findAll { project -> project.tasks.findByName('groovydoc')}
task docs(dependsOn:[asciidoctor, copyDocs, cleanAsciidoc, groovydoc, copyResources] + subprojects.findAll { project -> project.tasks.findByName('groovydoc')}
.collect { project -> project.tasks.groovydoc })

task assembleDocsDist(type: Zip) {
dependsOn docs
dependsOn docs, copyDocs
from "${project.buildDir}/docs"
include '*'
include '*/**'
Expand Down
3 changes: 2 additions & 1 deletion docs/src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
= GORM for MongoDB
Graeme Rocher, Burt Beckwith, Puneet Behl
:revnumber: {version}
:imagesdir: ./images
:source-highlighter: coderay

[[introduction]]
== Introduction

include::introduction.adoc[]
include::{includedir}/introduction.adoc[]

[[compatibility]]
=== Compatibility with GORM for Hibernate
Expand Down

0 comments on commit d1011de

Please sign in to comment.