Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate code to Kotlin #242

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
32 changes: 27 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
plugins {
id("java")
kotlin("jvm") version "1.5.31"
id("application")
id("com.github.johnrengelman.shadow") version "7.0.0"
id("checkstyle")
id("com.github.vlsi.gradle-extensions") version "1.74"
id("com.github.autostyle") version "3.1"
}

group = "com.github.vlsi.ksar"
Expand Down Expand Up @@ -43,6 +44,31 @@ tasks.withType<Test>().configureEach {
useJUnitPlatform()
}

autostyle {
kotlinGradle {
ktlint("0.40.0") {
userData(mapOf("disabled_rules" to "no-wildcard-imports,import-ordering"))
}
trimTrailingWhitespace()
endWithNewline()
}
}
plugins.withId("org.jetbrains.kotlin.jvm") {
autostyle {
kotlin {
trimTrailingWhitespace()
// Generated build/generated-sources/licenses/com/github/vlsi/gradle/license/api/License.kt
// has wrong indentation, and it is not clear how to exclude it
ktlint("0.40.0") {
userData(mapOf("disabled_rules" to "no-wildcard-imports,import-ordering"))
}
// It prints errors regarding build/generated-sources/licenses/com/github/vlsi/gradle/license/api/License.kt
// so comment it for now :(
endWithNewline()
}
}
}

val writeVersion by tasks.registering {
val outDir = project.layout.buildDirectory.dir("generated/version")
val versionText = version.toString()
Expand All @@ -58,10 +84,6 @@ val writeVersion by tasks.registering {

sourceSets.main.get().resources.srcDir(writeVersion)

checkstyle {
config = project.resources.text.fromFile("src/main/checkstyle/ksar-checks.xml", "UTF-8")
}

tasks.jar {
manifest {
attributes(
Expand Down
327 changes: 0 additions & 327 deletions src/main/checkstyle/google-checks.xml

This file was deleted.

263 changes: 0 additions & 263 deletions src/main/checkstyle/ksar-checks.xml

This file was deleted.

Loading