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
|
@ -29,9 +29,7 @@ android {
|
|||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
}
|
||||
buildFeatures { compose = true }
|
||||
composeOptions {
|
||||
useLiveLiterals = false
|
||||
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
|
||||
|
|
|
@ -23,9 +23,7 @@ android {
|
|||
}
|
||||
|
||||
tasks.withType<KotlinCompile>().configureEach {
|
||||
compilerOptions {
|
||||
languageVersion.set(KotlinVersion.KOTLIN_1_7)
|
||||
}
|
||||
compilerOptions { languageVersion.set(KotlinVersion.KOTLIN_1_7) }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
|
|
@ -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…
Reference in a new issue