mirror of https://github.com/sbt/sbt.git
Fix #7233
The sbt-reproducible-build fails if two artifacts point to the same file. When packaging the artifacts of an sbt plugin, we copy each files to avoid this issue.
This commit is contained in:
parent
26917d7de4
commit
bb0bb5ce58
|
|
@ -2857,7 +2857,14 @@ object Classpaths {
|
|||
val legacyPackages = packaged(defaultPackages).value
|
||||
|
||||
def addSuffix(a: Artifact): Artifact = a.withName(crossVersion(a.name))
|
||||
val packages = legacyPackages.map { case (artifact, file) => addSuffix(artifact) -> file }
|
||||
def copyArtifact(artifact: Artifact, file: File): (Artifact, File) = {
|
||||
val nameWithSuffix = crossVersion(artifact.name)
|
||||
val targetFile =
|
||||
new File(file.getParentFile, file.name.replace(artifact.name, nameWithSuffix))
|
||||
IO.copyFile(file, targetFile)
|
||||
artifact.withName(nameWithSuffix) -> targetFile
|
||||
}
|
||||
val packages = legacyPackages.map { case (artifact, file) => copyArtifact(artifact, file) }
|
||||
val legacyPackagedArtifacts = Def
|
||||
.ifS(sbtPluginPublishLegacyMavenStyle.toTask)(packaged(defaultArtifactTasks))(
|
||||
Def.task(Map.empty[Artifact, File])
|
||||
|
|
|
|||
Loading…
Reference in New Issue