fix(build): adjust ktfmt path filtering to allow formatting build.gradle.kts files
This commit is contained in:
parent
053eb4e883
commit
f583939635
5 changed files with 6 additions and 11 deletions
|
@ -5,7 +5,8 @@
|
|||
|
||||
plugins { `kotlin-dsl` }
|
||||
|
||||
private val jvmToolchainAction = Action<JavaToolchainSpec> { languageVersion.set(JavaLanguageVersion.of(17)) }
|
||||
private val jvmToolchainAction =
|
||||
Action<JavaToolchainSpec> { languageVersion.set(JavaLanguageVersion.of(17)) }
|
||||
|
||||
kotlin.jvmToolchain(jvmToolchainAction)
|
||||
|
||||
|
|
|
@ -6,9 +6,7 @@
|
|||
|
||||
rootProject.name = "build-logic"
|
||||
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
|
||||
}
|
||||
plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0" }
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
|
|
|
@ -12,7 +12,7 @@ class KtfmtPlugin : Plugin<Project> {
|
|||
override fun apply(target: Project) {
|
||||
val input = Callable {
|
||||
target.layout.projectDirectory.asFileTree.filter { file ->
|
||||
file.extension == "kt" || file.extension == "kts" && !file.canonicalPath.contains("build")
|
||||
file.extension == "kt" || file.extension == "kts" && !file.canonicalPath.contains("build/")
|
||||
}
|
||||
}
|
||||
target.tasks.register<KtfmtFormatTask>("ktfmtFormat") { source(input) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue