Skip to content

Commit

Permalink
Remove unnecessary copying
Browse files Browse the repository at this point in the history
  • Loading branch information
antonsviridov-src committed Sep 12, 2024
1 parent ac92b4c commit 0bee013
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.nio.file.StandardCopyOption
import java.nio.file.CopyOption
import sbtdocker.DockerfileBase
import scala.xml.{Node => XmlNode, NodeSeq => XmlNodeSeq, _}
import scala.xml.transform.{RewriteRule, RuleTransformer}
Expand Down Expand Up @@ -591,19 +593,11 @@ lazy val fatjarPackageSettings = List[Def.Setting[_]](
oldStrategy(x)
},
(Compile / Keys.`package`) := {
val slimJar = (Compile / Keys.`package`).value
val fatJar = crossTarget.value / (assembly / assemblyJarName).value
val _ = assembly.value
IO.copyFile(fatJar, slimJar, CopyOptions().withOverwrite(true))
slimJar
assembly.value
},
(Compile / packageBin / packagedArtifact) := {
val (art, slimJar) = (Compile / packageBin / packagedArtifact).value
val fatJar =
new File(crossTarget.value + "/" + (assembly / assemblyJarName).value)
val _ = assembly.value
IO.copy(List(fatJar -> slimJar), CopyOptions().withOverwrite(true))
(art, slimJar)
val (artifact, _) = (Compile / packageBin / packagedArtifact).value
(artifact, assembly.value)
},
pomPostProcess := { node =>
new RuleTransformer(
Expand Down

0 comments on commit 0bee013

Please sign in to comment.