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

Don't delete plugins at build time #56

Merged
merged 1 commit into from
Jun 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions project/BuildUtility.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import java.io.{File, IOException}
import java.nio.file.Files
import java.nio.file.{Files, StandardCopyOption}

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

// Clean first
for (jarFile <- pluginTargetFolder.listFiles().filter(_.getName.endsWith(".jar"))) {
try {
jarFile.delete()
logger info s"Deleted plugin '${jarFile.getName}' from target."
} catch {
case e: IOException => logger warn s"Unable to delete plugin '${jarFile.getAbsolutePath}' from target. Error: ${e.getMessage}."
}
}

// Copy jars
var successCounter = 0
for (jarFile <- allJarFiles) {
try {
Files.copy(jarFile.toPath, new File(pluginTargetFolder, jarFile.getName).toPath)
Files.copy(jarFile.toPath, new File(pluginTargetFolder, jarFile.getName).toPath, StandardCopyOption.REPLACE_EXISTING)
logger info s"Copied plugin '${jarFile.getName}'."
successCounter = successCounter + 1
} catch {
Expand Down