cfmcgrady commented on code in PR #2197:
URL: 
https://github.com/apache/incubator-celeborn/pull/2197#discussion_r1438631714


##########
project/CelebornBuild.scala:
##########
@@ -753,7 +753,13 @@ trait SparkClientProjects {
   
         (assembly / assemblyMergeStrategy) := {
           case m if m.toLowerCase(Locale.ROOT).endsWith("manifest.mf") => 
MergeStrategy.discard
-          case "META-INF/LICENSE" | "META-INF/NOTICE" => 
MergeStrategy.preferProject
+          // the LicenseAndNoticeMergeStrategy always picks the license/notice 
file from the current project
+          case m @ ("META-INF/LICENSE" | "META-INF/NOTICE") => 
CustomMergeStrategy("LicenseAndNoticeMergeStrategy") { conflicts =>
+            val entry = conflicts.head

Review Comment:
   > is this way reliable?
   The strategy takes effect only when the conflict files are non-empty. The 
built-in strategy `MergeStrategy.first` encompasses an identical function call
   
   
https://github.com/sbt/sbt-assembly/blob/64dedc8f6f829fbe5feca9d59061a5e344419bd2/src/main/scala/sbtassembly/MergeStrategy.scala#L71-L73
   



##########
project/CelebornBuild.scala:
##########
@@ -753,7 +753,13 @@ trait SparkClientProjects {
   
         (assembly / assemblyMergeStrategy) := {
           case m if m.toLowerCase(Locale.ROOT).endsWith("manifest.mf") => 
MergeStrategy.discard
-          case "META-INF/LICENSE" | "META-INF/NOTICE" => 
MergeStrategy.preferProject
+          // the LicenseAndNoticeMergeStrategy always picks the license/notice 
file from the current project
+          case m @ ("META-INF/LICENSE" | "META-INF/NOTICE") => 
CustomMergeStrategy("LicenseAndNoticeMergeStrategy") { conflicts =>
+            val entry = conflicts.head

Review Comment:
   > is this way reliable?
   
   The strategy takes effect only when the conflict files are non-empty. The 
built-in strategy `MergeStrategy.first` encompasses an identical function call
   
   
https://github.com/sbt/sbt-assembly/blob/64dedc8f6f829fbe5feca9d59061a5e344419bd2/src/main/scala/sbtassembly/MergeStrategy.scala#L71-L73
   



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

Reply via email to