Skip to content

Commit f712b18

Browse files
committed
Improved: Rewrite ‘installAllPlugins’ in build script (OFBIZ-10695)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854591 13f79535-47bb-0310-9956-ffa450edef68
1 parent f1a1431 commit f712b18

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

build.gradle

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -906,18 +906,13 @@ task pullAllPluginsSource(group: ofbizPlugin,
906906
dependsOn pullPluginsFromSvn
907907

908908
task installAllPlugins {
909-
file("${pluginsDir}").eachDir { plugin ->
910-
activeComponents().each { component ->
911-
if (component.name == plugin.name) {
912-
if (subprojectExists(":plugins:${plugin.name}")) {
913-
if (taskExistsInproject(":plugins:${plugin.name}", 'install')) {
914-
dependsOn ":plugins:${plugin.name}:install"
915-
doLast { println "installed plugin ${plugin.name}" }
916-
}
917-
}
918-
}
919-
}
920-
}
909+
subdirs(file("${pluginsDir}"))
910+
.filter(this.isComponentEnabled)
911+
.filter { taskExistsInproject(":plugins:${it.name}", 'install') }
912+
.forEach({ plugin ->
913+
dependsOn ":plugins:${plugin.name}:install"
914+
doLast { println "installed plugin ${plugin.name}" }
915+
})
921916
}
922917
doLast {
923918
gradlewSubprocess(['installAllPlugins'])

common.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,7 @@ List<File> activeComponents() {
5454
}
5555

5656
ext {
57+
subdirs = this.&subdirs
5758
activeComponents = this.&activeComponents.memoize()
59+
isComponentEnabled = this.&isComponentEnabled.memoize()
5860
}

0 commit comments

Comments
 (0)