diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2017-02-26 21:39:12 +0800 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2017-02-26 21:42:27 +0800 |
commit | 623fc52d37dc8c171d1fa2a0bb346265054c4b40 (patch) | |
tree | 88841c588e874246d4a4fcff249b654c57cbefd7 /stage1/Stage1Lib.scala | |
parent | 3277f82d75fd47a951cbf91590fdc823c1281ef9 (diff) | |
download | cbt-623fc52d37dc8c171d1fa2a0bb346265054c4b40.tar.gz cbt-623fc52d37dc8c171d1fa2a0bb346265054c4b40.tar.bz2 cbt-623fc52d37dc8c171d1fa2a0bb346265054c4b40.zip |
make listRecursive a File extension method for brevity
Diffstat (limited to 'stage1/Stage1Lib.scala')
-rw-r--r-- | stage1/Stage1Lib.scala | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/stage1/Stage1Lib.scala b/stage1/Stage1Lib.scala index 7f8f600..c42ee12 100644 --- a/stage1/Stage1Lib.scala +++ b/stage1/Stage1Lib.scala @@ -86,12 +86,6 @@ class Stage1Lib( logger: Logger ) extends BaseLib{ } } - def listFilesRecursive(f: File): Seq[File] = { - f +: ( - if( f.isDirectory ) f.listFiles.flatMap(listFilesRecursive).toVector else Seq[File]() - ) - } - // ========== compilation / execution ========== def runMain( cls: String, args: Seq[String], classLoader: ClassLoader, fakeInstance: Boolean = false ): ExitCode = { @@ -149,7 +143,8 @@ class Stage1Lib( logger: Logger ) extends BaseLib{ /** Given a directory corresponding to the root package, iterate the names of all classes derived from the class files found */ def iterateClassNames( classesRootDirectory: File ): Seq[String] = - listFilesRecursive(classesRootDirectory) + classesRootDirectory + .listRecursive .filter(_.isFile) .map(_.getPath) .collect{ |