svn commit: r1854591 - in /ofbiz/ofbiz-framework/trunk: build.gradle common.gradle

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1854591 - in /ofbiz/ofbiz-framework/trunk: build.gradle common.gradle

mthl
Author: mthl
Date: Fri Mar  1 14:08:11 2019
New Revision: 1854591

URL: http://svn.apache.org/viewvc?rev=1854591&view=rev
Log:
Improved: Rewrite ‘installAllPlugins’ in build script (OFBIZ-10695)

Modified:
    ofbiz/ofbiz-framework/trunk/build.gradle
    ofbiz/ofbiz-framework/trunk/common.gradle

Modified: ofbiz/ofbiz-framework/trunk/build.gradle
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/build.gradle?rev=1854591&r1=1854590&r2=1854591&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/build.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/build.gradle Fri Mar  1 14:08:11 2019
@@ -906,18 +906,13 @@ task pullAllPluginsSource(group: ofbizPl
     dependsOn pullPluginsFromSvn
 
     task installAllPlugins {
-        file("${pluginsDir}").eachDir { plugin ->
-            activeComponents().each { component ->
-                if (component.name == plugin.name) {
-                    if (subprojectExists(":plugins:${plugin.name}")) {
-                        if (taskExistsInproject(":plugins:${plugin.name}", 'install')) {
-                            dependsOn ":plugins:${plugin.name}:install"
-                            doLast { println "installed plugin ${plugin.name}" }
-                        }
-                    }
-                }
-            }
-        }
+        subdirs(file("${pluginsDir}"))
+            .filter(this.isComponentEnabled)
+            .filter { taskExistsInproject(":plugins:${it.name}", 'install') }
+            .forEach({ plugin ->
+                dependsOn ":plugins:${plugin.name}:install"
+                doLast { println "installed plugin ${plugin.name}" }
+            })
     }
     doLast {
         gradlewSubprocess(['installAllPlugins'])

Modified: ofbiz/ofbiz-framework/trunk/common.gradle
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/common.gradle?rev=1854591&r1=1854590&r2=1854591&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/common.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/common.gradle Fri Mar  1 14:08:11 2019
@@ -54,5 +54,7 @@ List<File> activeComponents() {
 }
 
 ext {
+    subdirs = this.&subdirs
     activeComponents = this.&activeComponents.memoize()
+    isComponentEnabled = this.&isComponentEnabled.memoize()
 }