From d4c05d6d6d7db59980ad5fc01afe7bcf866f6bdc Mon Sep 17 00:00:00 2001 From: arkon Date: Thu, 25 Jun 2020 22:45:45 -0400 Subject: [PATCH] Convert settings.gradle to Kotlin DSL --- settings.gradle | 18 ------------------ settings.gradle.kts | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 18 deletions(-) delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 88fd7b507..000000000 --- a/settings.gradle +++ /dev/null @@ -1,18 +0,0 @@ -include(':annotations') - -include ':lib-ratelimit' -project(':lib-ratelimit').projectDir = new File("lib/ratelimit") - -include ':duktape-stub' -project(':duktape-stub').projectDir = new File("lib/duktape-stub") - -include ':lib-dataimage' -project(':lib-dataimage').projectDir = new File("lib/dataimage") - -new File(rootDir, "src").eachDir { dir -> - dir.eachDir { subdir -> - String name = ":${dir.name}-${subdir.name}" - include name - project(name).projectDir = new File("src/${dir.name}/${subdir.name}") - } -} diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..c39aecb94 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,22 @@ +include(":annotations") + +include(":lib-ratelimit") +project(":lib-ratelimit").projectDir = File("lib/ratelimit") + +include(":duktape-stub") +project(":duktape-stub").projectDir = File("lib/duktape-stub") + +include(":lib-dataimage") +project(":lib-dataimage").projectDir = File("lib/dataimage") + +File(rootDir, "src").eachDir { dir -> + dir.eachDir { subdir -> + val name = ":${dir.name}-${subdir.name}" + include(name) + project(name).projectDir = File("src/${dir.name}/${subdir.name}") + } +} + +inline fun File.eachDir(block: (File) -> Unit) { + listFiles()?.filter { it.isDirectory }?.forEach { block(it) } +}