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"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildFeatures {
|
buildFeatures { compose = true }
|
||||||
compose = true
|
|
||||||
}
|
|
||||||
composeOptions {
|
composeOptions {
|
||||||
useLiveLiterals = false
|
useLiveLiterals = false
|
||||||
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
|
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
|
||||||
|
|
|
@ -23,9 +23,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<KotlinCompile>().configureEach {
|
tasks.withType<KotlinCompile>().configureEach {
|
||||||
compilerOptions {
|
compilerOptions { languageVersion.set(KotlinVersion.KOTLIN_1_7) }
|
||||||
languageVersion.set(KotlinVersion.KOTLIN_1_7)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
|
|
||||||
plugins { `kotlin-dsl` }
|
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)
|
kotlin.jvmToolchain(jvmToolchainAction)
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,7 @@
|
||||||
|
|
||||||
rootProject.name = "build-logic"
|
rootProject.name = "build-logic"
|
||||||
|
|
||||||
plugins {
|
plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0" }
|
||||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
repositories {
|
repositories {
|
||||||
|
|
|
@ -12,7 +12,7 @@ class KtfmtPlugin : Plugin<Project> {
|
||||||
override fun apply(target: Project) {
|
override fun apply(target: Project) {
|
||||||
val input = Callable {
|
val input = Callable {
|
||||||
target.layout.projectDirectory.asFileTree.filter { file ->
|
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) }
|
target.tasks.register<KtfmtFormatTask>("ktfmtFormat") { source(input) }
|
||||||
|
|
Loading…
Reference in a new issue