Skip to content

Commit

Permalink
use sLog
Browse files Browse the repository at this point in the history
  • Loading branch information
cxzl25 committed Nov 1, 2023
1 parent b997081 commit 3bfbddc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions project/CelebornBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@ object CelebornCommonSettings {
// https://www.scala-sbt.org/1.x/docs/Testing.html
Dependencies.junitInterface % "test")

def licenseFileOnlyProjectMergeStrategy(path: String) =
def licenseFileOnlyProjectMergeStrategy(path: String, log: Logger) =
CustomMergeStrategy("LicenseFileOnlyProjectMergeStrategy") { conflicts =>
Right(conflicts.map {
case dep if dep.isProjectDependency =>
println(s"$path from Project dependency: $dep")
log.info(s"assembly - including file: ${path}")
Some(JarEntry(dep.target, dep.stream))
case dep =>
println(s"[Discard] $path Not from Project dependency: $dep")
log.info(s"assembly - excluding file: $dep:$path")
None
}.flatMap(_.toVector))
}
Expand Down Expand Up @@ -692,7 +692,8 @@ trait SparkClientProjects {
(assembly / assemblyMergeStrategy) := {
case m if m.toLowerCase(Locale.ROOT).endsWith("manifest.mf") => MergeStrategy.discard
case m if m.startsWith("META-INF/license/") => MergeStrategy.discard
case PathList(ps@_*) if Assembly.isLicenseFile(ps.last) => licenseFileOnlyProjectMergeStrategy(ps.mkString(java.io.File.separator))
case PathList(ps@_*) if Assembly.isLicenseFile(ps.last) =>
licenseFileOnlyProjectMergeStrategy(ps.mkString(java.io.File.separator), sLog.value)
// Drop all proto files that are not needed as artifacts of the build.
case m if m.toLowerCase(Locale.ROOT).endsWith(".proto") => MergeStrategy.discard
case m if m.toLowerCase(Locale.ROOT).startsWith("meta-inf/native-image") => MergeStrategy.discard
Expand Down Expand Up @@ -885,7 +886,7 @@ trait FlinkClientProjects {
(assembly / assemblyMergeStrategy) := {
case m if m.toLowerCase(Locale.ROOT).endsWith("manifest.mf") => MergeStrategy.discard
case m if m.startsWith("META-INF/license/") => MergeStrategy.discard
case PathList(ps@_*) if Assembly.isLicenseFile(ps.last) => licenseFileOnlyProjectMergeStrategy(ps.mkString(java.io.File.separator))
case PathList(ps@_*) if Assembly.isLicenseFile(ps.last) => licenseFileOnlyProjectMergeStrategy(ps.mkString(java.io.File.separator), sLog.value)
// Drop all proto files that are not needed as artifacts of the build.
case m if m.toLowerCase(Locale.ROOT).endsWith(".proto") => MergeStrategy.discard
case m if m.toLowerCase(Locale.ROOT).startsWith("meta-inf/native-image") => MergeStrategy.discard
Expand Down Expand Up @@ -964,7 +965,7 @@ object MRClientProjects {
(assembly / assemblyMergeStrategy) := {
case m if m.toLowerCase(Locale.ROOT).endsWith("manifest.mf") => MergeStrategy.discard
case m if m.startsWith("META-INF/license/") => MergeStrategy.discard
case PathList(ps@_*) if Assembly.isLicenseFile(ps.last) => licenseFileOnlyProjectMergeStrategy(ps.mkString(java.io.File.separator))
case PathList(ps@_*) if Assembly.isLicenseFile(ps.last) => licenseFileOnlyProjectMergeStrategy(ps.mkString(java.io.File.separator), sLog.value)
// Drop all proto files that are not needed as artifacts of the build.
case m if m.toLowerCase(Locale.ROOT).endsWith(".proto") => MergeStrategy.discard
case m if m.toLowerCase(Locale.ROOT).startsWith("meta-inf/native-image") => MergeStrategy.discard
Expand Down

0 comments on commit 3bfbddc

Please sign in to comment.