diff --git a/build.sbt b/build.sbt index 4e82b1d5a..ddda94edf 100644 --- a/build.sbt +++ b/build.sbt @@ -3,7 +3,7 @@ organization := "com.github.sbt" homepage := Some(url("https://github.com/sbt/sbt-native-packager")) Global / onChangedBuildSource := ReloadOnSourceChanges -Global / scalaVersion := "2.12.19" +Global / scalaVersion := "2.13.13" // crossBuildingSettings crossSbtVersions := Vector("1.1.6") diff --git a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala index 4f66e0545..6f9b6a95c 100644 --- a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala +++ b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala @@ -4,6 +4,7 @@ package linux import sbt._ import LinuxPlugin.Users +import scala.Iterable case class LinuxFileMetaData( user: String = Users.Root, @@ -21,7 +22,7 @@ case class LinuxFileMetaData( } case class LinuxPackageMapping( - mappings: Traversable[(File, String)], + mappings: Iterable[(File, String)], fileData: LinuxFileMetaData = LinuxFileMetaData(), zipped: Boolean = false ) { diff --git a/src/main/scala/com/typesafe/sbt/packager/universal/ZipHelper.scala b/src/main/scala/com/typesafe/sbt/packager/universal/ZipHelper.scala index b2a6a3230..c5deac427 100644 --- a/src/main/scala/com/typesafe/sbt/packager/universal/ZipHelper.scala +++ b/src/main/scala/com/typesafe/sbt/packager/universal/ZipHelper.scala @@ -11,6 +11,7 @@ import org.apache.commons.compress.utils.IOUtils import sbt._ import scala.collection.JavaConverters._ +import scala.Iterable /** * Module with functions associated with processing zip files. @@ -34,7 +35,7 @@ object ZipHelper { * @param outputZip * The location of the output file. */ - def zipNative(sources: Traversable[(File, String)], outputZip: File): Unit = + def zipNative(sources: Iterable[(File, String)], outputZip: File): Unit = IO.withTemporaryDirectory { dir => val name = outputZip.getName val zipDir = dir / (if (name endsWith ".zip") name dropRight 4 else name) @@ -69,7 +70,7 @@ object ZipHelper { * @param outputZip * The location of the output file. */ - def zip(sources: Traversable[(File, String)], outputZip: File): Unit = { + def zip(sources: Iterable[(File, String)], outputZip: File): Unit = { import permissions.OctalString val mappings = for { @@ -90,7 +91,7 @@ object ZipHelper { * @param outputZip * The location of the output file. */ - def zipNIO(sources: Traversable[(File, String)], outputZip: File): Unit = { + def zipNIO(sources: Iterable[(File, String)], outputZip: File): Unit = { require(!outputZip.isDirectory, "Specified output file " + outputZip + " is a directory.") val mappings = sources.toSeq.map { case (file, name) => FileMapping(file, name) diff --git a/src/test/scala/com/typesafe/sbt/packager/universal/ZipHelperSpec.scala b/src/test/scala/com/typesafe/sbt/packager/universal/ZipHelperSpec.scala index 97e8d9ade..64a9efc2a 100644 --- a/src/test/scala/com/typesafe/sbt/packager/universal/ZipHelperSpec.scala +++ b/src/test/scala/com/typesafe/sbt/packager/universal/ZipHelperSpec.scala @@ -6,7 +6,8 @@ import org.scalatest._ import java.io.File import java.nio.file.{Files, Path, Paths} import java.nio.file.attribute.PosixFilePermission._ -import scala.collection.JavaConversions._ +import scala.Iterable +import scala.collection.JavaConverters._ class ZipHelperSpec extends WordSpec with Matchers with BeforeAndAfterEach with BeforeAndAfterAll { @@ -100,7 +101,7 @@ class ZipHelperSpec extends WordSpec with Matchers with BeforeAndAfterEach with /* ========================================================== */ /* ========================================================== */ - private type Zipper = (Traversable[(File, String)], File) => Unit + private type Zipper = (Iterable[(File, String)], File) => Unit private def zipSingleFile(zipper: Zipper): Unit = { val out = tmp resolve "single.zip"