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


##########
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:
   > > If so, it should probably depend on it.
   > 
   > IMO, since `jar` tasks have already been executed in `dist` task, so they 
shouldn't be executed again in task `installPlugin`, just as the original 
`installPlugin` task didn't do that either.
   
   You can not be sure that `dist` has already been executed, since 
`installPlugin` does not have a dependency on `dist`. These dependencies ensure 
that those JARs are ready.
   
   If `dist` **has** been already executed. The JARs will not be built again. 
If you run
   ```
   ./gradlew --console plain --no-daemon clean dist installPlugin
   ```
   nothing will be executed between the `:dist` task and `:installPlugin`. If 
multiple tasks in the build depend on task `foo`, the task will be executed 
only once (or most probably its result will be retrieved from the cache).
   
   > > would create a base distribution with just a single plugin
   > 
   > That's a good idea, but I'm not sure if anyone does this though, because 
trying to remember the exact name of a plugin is difficult, there are a lot of 
plugins, and the vast majority of api's require a default plugin.
   > 
   > After you reminded me of this, I realized that the `installPlugin` task is 
actually doing the work of the `installPlugins` task. However, considering that 
we don't need an new `installPlugin` task, changes to the task would involve 
multiple changes to documentation, CI, etc., so I don't think it's really 
necessary.
   
   I could do this in another PR.



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