From aacce0dc7da1057dfc67daf2268030b9d63547bc Mon Sep 17 00:00:00 2001 From: Jamie Shiell Date: Thu, 8 Aug 2024 15:31:33 +0100 Subject: [PATCH] Convert gradle plugin build file to Kotlin DSL --- buildSrc/build.gradle | 46 --------------------------------------- buildSrc/build.gradle.kts | 34 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 46 deletions(-) delete mode 100644 buildSrc/build.gradle create mode 100644 buildSrc/build.gradle.kts diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle deleted file mode 100644 index c1778991..00000000 --- a/buildSrc/build.gradle +++ /dev/null @@ -1,46 +0,0 @@ -plugins { - id 'java-gradle-plugin' -} - -repositories { - mavenCentral() -} - - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// Dependencies -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -dependencies { - implementation group: 'commons-io', name: 'commons-io', version: '2.11.0' - testImplementation group: 'junit', name: 'junit', version: '4.12' -} - - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// Compilation -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 -} - -tasks.withType(JavaCompile).configureEach { - options.encoding = 'UTF-8' - options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation' -} - - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// Plugin Metadata -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -gradlePlugin { - plugins { - simplePlugin { - id = 'org.infernus.idea.checkstyle.build' - implementationClass = 'org.infernus.idea.checkstyle.build.GradlePluginMain' - } - } -} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 00000000..cde12709 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,34 @@ +plugins { + id("java-gradle-plugin") +} + +repositories { + mavenCentral() +} + +dependencies { + implementation("commons-io:commons-io:2.11.0") + testImplementation("junit:junit:4.12") +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} + +tasks.withType { + options.encoding = "UTF-8" + options.compilerArgs.addAll(listOf("-Xlint:unchecked", "-Xlint:deprecation")) +} + +gradlePlugin { + plugins { + create("simplePlugin") { + id = "org.infernus.idea.checkstyle.build" + implementationClass = "org.infernus.idea.checkstyle.build.GradlePluginMain" + } + } +}