Skip to content

Commit

Permalink
Improved: Use ‘findAll’ in build script (OFBIZ-10695)
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854593 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Mar 1, 2019
1 parent f712b18 commit 1a33ae3
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,9 @@ task generateOfbizDocumentation(group: docsGroup, type: AsciidoctorTask) {
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()) {
Expand All @@ -573,7 +574,6 @@ task generatePluginDocumentation(group: docsGroup) {
dependsOn pluginAsciidoc
doLast { delete "${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" }
}
}
}

task generateAllPluginsDocumentation(group: docsGroup,
Expand Down Expand Up @@ -747,18 +747,16 @@ task installPlugin(group: ofbizPlugin, description: 'executes plugin install tas
}

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" }
}
}
}
}
}

Expand Down

0 comments on commit 1a33ae3

Please sign in to comment.