Improved: change asciidoc Image directory convention for plugins
* modification in gradle generateOfbizDocumentation task to copy the
image/${components.name} subdirectory in the general
docs/asciidoc/images/ directory before generation
and remove it after.
* correction in generateAllPluginsDocumentation to put copy of OFBiz-Logo in doFirst to avoid it's run during gradle Configure project
@@ -548,8 +548,20 @@ task generateReadmeFiles(group: docsGroup, type: AsciidoctorTask) {
task generateOfbizDocumentation(group: docsGroup, type: AsciidoctorTask) {
dependsOn deleteOfbizDocumentation
description 'Generate OFBiz documentation manuals'
+ activeComponents().each { component ->
+ copy {
+ from "${component}/src/docs/asciidoc/images/${component.name}"
+ include '**/*.*'
+ into "${rootDir}/docs/asciidoc/images/${component.name}"
+ }
+ }
sourceDir "${rootDir}/docs/asciidoc"
outputDir file("${buildDir}/asciidoc/ofbiz")
+ doLast {
+ activeComponents().each { component ->
+ delete "${rootDir}/docs/asciidoc/images/${component.name}"
+ }
+ }
}
task generatePluginDocumentation(group: docsGroup) {
@@ -591,11 +603,15 @@ task generateAllPluginsDocumentation(group: docsGroup,
// the other inner task temporary created by the generatePluginDocumentation task
def pluginAsciidoc = task "${component.name}-Documentation" (type: AsciidoctorTask) {
def asciidocFolder = new File("${component}/src/docs/asciidoc")
+ doFirst {
if (asciidocFolder.exists()) {
copy {
from "${rootDir}/docs/asciidoc/images/OFBiz-Logo.svg"
into "${component}/src/docs/asciidoc/images"
}
+ }
+ }
+ if (asciidocFolder.exists()) {
sourceDir file("${component}/src/docs/asciidoc")
outputDir file("${buildDir}/asciidoc/plugins/${component.name}")
doLast { println "Documentation generated for plugin ${component.name}" }
@@ -605,7 +621,6 @@ task generateAllPluginsDocumentation(group: docsGroup,
}
dependsOn pluginAsciidoc
}
- doLast { delete "${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" }
}
}
}
