ppkarwasz commented on code in PR #4719:
URL: https://github.com/apache/eventmesh/pull/4719#discussion_r1561068488


##########
build.gradle:
##########
@@ -160,50 +211,46 @@ task zip(type: Zip) {
     }
 }
 
-task installPlugin() {
-    if (!new File("${rootDir}/dist").exists()) {
-        return
+tasks.register('installPlugin') {
+    var pluginProjects = subprojects.findAll {
+        it.file('gradle.properties').exists()
+                && it.properties.containsKey('pluginType')
+                && it.properties.containsKey('pluginName')
+    }
+    pluginProjects.
+            forEach(subProject -> {
+                var pluginType = subProject.properties.get('pluginType')
+                var pluginName = subProject.properties.get('pluginName')
+                dependsOn("${subProject.path}:jar")

Review Comment:
   Given [your previous 
comment](https://github.com/apache/eventmesh/pull/4719#discussion_r1557893664) 
regarding the dependance of `installPlugin` on `dist`, I am a little bit 
confused about the relationship between these tasks.
   
   Is `installPlugin` always called after `dist`? If so, it should probably 
depend on it. On the other hand `dist` does not need to depend on 
`:eventmesh-connectors:eventmesh-connector-rocketmq:jar` for example, because 
it does not use that JAR.
   
   What happens in the `master` branch is:
   
   - there is a `dist` task for **each** project, even "plugin" projects,
   - there is a **single** `:installPlugin` task that collects all the plugins 
into the `dist` folder.
   
   Maybe it should be reversed:
   
   - there should be a **single** `:dist` project that builds up the basic 
binary distribution (this is implemented in this PR),
   - there should be a `installPlugin` task for **each** "plugin" project 
(currently in this PR, there is a single one).
   
   This way running:
   ```sh
   ./gradlew clean 
:eventmesh-connectors:eventmesh-connector-rocketmq:installPlugin
   ```
   would create a base distribution with just a single plugin. What do you 
think?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to