Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1513 from olafurpg/multipath
Remove scala.meta.io.{Multipath,Sourcepath,Fragment}
- Loading branch information
Showing
12 changed files
with
60 additions
and
212 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
scalameta/io/shared/src/main/scala/scala/meta/internal/io/package.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package scala.meta.internal | ||
|
||
import java.nio.file.FileVisitor | ||
import java.nio.file.Files | ||
import java.nio.file.Path | ||
import scala.meta.io.AbsolutePath | ||
import scala.meta.io.Classpath | ||
|
||
package object io { | ||
|
||
implicit class XtensionClasspath(cp: Classpath) { | ||
def visit(getVisitor: AbsolutePath => FileVisitor[Path]): Unit = { | ||
cp.entries.foreach { base => | ||
if (base.isDirectory) { | ||
val visitor = getVisitor(base) | ||
Files.walkFileTree(base.toNIO, visitor) | ||
} else if (base.isFile) { | ||
PathIO.extension(base.toNIO) match { | ||
case "jar" => | ||
val root = FileIO.jarRootPath(base) | ||
val visitor = getVisitor(root) | ||
Files.walkFileTree(root.toNIO, visitor) | ||
case _ => | ||
sys.error(s"Expected jar file, obtained $base") | ||
} | ||
} else { | ||
() | ||
} | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
scalameta/io/shared/src/main/scala/scala/meta/io/Classpath.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package scala.meta.io | ||
|
||
import java.io.File.pathSeparator | ||
|
||
final case class Classpath(entries: List[AbsolutePath]) { | ||
|
||
@deprecated("Use .entries instead", "4.0.0") | ||
def shallow: List[AbsolutePath] = entries | ||
|
||
def syntax: String = entries.mkString(pathSeparator) | ||
def structure: String = s"""Classpath("$syntax")""" | ||
override def toString: String = syntax | ||
} | ||
|
||
object Classpath { | ||
def apply(entry: AbsolutePath): Classpath = { | ||
new Classpath(List(entry)) | ||
} | ||
|
||
def apply(value: String): Classpath = { | ||
new Classpath(value.split(pathSeparator).map(AbsolutePath(_)).toList) | ||
} | ||
} |
19 changes: 0 additions & 19 deletions
19
scalameta/io/shared/src/main/scala/scala/meta/io/Fragment.scala
This file was deleted.
Oops, something went wrong.
116 changes: 0 additions & 116 deletions
116
scalameta/io/shared/src/main/scala/scala/meta/io/Multipath.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
tests/jvm/src/test/scala/scala/meta/tests/io/FragmentSuite.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters