summaryrefslogtreecommitdiff
path: root/build-logic/kotlin-plugins/build.gradle.kts
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2022-10-29 07:29:46 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2022-10-29 08:00:28 +0530
commitfd20480f554060805acba3124cb251be7824c4d2 (patch)
tree5632081000dd955d51c04397733b0faeabd16b04 /build-logic/kotlin-plugins/build.gradle.kts
parent505c2fa705fca1aaec7aae80c50a939bfd607716 (diff)
feat(build): add a homebrew ktfmt plugin
The general idea of the implementation is borrowed from https://github.com/cortinico/ktfmt-gradle
Diffstat (limited to 'build-logic/kotlin-plugins/build.gradle.kts')
-rw-r--r--build-logic/kotlin-plugins/build.gradle.kts9
1 files changed, 8 insertions, 1 deletions
diff --git a/build-logic/kotlin-plugins/build.gradle.kts b/build-logic/kotlin-plugins/build.gradle.kts
index fc08cd15..815d6ca0 100644
--- a/build-logic/kotlin-plugins/build.gradle.kts
+++ b/build-logic/kotlin-plugins/build.gradle.kts
@@ -20,7 +20,7 @@ afterEvaluate {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
- freeCompilerArgs = freeCompilerArgs + "-Xsam-conversions=class"
+ freeCompilerArgs = freeCompilerArgs + "-Xsam-conversions=class" + "-opt-in=kotlin.RequiresOptIn"
}
}
}
@@ -43,6 +43,10 @@ gradlePlugin {
id = "com.github.android-password-store.kotlin-library"
implementationClass = "app.passwordstore.gradle.KotlinLibraryPlugin"
}
+ register("ktfmt") {
+ id = "com.github.android-password-store.ktfmt"
+ implementationClass = "app.passwordstore.gradle.KtfmtPlugin"
+ }
register("spotless") {
id = "com.github.android-password-store.spotless"
implementationClass = "app.passwordstore.gradle.SpotlessPlugin"
@@ -57,9 +61,12 @@ gradlePlugin {
dependencies {
implementation(libs.build.agp)
implementation(libs.build.detekt)
+ implementation(libs.build.diffutils)
implementation(libs.build.kotlin)
+ implementation(libs.build.ktfmt)
implementation(libs.build.r8)
implementation(libs.build.spotless)
implementation(libs.build.vcu)
implementation(libs.build.versions)
+ implementation(libs.kotlin.coroutines.core)
}