diff --git a/notes/0.13.9/distinct-rename.markdown b/notes/0.13.9/distinct-rename.markdown index 96169f13a..28f8bdb21 100644 --- a/notes/0.13.9/distinct-rename.markdown +++ b/notes/0.13.9/distinct-rename.markdown @@ -7,5 +7,6 @@ ### 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 diff --git a/util/io/src/main/scala/sbt/Path.scala b/util/io/src/main/scala/sbt/Path.scala index 274ff8f13..8fa2a25ac 100644 --- a/util/io/src/main/scala/sbt/Path.scala +++ b/util/io/src/main/scala/sbt/Path.scala @@ -181,6 +181,11 @@ sealed abstract class PathFinder { @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) /** Constructs a debugging string for this finder by evaluating it and separating paths by newlines.*/