svn commit: r1848386 - /ofbiz/ofbiz-framework/trunk/build.gradle

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1848386 - /ofbiz/ofbiz-framework/trunk/build.gradle

jleroux@apache.org
Author: jleroux
Date: Fri Dec  7 09:30:28 2018
New Revision: 1848386

URL: http://svn.apache.org/viewvc?rev=1848386&view=rev
Log:
Fixed: Standalone Asciidoc plugins documents can't render logo correctly in PDF
(OFBIZ-10677)

Modifies the generatePluginDocumentation and generateAllPluginsDocumentation
tasks by temporary copying the OFBiz-Logo.svg in plugin/s

Modified:
    ofbiz/ofbiz-framework/trunk/build.gradle

Modified: ofbiz/ofbiz-framework/trunk/build.gradle
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/build.gradle?rev=1848386&r1=1848385&r2=1848386&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/build.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/build.gradle Fri Dec  7 09:30:28 2018
@@ -556,11 +556,23 @@ task generatePluginDocumentation(group:
     iterateOverActiveComponents { component ->
         if (project.hasProperty('pluginId') && component.name == pluginId) {
             def pluginAsciidoc = task "${component.name}Documentation" (type: AsciidoctorTask) {
-                sourceDir file("${component}/src/docs/asciidoc")
-                outputDir file("${buildDir}/asciidoc/plugins/${component.name}")
-                mustRunAfter deletePluginDocumentation
+                def asciidocFolder = new File("${component}/src/docs/asciidoc")
+                if (asciidocFolder.exists()) {
+                    copy {
+                        from "${rootDir}/docs/asciidoc/images/OFBiz-Logo.svg"
+                        into "${component}/src/docs/asciidoc/images"
+                    }
+                    sourceDir file("${component}/src/docs/asciidoc")
+                    outputDir file("${buildDir}/asciidoc/plugins/${component.name}")
+                    doLast { println "Documentation generated for plugin ${component.name}" }
+                    
+                } else {
+                      println "No documentation found for plugin ${component.name}"
+                  }
+            mustRunAfter deletePluginDocumentation
             }
             dependsOn pluginAsciidoc
+            doLast { delete "${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" }
         }
     }
 }
@@ -573,14 +585,25 @@ task generateAllPluginsDocumentation(gro
         iterateOverActiveComponents { component ->
             if (component.name == plugin.name) {
                 if (subprojectExists(":plugins:${plugin.name}")) {
-                    def pluginAsciidoc = task "${component.name}-Documentation" (type: AsciidoctorTask) {
-                        sourceDir file("${component}/src/docs/asciidoc")
-                        outputDir file("${buildDir}/asciidoc/plugins/${component.name}")
-                        doLast { println "Documentation generated for plugin ${component.name}" }
-                        mustRunAfter deleteAllPluginsDocumentation
+                    // Note: the "-" between "component.name" and "Documentation" allows to differentiate from
+                    // 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")
+                        if (asciidocFolder.exists()) {
+                            copy {
+                                from "${rootDir}/docs/asciidoc/images/OFBiz-Logo.svg"
+                                into "${component}/src/docs/asciidoc/images"
+                            }
+                            sourceDir file("${component}/src/docs/asciidoc")
+                            outputDir file("${buildDir}/asciidoc/plugins/${component.name}")
+                            doLast { println "Documentation generated for plugin ${component.name}" }
+                        }
+                    mustRunAfter deleteAllPluginsDocumentation
                     }
+                    
                     dependsOn pluginAsciidoc
                 }
+                doLast { delete "${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" }
             }
         }
     }