Author: mthl
Date: Fri Mar 1 14:09:50 2019
New Revision: 1854593
URL:
http://svn.apache.org/viewvc?rev=1854593&view=revLog:
Improved: Use ‘findAll’ in build script (OFBIZ-10695)
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=1854593&r1=1854592&r2=1854593&view=diff==============================================================================
--- ofbiz/ofbiz-framework/trunk/build.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/build.gradle Fri Mar 1 14:09:50 2019
@@ -552,8 +552,9 @@ task generateOfbizDocumentation(group: d
task generatePluginDocumentation(group: docsGroup) {
dependsOn deletePluginDocumentation
description 'Generate plugin documentation. Expects pluginId flag'
- activeComponents().each { component ->
- if (project.hasProperty('pluginId') && component.name == pluginId) {
+ activeComponents()
+ .findAll { project.hasProperty('pluginId') && it.name == pluginId }
+ .each { component ->
def pluginAsciidoc = task "${component.name}Documentation" (type: AsciidoctorTask) {
def asciidocFolder = new File("${component}/src/docs/asciidoc")
if (asciidocFolder.exists()) {
@@ -573,7 +574,6 @@ task generatePluginDocumentation(group:
dependsOn pluginAsciidoc
doLast { delete "${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" }
}
- }
}
task generateAllPluginsDocumentation(group: docsGroup,
@@ -747,18 +747,16 @@ task installPlugin(group: ofbizPlugin, d
}
if (project.hasProperty('pluginId')) {
- activeComponents().each { component ->
- if (component.name == pluginId) {
- if (subprojectExists(":plugins:${pluginId}")) {
- if (taskExistsInproject(":plugins:${pluginId}", 'install')) {
- dependsOn ":plugins:${pluginId}:install"
- doLast { println "installed plugin ${pluginId}" }
- } else {
- doLast { println "No install task defined for plugin ${pluginId}, nothing to do" }
- }
+ activeComponents()
+ .findAll { it.name == pluginId }
+ .each { component ->
+ if (taskExistsInproject(":plugins:${pluginId}", 'install')) {
+ dependsOn ":plugins:${pluginId}:install"
+ doLast { println "installed plugin ${pluginId}" }
+ } else {
+ doLast { println "No install task defined for plugin ${pluginId}, nothing to do" }
}
}
- }
}
}