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 Original file line Diff line number Diff line change
Expand Up @@ -552,8 +552,9 @@ task generateOfbizDocumentation(group: docsGroup, type: AsciidoctorTask) {
task generatePluginDocumentation(group: docsGroup) { task generatePluginDocumentation(group: docsGroup) {
dependsOn deletePluginDocumentation dependsOn deletePluginDocumentation
description 'Generate plugin documentation. Expects pluginId flag' description 'Generate plugin documentation. Expects pluginId flag'
activeComponents().each { component -> activeComponents()
if (project.hasProperty('pluginId') && component.name == pluginId) { .findAll { project.hasProperty('pluginId') && it.name == pluginId }
.each { component ->
def pluginAsciidoc = task "${component.name}Documentation" (type: AsciidoctorTask) { def pluginAsciidoc = task "${component.name}Documentation" (type: AsciidoctorTask) {
def asciidocFolder = new File("${component}/src/docs/asciidoc") def asciidocFolder = new File("${component}/src/docs/asciidoc")
if (asciidocFolder.exists()) { if (asciidocFolder.exists()) {
Expand All @@ -573,7 +574,6 @@ task generatePluginDocumentation(group: docsGroup) {
dependsOn pluginAsciidoc dependsOn pluginAsciidoc
doLast { delete "${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" } doLast { delete "${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" }
} }
}
} }


task generateAllPluginsDocumentation(group: docsGroup, 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')) { if (project.hasProperty('pluginId')) {
activeComponents().each { component -> activeComponents()
if (component.name == pluginId) { .findAll { it.name == pluginId }
if (subprojectExists(":plugins:${pluginId}")) { .each { component ->
if (taskExistsInproject(":plugins:${pluginId}", 'install')) { if (taskExistsInproject(":plugins:${pluginId}", 'install')) {
dependsOn ":plugins:${pluginId}:install" dependsOn ":plugins:${pluginId}:install"
doLast { println "installed plugin ${pluginId}" } doLast { println "installed plugin ${pluginId}" }
} else { } else {
doLast { println "No install task defined for plugin ${pluginId}, nothing to do" } doLast { println "No install task defined for plugin ${pluginId}, nothing to do" }
}
} }
} }
}
} }
} }


Expand Down

0 comments on commit 1a33ae3

Please sign in to comment.