Fix spelling: 'descendent' is now 'descendant', English ftw. Closes #293

This commit is contained in:
Indrajit Raychaudhuri 2011-12-12 19:10:47 +05:30
parent 447608c596
commit 859f569da0
3 changed files with 47 additions and 44 deletions

View File

@ -373,7 +373,7 @@ object Defaults extends BuildCommon
} }
def collectFiles(dirs: ScopedTaskable[Seq[File]], filter: ScopedTaskable[FileFilter], excludes: ScopedTaskable[FileFilter]): Initialize[Task[Seq[File]]] = def collectFiles(dirs: ScopedTaskable[Seq[File]], filter: ScopedTaskable[FileFilter], excludes: ScopedTaskable[FileFilter]): Initialize[Task[Seq[File]]] =
(dirs, filter, excludes) map { (d,f,excl) => d.descendentsExcept(f,excl).get } (dirs, filter, excludes) map { (d,f,excl) => d.descendantsExcept(f,excl).get }
def artifactPathSetting(art: SettingKey[Artifact]) = (crossTarget, projectID, art, scalaVersion in artifactName, artifactName) { (t, module, a, sv, toString) => t / toString(sv, module, a) asFile } def artifactPathSetting(art: SettingKey[Artifact]) = (crossTarget, projectID, art, scalaVersion in artifactName, artifactName) { (t, module, a, sv, toString) => t / toString(sv, module, a) asFile }
def artifactSetting = ((artifact, artifactClassifier).identity zipWith configuration.?) { case ((a,classifier),cOpt) => def artifactSetting = ((artifact, artifactClassifier).identity zipWith configuration.?) { case ((a,classifier),cOpt) =>
@ -645,7 +645,7 @@ object Classpaths
excludeFilter in unmanagedJars <<= (defaultExcludes in unmanagedJars) or (excludeFilter in unmanagedJars), excludeFilter in unmanagedJars <<= (defaultExcludes in unmanagedJars) or (excludeFilter in unmanagedJars),
includeFilter in unmanagedJars <<= classpathFilter or (includeFilter in unmanagedJars), includeFilter in unmanagedJars <<= classpathFilter or (includeFilter in unmanagedJars),
unmanagedJars <<= (configuration, unmanagedBase, includeFilter in unmanagedJars, excludeFilter in unmanagedJars) map { (config, base, filter, excl) => unmanagedJars <<= (configuration, unmanagedBase, includeFilter in unmanagedJars, excludeFilter in unmanagedJars) map { (config, base, filter, excl) =>
(base * (filter -- excl) +++ (base / config.name).descendentsExcept(filter, excl)).classpath (base * (filter -- excl) +++ (base / config.name).descendantsExcept(filter, excl)).classpath
} }
) )
def defaultPackageKeys = Seq(packageBin, packageSrc, packageDoc) def defaultPackageKeys = Seq(packageBin, packageSrc, packageDoc)

View File

@ -1,7 +1,7 @@
> compile > compile
# modify A.scala so that the signature of its method changes to be identical to # modify A.scala so that the signature of its method changes to be identical to
# that of the method in its descendent in C.scala # that of the method in its descendant in C.scala
$ copy-file changes/A.scala A.scala $ copy-file changes/A.scala A.scala
# Should recompile C.scala and report this error, failing the compile # Should recompile C.scala and report this error, failing the compile
-> compile -> compile

View File

