You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2021/10/17 00:45:50 UTC

[GitHub] [incubator-eventmesh] xwm1992 commented on a change in pull request #558: [ISSUE #550] Deduplicate plugin jar

xwm1992 commented on a change in pull request #558:
URL: https://github.com/apache/incubator-eventmesh/pull/558#discussion_r730266977



##########
File path: build.gradle
##########
@@ -187,90 +226,60 @@ subprojects {
         }
     }
 
-    // pluginType:
-    //      pluginInstanceName:
-    //            moduleName
-    Map<String, Map<String, String>> pluginTypeMap = [
-            "connector": [
-                    "rocketmq"  : "eventmesh-connector-rocketmq",
-                    "standalone": "eventmesh-connector-standalone",
-            ],
-            "security" : [
-                    "acl": "eventmesh-security-acl",
-            ],
-            "registry" : [
-                    "namesrv": "eventmesh-registry-namesrv",
-            ]
-    ]
-
     task dist(dependsOn: ['jar']) {
         doFirst {
-            new File(projectDir, '../dist/bin').mkdirs()
-            new File(projectDir, '../dist/apps').mkdirs()
-            new File(projectDir, '../dist/conf').mkdirs()
-            new File(projectDir, '../dist/lib').mkdirs()
+            new File("${projectDir}/dist/bin").mkdirs()
+            new File("${projectDir}/dist/apps").mkdirs()
+            new File("${projectDir}/dist/conf").mkdirs()
+            new File("${projectDir}/dist/lib").mkdirs()
         }
-
+        Set<String> rootProject = ["eventmesh-admin",
+                                   "eventmesh-common",
+                                   "eventmesh-connector-api",
+                                   "eventmesh-registry-api",
+                                   "eventmesh-runtime",
+                                   "eventmesh-security-api",
+                                   "eventmesh-starter",
+                                   "eventmesh-spi"]
         doLast {
-            pluginTypeMap.forEach((pluginType, pluginInstanceMap) -> {
-                pluginInstanceMap.forEach((pluginInstanceName, moduleName) -> {
-                    if (moduleName == project.name) {
-                        println String.format("install plugin, pluginType: %s, pluginInstanceName: %s, module: %s",
-                                pluginType, pluginInstanceName, moduleName)
-                        new File("${rootDir}/dist/plugin/${pluginType}/${pluginInstanceName}").mkdirs()
-                        copy {
-                            into "${rootDir}/dist/plugin/${pluginType}/${pluginInstanceName}"
-                            from project.jar.getArchivePath()
-                        }
-                        copy {
-                            into "${rootDir}/dist/plugin/${pluginType}/${pluginInstanceName}"
-                            from project.configurations.runtimeClasspath
-                        }
-                        copy {
-                            into "${rootDir}/dist/conf"
-                            from sourceSets.main.resources.srcDirs
-                            exclude 'META-INF'
-                        }
-                    }
-                })
-            })
-
             copy {
-                into('../dist/apps/')
+                into("${projectDir}/dist/apps")
                 from project.jar.getArchivePath()
-//                exclude 'eventmesh-common*.jar'
-//                exclude 'eventmesh-connector-api*.jar'
-//                exclude 'eventmesh-connector-plugin*.jar'
-//                exclude 'eventmesh-admin*.jar'
-//                exclude 'eventmesh-starter*.jar'
-//                exclude 'eventmesh-test*.jar'
-//                exclude 'eventmesh-sdk*.jar'
             }
             copy {
-                into '../dist/lib'
+                into("${projectDir}/dist/lib")
                 from project.configurations.runtimeClasspath
-                exclude '**/*.properties*'
-                exclude '**/*testng*.jar'
-                exclude '**/*powermock*.jar'
-                exclude '**/*mockito*.jar'
-                exclude '**/*junit*.jar'
-                exclude '**/*jacoco*.jar'
-                exclude '**/*log4j2.xml*'
-                exclude '**/spring-boot-devtools*.jar'
-                exclude '**/mumble-sdk-test*.jar'
-                exclude 'eventmesh*.jar'
-//                exclude 'eventmesh-runtime*.jar'
-                exclude 'commons-collections-3.2.2.jar'
             }
-
             copy {
-                into '../dist/bin'
-                from '../eventmesh-runtime/bin'
+                into("${projectDir}/dist/bin")
+                from 'bin'
             }
-
             copy {
-                into '../dist/conf'
-                from '../eventmesh-runtime/conf'
+                into("${projectDir}/dist/conf")
+                from 'conf', sourceSets.main.resources.srcDirs
+                exclude 'META-INF'

Review comment:
       here may add the `DuplicatesStrategy` because if you locally run the eventmesh examples module `resources` files contains the files same as the `conf` files this may cause build fail, or we can exclude the eventmesh examples module during the compile period. 




-- 
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: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org