Merge pull request #2079 from sbt/wip/distinct-rename

Fixes #1973. Renames distinct to distinctName
This commit is contained in:
eugene yokota 2015-06-28 21:58:46 -04:00
commit f44f4540db
2 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,12 @@
[@eed3si9n]: http://github.com/eed3si9n
[1973]: https://github.com/sbt/sbt/issues/1973
### Fixes with compatibility implications
### Improvements
- Renames `distinct` method on `PathFinder` to `distinctName`. [#1973][1973] by [@eed3si9n][@eed3si9n]
- Adds `distinctPath` method on `PathFinder`. [#1973][1973] by [@eed3si9n][@eed3si9n]
### Bug fixes

View File

@ -173,7 +173,18 @@ sealed abstract class PathFinder {
* Create a PathFinder from this one where each path has a unique name.
* A single path is arbitrarily selected from the set of paths with the same name.
*/
def distinct: PathFinder = PathFinder { get.map(p => (p.asFile.getName, p)).toMap.values }
def distinctName: PathFinder = PathFinder { get.map(p => (p.asFile.getName, p)).toMap.values }
/**
* Same as <code>distinctName</code>.
*/
@deprecated("Use distinctName", "0.13.9")
def distinct: PathFinder = distinctName
/**
* Create a PathFinder from this one where each path has a unique absolute path.
*/
def distinctPath: PathFinder = PathFinder { get.map(p => (p.absolutePath, p)).toMap.values }
/** Constructs a string by evaluating this finder, converting the resulting Paths to absolute path strings, and joining them with the platform path separator.*/
final def absString = Path.makeString(get)