@ -125,8 +125,8 @@ sealed abstract class PathFinder
/** Excludes all paths from <code>excludePaths</code> from the paths selected by this <code>PathFinder</code>.*/ /** Excludes all paths from <code>excludePaths</code> from the paths selected by this <code>PathFinder</code>.*/
def ---(excludePaths: PathFinder): PathFinder = new ExcludeFiles(this, excludePaths) def ---(excludePaths: PathFinder): PathFinder = new ExcludeFiles(this, excludePaths)
/** Constructs a new finder that selects all paths with a name that matches <code>filter</code> and are /** Constructs a new finder that selects all paths with a name that matches <code>filter</code> and are
* descendents of paths selected by this finder.*/ * descendants of paths selected by this finder.*/
def **(filter: FileFilter): PathFinder = new DescendentOrSelfPathFinder(this, filter) def **(filter: FileFilter): PathFinder = new DescendantOrSelfPathFinder(this, filter)
def *** : PathFinder = **(AllPassFilter) def *** : PathFinder = **(AllPassFilter)
/** Constructs a new finder that selects all paths with a name that matches <code>filter</code> and are /** Constructs a new finder that selects all paths with a name that matches <code>filter</code> and are
* immediate children of paths selected by this finder.*/ * immediate children of paths selected by this finder.*/
@ -148,12 +148,15 @@ sealed abstract class PathFinder
for(file <- get; mapped <- apply(file)) yield (file, mapped) for(file <- get; mapped <- apply(file)) yield (file, mapped)
} }
/** Selects all descendent paths with a name that matches <code>include</code> and do not have an intermediate /** Selects all descendant paths with a name that matches <code>include</code> and do not have an intermediate
* path with a name that matches <code>intermediateExclude</code>. Typical usage is: * path with a name that matches <code>intermediateExclude</code>. Typical usage is:
* *
* <code>descendentsExcept("*.jar", ".svn")</code>*/ * <code>descendantsExcept("*.jar", ".svn")</code>*/
def descendentsExcept(include: FileFilter, intermediateExclude: FileFilter): PathFinder = def descendantsExcept(include: FileFilter, intermediateExclude: FileFilter): PathFinder =
(this ** include) --- (this ** intermediateExclude ** include) (this ** include) --- (this ** intermediateExclude ** include)
@deprecated("Use `descendantsExcept` instead.", "0.11.3")
def descendentsExcept(include: FileFilter, intermediateExclude: FileFilter): PathFinder =
descendantsExcept(include, intermediateExclude)
/** Evaluates this finder and converts the results to a `Seq` of distinct `File`s. The files returned by this method will reflect the underlying filesystem at the /** Evaluates this finder and converts the results to a `Seq` of distinct `File`s. The files returned by this method will reflect the underlying filesystem at the
* time of calling. If the filesystem changes, two calls to this method might be different.*/ * time of calling. If the filesystem changes, two calls to this method might be different.*/
@ -198,7 +201,7 @@ private abstract class FilterFiles extends PathFinder with FileFilter
for(matchedFile <- wrapNull(file.listFiles(this))) for(matchedFile <- wrapNull(file.listFiles(this)))
fileSet += new File(file, matchedFile.getName) fileSet += new File(file, matchedFile.getName)
} }
private class DescendentOrSelfPathFinder(val parent: PathFinder, val filter: FileFilter) extends FilterFiles private class DescendantOrSelfPathFinder(val parent: PathFinder, val filter: FileFilter) extends FilterFiles
{ {
private[sbt] def addTo(fileSet: mutable.Set[File]) private[sbt] def addTo(fileSet: mutable.Set[File])
{ {
@ -206,14 +209,14 @@ private class DescendentOrSelfPathFinder(val parent: PathFinder, val filter: Fil
{ {
if(accept(file)) if(accept(file))
fileSet += file fileSet += file
handleFileDescendent(file, fileSet) handleFileDescendant(file, fileSet)
} }
} }
private def handleFileDescendent(file: File, fileSet: mutable.Set[File]) private def handleFileDescendant(file: File, fileSet: mutable.Set[File])
{ {
handleFile(file, fileSet) handleFile(file, fileSet)
for(childDirectory <- wrapNull(file listFiles DirectoryFilter)) for(childDirectory <- wrapNull(file listFiles DirectoryFilter))
handleFileDescendent(new File(file, childDirectory.getName), fileSet) handleFileDescendant(new File(file, childDirectory.getName), fileSet)
} }
} }
private class ChildPathFinder(val parent: PathFinder, val filter: FileFilter) extends FilterFiles private class ChildPathFinder(val parent: PathFinder, val filter: FileFilter) extends FilterFiles