mirror of https://github.com/sbt/sbt.git
refactor: Clean up infix etc
This commit is contained in:
parent
f8704752e0
commit
9813e60fe3
|
|
@ -11,7 +11,6 @@ package parser
|
|||
|
||||
import sbt.internal.util.{ LineRange, MessageOnlyException }
|
||||
import sbt.internal.io.Retry
|
||||
import java.io.File
|
||||
import java.nio.charset.StandardCharsets
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import sbt.internal.parser.SbtParser.*
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ class FileCommands(baseDirectory: File) extends BasicStatementHandler {
|
|||
case paths =>
|
||||
val mapped = fromStrings(paths)
|
||||
val map = mapper(mapped.last)
|
||||
IO.copy(mapped.init pair map)
|
||||
IO.copy(mapped.init.pair(map))
|
||||
()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import lmcoursier.definitions.{
|
|||
Type
|
||||
}
|
||||
import sbt.internal.librarymanagement.mavenint.SbtPomExtraProperties
|
||||
import sbt.librarymanagement.{ Configuration as _, MavenRepository as _, * }
|
||||
import sbt.librarymanagement.{ Configuration as _, * }
|
||||
|
||||
object FromSbt {
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import coursier.core.{ Authentication, Repository }
|
|||
import coursier.ivy.IvyRepository
|
||||
import coursier.maven.SbtMavenRepository
|
||||
import org.apache.ivy.plugins.resolver.IBiblioResolver
|
||||
import sbt.librarymanagement.{ Configuration as _, MavenRepository as _, * }
|
||||
import sbt.librarymanagement.*
|
||||
import sbt.util.Logger
|
||||
|
||||
import scala.jdk.CollectionConverters.*
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ object Mapper:
|
|||
*/
|
||||
def directory(baseDirectory: File)(using conv: FileConverter): Seq[(VirtualFile, String)] =
|
||||
Option(baseDirectory.getParentFile)
|
||||
.map(parent => PathFinder(baseDirectory).allPaths pair relativeTo(parent))
|
||||
.getOrElse(PathFinder(baseDirectory).allPaths pair basic)
|
||||
.map(parent => PathFinder(baseDirectory).allPaths.pair(relativeTo(parent)))
|
||||
.getOrElse(PathFinder(baseDirectory).allPaths.pair(basic))
|
||||
.map { (f, s) => conv.toVirtualFile(f.toPath) -> s }
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -75,12 +75,12 @@ case object ThisProject extends ProjectReference
|
|||
case object LocalAggregate extends ProjectReference
|
||||
|
||||
object ProjectRef {
|
||||
def apply(base: File, id: String): ProjectRef = ProjectRef(IO toURI base, id)
|
||||
def apply(base: File, id: String): ProjectRef = ProjectRef(IO.toURI(base), id)
|
||||
}
|
||||
object RootProject {
|
||||
|
||||
/** Reference to the root project at 'base'. */
|
||||
def apply(base: File): RootProject = RootProject(IO toURI base)
|
||||
def apply(base: File): RootProject = RootProject(IO.toURI(base))
|
||||
}
|
||||
object Reference {
|
||||
given resolvedReferenceOrdering: Ordering[ResolvedReference] = {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import java.io.File
|
|||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
import sbt.Def.{ ScopedKey, Setting, dummyState }
|
||||
import sbt.Keys.{ TaskProgress as _, name as _, * }
|
||||
import sbt.Keys.{ name as _, * }
|
||||
import sbt.BuildExtra.*
|
||||
import sbt.ProjectExtra.*
|
||||
import sbt.Scope.Global
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
package sbt
|
||||
package internal
|
||||
|
||||
import java.io.{ ByteArrayInputStream, IOException, InputStream, File as _ }
|
||||
import java.io.{ ByteArrayInputStream, IOException, InputStream }
|
||||
import java.nio.file.Path
|
||||
import java.util.concurrent.{
|
||||
ConcurrentHashMap,
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@
|
|||
package sbt
|
||||
package internal
|
||||
|
||||
import java.nio.file.{ WatchService as _ }
|
||||
|
||||
import sbt.nio.FileStamper
|
||||
import sbt.nio.file.Glob
|
||||
|
||||
|
|
|
|||
|
|
@ -654,7 +654,7 @@ private[sbt] object Load {
|
|||
if (base.isFile)
|
||||
sys.error("Not a directory: " + base)
|
||||
else if (!base.exists)
|
||||
IO createDirectory base
|
||||
IO.createDirectory(base)
|
||||
}
|
||||
|
||||
def checkAll(
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import sbt.util.Show
|
|||
import java.io.File
|
||||
|
||||
import Def.{ ScopedKey, compiled, flattenLocals }
|
||||
import Predef.{ any2stringadd as _, * }
|
||||
import sbt.ProjectExtra.scopedKeyData
|
||||
import sbt.io.IO
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue