Skip to content

Commit

Permalink
Merge pull request #102 from melezov/allow-folders-and-files
Browse files Browse the repository at this point in the history
Make dslSources allow both folders and standalone .dsl and .ddd files
  • Loading branch information
zapov authored Feb 16, 2019
2 parents 0759465 + 886a369 commit 471750f
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,10 @@ object SbtDslPlatformPlugin extends AutoPlugin {
}.toSet
}

def recursiveListFiles(f: File): Array[File] = {
val files = f.listFiles
files.filter(it => it.getName.endsWith(".dsl") || it.getName.endsWith(".ddd")) ++
files.filter(_.isDirectory).flatMap(recursiveListFiles)
}
// Index only *.dsl files
// Index only *.dsl and *.ddd files
val dslPathFiles = dslDslPath
.value
.filter(_.exists())
.flatMap(recursiveListFiles)
.flatMap(path => (path ** ("*.dsl" || "*.ddd")).get)
.toSet

logger.info(s"Found ${dslPathFiles.size} DSL files")
Expand Down

0 comments on commit 471750f

Please sign in to comment.