|
|
|
@ -8,12 +8,12 @@ data class SnippetData(
|
|
|
|
|
fun findSnippets(dirs: List<String>): List<SnippetData> { |
|
|
|
|
val snippets = mutableListOf<SnippetData>() |
|
|
|
|
dirs.forEach { dirName -> |
|
|
|
|
rootProject |
|
|
|
|
val dir = rootProject |
|
|
|
|
.projectDir |
|
|
|
|
.parentFile |
|
|
|
|
.resolve(dirName) |
|
|
|
|
.listFiles() |
|
|
|
|
.filter { it.name.endsWith(".md") } |
|
|
|
|
.listFiles()?.let { |
|
|
|
|
it.filter { it.name.endsWith(".md") } |
|
|
|
|
.forEach { file -> |
|
|
|
|
val currentSnippet = kotlin.text.StringBuilder() |
|
|
|
|
var snippetStart = 0 |
|
|
|
@ -34,6 +34,7 @@ fun findSnippets(dirs: List<String>): List<SnippetData> {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return snippets |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -78,13 +79,17 @@ fun checkDirs(dirs: List<String>) {
|
|
|
|
|
// with whitespace marks code that shall not be checked. |
|
|
|
|
tasks.register("check") { |
|
|
|
|
doLast { |
|
|
|
|
val dirs = project |
|
|
|
|
for (dir in listOf(".", "Web")) { |
|
|
|
|
val subdirs = project |
|
|
|
|
.projectDir |
|
|
|
|
.parentFile |
|
|
|
|
.resolve(dir) |
|
|
|
|
.listFiles() |
|
|
|
|
.filter { |
|
|
|
|
it.isDirectory && it.name[0].isUpperCase() } |
|
|
|
|
it.isDirectory && it.name[0].isUpperCase() |
|
|
|
|
} |
|
|
|
|
.map { it.name } |
|
|
|
|
checkDirs(dirs) |
|
|
|
|
checkDirs(subdirs.map { "$dir/$it" }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|