Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 38e8ca3

Browse files
authored
Merge pull request #56 from daniel0611/copy-don't-rm-plugins
Don't delete plugins at build time
2 parents 64eb789 + 98cff36 commit 38e8ca3

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

project/BuildUtility.scala

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import java.io.{File, IOException}
2-
import java.nio.file.Files
2+
import java.nio.file.{Files, StandardCopyOption}
33

44
import sbt.internal.util.ManagedLogger
55
import sbt.util.{FileFunction, FilesInfo}
@@ -117,21 +117,11 @@ class BuildUtility(logger: ManagedLogger) {
117117
logger info s"Found plugin folder '${pluginTargetFolder.getPath}'."
118118
}
119119

120-
// Clean first
121-
for (jarFile <- pluginTargetFolder.listFiles().filter(_.getName.endsWith(".jar"))) {
122-
try {
123-
jarFile.delete()
124-
logger info s"Deleted plugin '${jarFile.getName}' from target."
125-
} catch {
126-
case e: IOException => logger warn s"Unable to delete plugin '${jarFile.getAbsolutePath}' from target. Error: ${e.getMessage}."
127-
}
128-
}
129-
130120
// Copy jars
131121
var successCounter = 0
132122
for (jarFile <- allJarFiles) {
133123
try {
134-
Files.copy(jarFile.toPath, new File(pluginTargetFolder, jarFile.getName).toPath)
124+
Files.copy(jarFile.toPath, new File(pluginTargetFolder, jarFile.getName).toPath, StandardCopyOption.REPLACE_EXISTING)
135125
logger info s"Copied plugin '${jarFile.getName}'."
136126
successCounter = successCounter + 1
137127
} catch {

0 commit comments

Comments
 (0)