svn commit: r1846890 - /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: r1846890 - /ofbiz/ofbiz-framework/trunk/build.gradle

jleroux@apache.org
Author: jleroux
Date: Mon Nov 19 09:37:35 2018
New Revision: 1846890

URL: http://svn.apache.org/viewvc?rev=1846890&view=rev
Log:
Implemented: Create a Gradle task to generate the documenation for all plugins
(OFBIZ-10651)

After INFRA-17258 Infra has created the directories needed to access the
generated documentation from the site.

Adds a generateAllPluginsDocumentation task to generate the plugins
documentation under the build\asciidoc\plugins directory. It will be used in the
Buildbot script to copy the plugins documentation in
ci.apache.org/projects/ofbiz/site/pluginsdoc/
with the OFBiz documentation generated in build\asciidoc\ofbiz
copied to ci.apache.org/projects/ofbiz/site/ofbizdoc/

The plugin documentation tasks are also changed to use the build/asciidoc/plugins
path instead of /build/asciidoc previously

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=1846890&r1=1846889&r2=1846890&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/build.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/build.gradle Mon Nov 19 09:37:35 2018
@@ -536,13 +536,18 @@ task deletePluginDocumentation {
         if(!activeComponents.contains(pluginId)) {
             throw new GradleException("Could not find plugin with id ${pluginId}")
         }
-        delete "${buildDir}/asciidoc/${pluginId}"
+        delete "${buildDir}/asciidoc/plugins/${pluginId}"
     }
 }
 
+task deleteAllPluginsDocumentation {
+    doFirst { delete "${buildDir}/asciidoc/plugins" }
+}
+
+
 task generateOfbizDocumentation(group: docsGroup, type: AsciidoctorTask) {
     dependsOn deleteOfbizDocumentation
-    description 'Generate OFBiz documentation manual'
+    description 'Generate OFBiz documentation manuals'
     sourceDir "${rootDir}/docs/asciidoc"
     outputDir file("${buildDir}/asciidoc/ofbiz")
 }
@@ -554,7 +559,7 @@ task generatePluginDocumentation(group:
         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/${component.name}")
+                outputDir file("${buildDir}/asciidoc/plugins/${component.name}")
                 mustRunAfter deletePluginDocumentation
             }
             dependsOn pluginAsciidoc
@@ -562,6 +567,28 @@ task generatePluginDocumentation(group:
     }
 }
 
+task generateAllPluginsDocumentation(group: docsGroup,
+        description: 'Generate all plugins documentation.') {
+        
+    dependsOn deleteAllPluginsDocumentation
+    file("${pluginsDir}").eachDir { plugin ->
+        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
+                    }
+                    dependsOn pluginAsciidoc
+                }
+            }
+        }
+    }
+}
+
+
 // ========== System Administration tasks ==========
 task createTestReports(group: sysadminGroup, description: 'Generate HTML reports from junit XML output') {
     doLast {