Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Mar 21, 2024
1 parent 3e3af41 commit fae68f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 51 deletions.
7 changes: 4 additions & 3 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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"

Expand Down
51 changes: 3 additions & 48 deletions os/src/FileOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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
)
}

/**
Expand Down

0 comments on commit fae68f5

Please sign in to comment.