From fae68f50fa99459f188926312c27efafc6bf7e04 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Thu, 21 Mar 2024 14:08:16 +0800 Subject: [PATCH] . --- build.sc | 7 +++--- os/src/FileOps.scala | 51 +++----------------------------------------- 2 files changed, 7 insertions(+), 51 deletions(-) diff --git a/build.sc b/build.sc index 0eeee910..cfa36b30 100644 --- a/build.sc +++ b/build.sc @@ -13,10 +13,9 @@ val communityBuildDottyVersion = sys.props.get("dottyVersion").toList val scala213Version = "2.13.10" val scalaVersions = Seq( - "3.1.3", + "3.3.1", "2.12.17", scala213Version, - "2.11.12" ) ++ communityBuildDottyVersion object Deps { @@ -69,6 +68,8 @@ trait OsLibModule with SafeDeps with PlatformScalaModule { outer => + def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ Agg(ivy"com.lihaoyi::unroll-plugin:0.1.12") + def ivyDeps = super.ivyDeps() ++ Agg(ivy"com.lihaoyi::unroll-annotation:0.1.12") def publishVersion = VcsVersion.vcsState().format() def pomSettings = PomSettings( description = artifactName(), @@ -99,7 +100,7 @@ trait OsLibModule } trait OsModule extends OsLibModule { outer => - def ivyDeps = Agg(Deps.geny) + def ivyDeps = super.ivyDeps() ++ Agg(Deps.geny) def artifactName = "os-lib" diff --git a/os/src/FileOps.scala b/os/src/FileOps.scala index e07f1043..262c417f 100644 --- a/os/src/FileOps.scala +++ b/os/src/FileOps.scala @@ -11,6 +11,7 @@ import java.nio.file.{Path => _, _} import java.nio.file.attribute.{FileAttribute, PosixFilePermission, PosixFilePermissions} import scala.util.Try +import scala.annotation.unroll /** * Create a single directory at the specified path. Optionally takes in a @@ -174,7 +175,7 @@ object copy { replaceExisting: Boolean = false, copyAttributes: Boolean = false, createFolders: Boolean = false, - mergeFolders: Boolean = false + @unroll mergeFolders: Boolean = false ): Unit = { if (createFolders) makeDir.all(to / up) val opts1 = @@ -205,29 +206,6 @@ object copy { if (stat(from, followLinks = followLinks).isDir) walk(from).map(copyOne) } - /** This overload is only to keep binary compatibility with older os-lib versions. */ - @deprecated( - "Use os.copy(from, to, followLinks, replaceExisting, copyAttributes, " + - "createFolders, mergeFolders) instead", - "os-lib 0.7.5" - ) - def apply( - from: Path, - to: Path, - followLinks: Boolean, - replaceExisting: Boolean, - copyAttributes: Boolean, - createFolders: Boolean - ): Unit = apply( - from = from, - to = to, - followLinks = followLinks, - replaceExisting = replaceExisting, - copyAttributes = copyAttributes, - createFolders = createFolders, - mergeFolders = false - ) - /** * Copy a file into a particular folder, rather * than into a particular path @@ -240,7 +218,7 @@ object copy { replaceExisting: Boolean = false, copyAttributes: Boolean = false, createFolders: Boolean = false, - mergeFolders: Boolean = false + @unroll mergeFolders: Boolean = false ): Unit = { os.copy( from, @@ -252,29 +230,6 @@ object copy { mergeFolders ) } - - /** This overload is only to keep binary compatibility with older os-lib versions. */ - @deprecated( - "Use os.copy.into(from, to, followLinks, replaceExisting, copyAttributes, " + - "createFolders, mergeFolders) instead", - "os-lib 0.7.5" - ) - def apply( - from: Path, - to: Path, - followLinks: Boolean, - replaceExisting: Boolean, - copyAttributes: Boolean, - createFolders: Boolean - ): Unit = apply( - from = from, - to = to, - followLinks = followLinks, - replaceExisting = replaceExisting, - copyAttributes = copyAttributes, - createFolders = createFolders, - mergeFolders = false - ) } /**