Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import org.gradle.api.file.FileCollection
import org.gradle.process.CommandLineArgumentProvider

plugins {
alias(libs.plugins.dependencyAnalysis)
alias(libs.plugins.dokka) apply false
alias(libs.plugins.dokka.javadoc) apply false
alias(libs.plugins.intelliJPlatform) apply false
Expand Down Expand Up @@ -58,7 +59,8 @@ val ktfmtFiles =
include("**/*.kt")
include("**/*.kts")
exclude("**/build/**")
exclude("facebook/**")
exclude("**/.gradle/**")
exclude("**/.intellijPlatform/**")
}

class KtfmtArgumentsProvider(
Expand Down Expand Up @@ -97,6 +99,21 @@ val ktfmtFormat =
configureKtfmtRun(ktfmtFiles, check = false)
}

dependencyAnalysis {
issues {
all {
// Compiled by a separate task against a handcrafted classpath
ignoreSourceSet("nativeImageSourceSet")
onUnusedDependencies {
severity("fail")
}
onAny {
severity("warn")
}
}
}
}

subprojects {
tasks.named { it == "check" }.configureEach { dependsOn(rootProject.tasks.named("ktfmtCheck")) }
}
Expand Down
14 changes: 8 additions & 6 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation

plugins {
kotlin("jvm")
alias(libs.plugins.dependencyAnalysis)
alias(libs.plugins.dokka)
alias(libs.plugins.dokka.javadoc)
alias(libs.plugins.shadowJar)
Expand All @@ -37,19 +38,20 @@ repositories {
dependencies {
api(libs.googleJavaformat)
api(libs.guava)
api(libs.jna)
api(libs.kotlin.stdlib)
api(libs.kotlin.compilerEmbeddable)
implementation(libs.ec4j)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
testImplementation(libs.junit.jupiter.api)
testRuntimeOnly(libs.junit.jupiter.engine)
testRuntimeOnly(libs.junit.platform.launcher)
}

val generateSources by tasks.registering {
outputs.dir(layout.buildDirectory.dir("generated/main/java"))
dependsOn(tasks.withType<GenerateKtfmtFileTask>())
}
val generateSources =
tasks.register("generateSources") {
outputs.dir(layout.buildDirectory.dir("generated/main/java"))
dependsOn(tasks.withType<GenerateKtfmtFileTask>())
}

tasks {
// Run tests with UTF-16 encoding
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ktfmt.version=0.65-SNAPSHOT
kotlin.code.style=official
org.gradle.jvmargs=-Xmx2G
org.gradle.configuration-cache=true
9 changes: 5 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ java = "17"
kotlin = "2.3.20"
com-google-googlejavaformat-google-java-format = "1.23.0"
com-google-guava-guava = "33.5.0-jre"
net-java-dev-jna-jna = "4.2.2"
org-ec4j-core = "1.2.0"
org-junit-junit-bom = "6.1.2"

# plugins
gradlePlugin-dependencyAnalysis = "3.18.0"
gradlePlugin-dokka = "2.2.0"
gradlePlugin-intelliJPlatform = "2.6.0"
gradlePlugin-intelliJPlatform = "2.12.0"
gradlePlugin-nexusPublish = "2.0.0"
gradlePlugin-shadowJar = "9.0.2"

Expand All @@ -18,13 +18,14 @@ ec4j = { module = "org.ec4j.core:ec4j-core", version.ref = "org-ec4j-core" }
googleJavaformat = { module = "com.google.googlejavaformat:google-java-format", version.ref = "com-google-googlejavaformat-google-java-format" }
guava = { module = "com.google.guava:guava", version.ref = "com-google-guava-guava" }
junit-bom = { module = "org.junit:junit-bom", version.ref = "org-junit-junit-bom" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter" }
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" }
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" }
jna = { module = "net.java.dev.jna:jna", version.ref = "net-java-dev-jna-jna" }
kotlin-compilerEmbeddable = { module = "org.jetbrains.kotlin:kotlin-compiler-embeddable", version.ref = "kotlin" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }

[plugins]
dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "gradlePlugin-dependencyAnalysis" }
dokka = { id = "org.jetbrains.dokka", version.ref = "gradlePlugin-dokka" }
dokka-javadoc = { id = "org.jetbrains.dokka-javadoc", version.ref = "gradlePlugin-dokka" }
intelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "gradlePlugin-intelliJPlatform" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/native-image.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
org-graalvm = "25.0.1"
graalvmPlugin = "0.11.1"
graalvmPlugin = "1.1.8"
org-jline = "3.30.6"

[libraries]
Expand Down
4 changes: 4 additions & 0 deletions ktfmt_idea_plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.IntellijIdeaC

plugins {
java
alias(libs.plugins.dependencyAnalysis)
alias(libs.plugins.kotlin)
alias(libs.plugins.intelliJPlatform)
}
Expand Down Expand Up @@ -48,6 +49,9 @@ dependencies {
}

implementation(project(":ktfmt"))
implementation(libs.googleJavaformat)
implementation(libs.guava)
implementation(libs.kotlin.compilerEmbeddable)
}

intellijPlatform {
Expand Down
Loading