diff --git a/build.gradle b/build.gradle index eba7c42..6a821ee 100644 --- a/build.gradle +++ b/build.gradle @@ -5,12 +5,12 @@ plugins { id 'java-gradle-plugin' id 'groovy' id 'maven-publish' - id 'com.gradle.plugin-publish' version '1.0.0' - id "com.diffplug.spotless" version "6.5.0" + id 'com.gradle.plugin-publish' version '1.2.1' + id "com.diffplug.spotless" version "6.25.0" } group 'io.neonbee' -version '0.1.3' +version '0.1.4' repositories { mavenCentral() @@ -18,38 +18,34 @@ repositories { } dependencies { - implementation platform('org.codehaus.groovy:groovy-bom:3.0.10') - implementation 'org.codehaus.groovy:groovy-yaml:3.0.10' + implementation platform('org.apache.groovy:groovy-bom:4.0.19') + implementation 'org.apache.groovy:groovy-yaml:4.0.19' // Module Plugin Dependencies - implementation 'org.ow2.asm:asm:9.2' // https://mvnrepository.com/artifact/org.ow2.asm/asm - implementation 'gradle.plugin.com.github.johnrengelman:shadow:7.1.2' // https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow + implementation 'org.ow2.asm:asm:9.6' // https://mvnrepository.com/artifact/org.ow2.asm/asm + implementation 'gradle.plugin.com.github.johnrengelman:shadow:8.0.0' // https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow // Static Code Checkers Plugin Dependencies - implementation 'com.diffplug.spotless:spotless-plugin-gradle:6.5.0' // https://plugins.gradle.org/plugin/com.diffplug.spotless - implementation 'com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.6' // https://plugins.gradle.org/plugin/com.github.spotbugs - implementation 'gradle.plugin.se.bjurr.violations:violations-gradle-plugin:1.50.16' // https://plugins.gradle.org/plugin/se.bjurr.violations.violations-gradle-plugin + implementation 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0' // https://plugins.gradle.org/plugin/com.diffplug.spotless + implementation 'com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.8' // https://plugins.gradle.org/plugin/com.github.spotbugs + implementation 'gradle.plugin.se.bjurr.violations:violations-gradle-plugin:2.0.0' // https://plugins.gradle.org/plugin/se.bjurr.violations.violations-gradle-plugin implementation "gradle.plugin.com.github.ksoichiro:gradle-console-reporter:0.6.3" // https://plugins.gradle.org/plugin/com.github.ksoichiro.console.reporter - implementation "net.ltgt.gradle:gradle-errorprone-plugin:2.0.2" // https://plugins.gradle.org/plugin/net.ltgt.errorprone + implementation "net.ltgt.gradle:gradle-errorprone-plugin:3.1.0" // https://plugins.gradle.org/plugin/net.ltgt.errorprone // Models Plugin Dependencies - implementation 'com.github.node-gradle:gradle-node-plugin:3.0.1' // https://plugins.gradle.org/plugin/com.github.node-gradle.node + implementation 'com.github.node-gradle:gradle-node-plugin:7.0.2' // https://plugins.gradle.org/plugin/com.github.node-gradle.node } - -pluginBundle { +gradlePlugin { website = 'https://github.com/SAP/neonbee-plugin-kickstart' vcsUrl = 'https://github.com/SAP/neonbee-plugin-kickstart' - tags = ['neonbee', 'kickstart'] -} - -gradlePlugin { plugins { base { id = 'io.neonbee.gradle.kickstart.module' implementationClass = 'io.neonbee.gradle.kickstart.ModulePlugin' displayName = 'NeonBee Kickstart Module Plugin' description = 'NeonBee Kickstart Module Plugin to lower the barrier to entry to explore NeonBee.' + tags.set(['neonbee', 'kickstart']) } models { @@ -57,6 +53,7 @@ gradlePlugin { implementationClass = 'io.neonbee.gradle.kickstart.ModelsPlugin' displayName = 'NeonBee Kickstart Models Plugin' description = 'NeonBee Kickstart Models Plugin to lower the barrier to entry to explore NeonBee.' + tags.set(['neonbee', 'kickstart']) } quality { @@ -64,6 +61,7 @@ gradlePlugin { implementationClass = 'io.neonbee.gradle.kickstart.QualityPlugin' displayName = 'NeonBee Kickstart Quality Plugin' description = 'NeonBee Kickstart Quality Plugin to lower the barrier to entry to explore NeonBee.' + tags.set(['neonbee', 'kickstart']) } application { @@ -71,6 +69,7 @@ gradlePlugin { implementationClass = 'io.neonbee.gradle.kickstart.ApplicationPlugin' displayName = 'NeonBee Kickstart Application Plugin' description = 'NeonBee Kickstart Application Plugin to lower the barrier to entry to explore NeonBee.' + tags.set(['neonbee', 'kickstart']) } } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 05679dc..a595206 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/groovy/io/neonbee/gradle/kickstart/ApplicationExtension.groovy b/src/main/groovy/io/neonbee/gradle/kickstart/ApplicationExtension.groovy index 91b87a9..c49762c 100644 --- a/src/main/groovy/io/neonbee/gradle/kickstart/ApplicationExtension.groovy +++ b/src/main/groovy/io/neonbee/gradle/kickstart/ApplicationExtension.groovy @@ -7,7 +7,7 @@ class ApplicationExtension { String workingDir = 'working_dir' - String neonbeeVersion = '0.10.0' + String neonbeeVersion = '0.34.0' ApplicationExtension(Project project) { } diff --git a/src/main/groovy/io/neonbee/gradle/kickstart/ApplicationPlugin.groovy b/src/main/groovy/io/neonbee/gradle/kickstart/ApplicationPlugin.groovy index 98259ed..ed3dddf 100644 --- a/src/main/groovy/io/neonbee/gradle/kickstart/ApplicationPlugin.groovy +++ b/src/main/groovy/io/neonbee/gradle/kickstart/ApplicationPlugin.groovy @@ -45,7 +45,7 @@ class ApplicationPlugin implements Plugin { } project.configure(project.extensions.getByType(JavaApplication)) { - mainClassName = 'io.neonbee.Launcher' + mainClass = 'io.neonbee.Launcher' } project.tasks.named(TEST_TASK_NAME) { diff --git a/src/main/groovy/io/neonbee/gradle/kickstart/internal/GradleHelper.groovy b/src/main/groovy/io/neonbee/gradle/kickstart/internal/GradleHelper.groovy index 283a625..47a0347 100644 --- a/src/main/groovy/io/neonbee/gradle/kickstart/internal/GradleHelper.groovy +++ b/src/main/groovy/io/neonbee/gradle/kickstart/internal/GradleHelper.groovy @@ -17,6 +17,10 @@ class GradleHelper { project.rootProject == project } + static boolean isModelsProject(Project project) { + project == project.getAllprojects().find {it.projectDir.getName() == 'models'} + } + static Path rootProjectCacheDir(Project project) { project.rootProject.file(".gradle/").toPath() } diff --git a/src/main/groovy/io/neonbee/gradle/kickstart/internal/NodeHelper.groovy b/src/main/groovy/io/neonbee/gradle/kickstart/internal/NodeHelper.groovy index daf0345..a92ee9e 100644 --- a/src/main/groovy/io/neonbee/gradle/kickstart/internal/NodeHelper.groovy +++ b/src/main/groovy/io/neonbee/gradle/kickstart/internal/NodeHelper.groovy @@ -18,12 +18,12 @@ class NodeHelper { // The directory where Node.js is unpacked (when download is true) workDir = cacheDir.resolve('nodejs').toFile() // Version of node to use. - version = '16.16.0' + version = '20.11.1' // The directory where npm is installed (when a specific version is defined) npmWorkDir = cacheDir.resolve( 'npm').toFile() // Version of npm to use. - npmVersion = '8.11.0' + npmVersion = '10.2.4' // The Node.js project directory location // This is where the package.json file and node_modules directory are located diff --git a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/CheckstylePlugin.groovy b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/CheckstylePlugin.groovy index fbd8e76..939defb 100644 --- a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/CheckstylePlugin.groovy +++ b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/CheckstylePlugin.groovy @@ -8,6 +8,7 @@ import java.nio.file.Path import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task +import org.gradle.api.artifacts.Configuration import org.gradle.api.plugins.quality.CheckstyleExtension import org.gradle.api.tasks.SourceSet import org.gradle.api.tasks.TaskProvider @@ -18,11 +19,20 @@ class CheckstylePlugin implements Plugin { private static final String CHECK_STYLE_MAIN_TASK_NAME = 'checkstyleMain' private static final String CHECK_STYLE_TEST_TASK_NAME = 'checkstyleTest' private static final String CHECK_STYLE_CONFIG_DIR = 'gradle/checkstyle' + private static final String CHECK_STYLE_CONFIGURATION_NAME = 'checkstyle'; @Override void apply(Project project) { project.pluginManager.apply(org.gradle.api.plugins.quality.CheckstylePlugin) + Configuration checkstyleConfiguration = project.configurations.maybeCreate(CHECK_STYLE_CONFIGURATION_NAME); + checkstyleConfiguration.resolutionStrategy { + capabilitiesResolution.withCapability("com.google.collections:google-collections") { + select("com.google.guava:guava:0") + } + } + + if (!project.file(CHECK_STYLE_CONFIG_DIR).exists()) { Path targetDir = project.file('gradle').toPath() GradleHelper.copyResourceDir('checkstyle', targetDir) @@ -35,7 +45,7 @@ class CheckstylePlugin implements Plugin { // configure extension project.configure(project.extensions.getByType(CheckstyleExtension)) { ignoreFailures = true - toolVersion = '9.0' + toolVersion = '10.12.7' sourceSets = [mainSourceSet, testSourceSet] configDirectory = project.file(CHECK_STYLE_CONFIG_DIR) } diff --git a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/ConsoleReporterPlugin.groovy b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/ConsoleReporterPlugin.groovy index 7d00bfc..02c942c 100644 --- a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/ConsoleReporterPlugin.groovy +++ b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/ConsoleReporterPlugin.groovy @@ -4,6 +4,7 @@ import org.gradle.api.Plugin import org.gradle.api.Project import com.github.ksoichiro.console.reporter.ConsoleReporterExtension + import io.neonbee.gradle.kickstart.QualityExtension class ConsoleReporterPlugin implements Plugin { diff --git a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/ErrorPronePlugin.groovy b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/ErrorPronePlugin.groovy index b90acd9..28bb920 100644 --- a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/ErrorPronePlugin.groovy +++ b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/ErrorPronePlugin.groovy @@ -13,7 +13,7 @@ class ErrorPronePlugin implements Plugin { void apply(Project project) { project.pluginManager.apply(net.ltgt.gradle.errorprone.ErrorPronePlugin) - def errorProne = [group: 'com.google.errorprone', name: 'error_prone_core', version: '2.10.0'] + def errorProne = [group: 'com.google.errorprone', name: 'error_prone_core', version: '2.24.1'] project.dependencies.add(net.ltgt.gradle.errorprone.ErrorPronePlugin.CONFIGURATION_NAME, errorProne) project.tasks.withType(JavaCompile).configureEach { diff --git a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/JacocoPlugin.groovy b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/JacocoPlugin.groovy index f2e47a0..dbade4f 100644 --- a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/JacocoPlugin.groovy +++ b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/JacocoPlugin.groovy @@ -20,7 +20,7 @@ class JacocoPlugin implements Plugin { project.configure(project.extensions.getByType(JacocoPluginExtension)) { File reportsDirFile = project.file("${project.buildDir}/reports/jacoco") - toolVersion = '0.8.7' // https://github.com/jacoco/jacoco/releases + toolVersion = '0.8.11' // https://github.com/jacoco/jacoco/releases reportsDirectory = reportsDirFile // configure in closure, to still be able to access reportsDirectory diff --git a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/PmdPlugin.groovy b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/PmdPlugin.groovy index dab608a..b617f1c 100644 --- a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/PmdPlugin.groovy +++ b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/PmdPlugin.groovy @@ -39,7 +39,7 @@ class PmdPlugin implements Plugin { ignoreFailures = true sourceSets = [mainSourceSet, testSourceSet] ruleSets = [] - toolVersion = '6.38.0' // https://pmd.github.io/ + toolVersion = '6.55.0' // https://pmd.github.io/ incrementalAnalysis = true // does require gradle 6 } diff --git a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/SpotBugsPlugin.groovy b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/SpotBugsPlugin.groovy index 2ec190f..c104521 100644 --- a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/SpotBugsPlugin.groovy +++ b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/SpotBugsPlugin.groovy @@ -10,7 +10,10 @@ import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.tasks.TaskProvider +import com.github.spotbugs.snom.Confidence +import com.github.spotbugs.snom.Effort import com.github.spotbugs.snom.SpotBugsExtension + import io.neonbee.gradle.kickstart.internal.GradleHelper class SpotBugsPlugin implements Plugin { @@ -31,9 +34,10 @@ class SpotBugsPlugin implements Plugin { // ignore the issues during SpotBugs run, because the violations plugin // will display the issues and let the build fail later. ignoreFailures = true - toolVersion = '4.6.0' // https://github.com/spotbugs/spotbugs/releases - effort = 'max' - reportLevel = 'medium' + toolVersion = '4.8.3' // https://github.com/spotbugs/spotbugs/releases + effort = Effort.valueOf('MAX') + reportLevel = Confidence.valueOf('MEDIUM') + excludeFilter = project.file(SPOT_BUGS_CONFIG_DIR + '/excludeFilter.xml') } TaskProvider spotbugsMain = project.tasks.named(SPOT_BUGS_MAIN_TASK_NAME) { diff --git a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/SpotlessPlugin.groovy b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/SpotlessPlugin.groovy index 970f699..6fd2672 100644 --- a/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/SpotlessPlugin.groovy +++ b/src/main/groovy/io/neonbee/gradle/kickstart/internal/plugins/SpotlessPlugin.groovy @@ -8,6 +8,7 @@ import org.gradle.api.Plugin import org.gradle.api.Project import com.diffplug.gradle.spotless.SpotlessExtension + import io.neonbee.gradle.kickstart.internal.GradleHelper class SpotlessPlugin implements Plugin { diff --git a/src/main/resources/pmd/customRules/AvoidFinalLocalVariables/TestCases.xml b/src/main/resources/pmd/customRules/AvoidFinalLocalVariables/TestCases.xml index f3dcc27..1b49ca5 100644 --- a/src/main/resources/pmd/customRules/AvoidFinalLocalVariables/TestCases.xml +++ b/src/main/resources/pmd/customRules/AvoidFinalLocalVariables/TestCases.xml @@ -1,11 +1,11 @@ - - Avoid final for local variables - 0 - + + Avoid final for local variables + 0 + - java 11 - + java 17 + \ No newline at end of file diff --git a/src/main/resources/pmd/customRules/AvoidUnnecessaryTestClassesModifier/TestCases.xml b/src/main/resources/pmd/customRules/AvoidUnnecessaryTestClassesModifier/TestCases.xml index 786c12f..d9db984 100644 --- a/src/main/resources/pmd/customRules/AvoidUnnecessaryTestClassesModifier/TestCases.xml +++ b/src/main/resources/pmd/customRules/AvoidUnnecessaryTestClassesModifier/TestCases.xml @@ -1,11 +1,11 @@ - - Avoid public, protected or private modifier for test classes - 0 - + + Avoid public, protected or private modifier for test classes + 0 + - java 11 - + java 17 + \ No newline at end of file diff --git a/src/main/resources/pmd/customRules/AvoidUnnecessaryTestClassesModifier/rule.xml b/src/main/resources/pmd/customRules/AvoidUnnecessaryTestClassesModifier/rule.xml index 3e34209..501574a 100644 --- a/src/main/resources/pmd/customRules/AvoidUnnecessaryTestClassesModifier/rule.xml +++ b/src/main/resources/pmd/customRules/AvoidUnnecessaryTestClassesModifier/rule.xml @@ -1,14 +1,14 @@ + language="java" + minimumLanguageVersion="17" + message="Avoid public, protected or private modifier for test classes" + class="net.sourceforge.pmd.lang.rule.XPathRule"> Avoid public, protected or private modifier for test classes. There is no benefit. 1 - + - - + \ No newline at end of file diff --git a/src/main/resources/pmd/customRules/AvoidUnnecessaryTestMethodsModifier/Testcases.xml b/src/main/resources/pmd/customRules/AvoidUnnecessaryTestMethodsModifier/Testcases.xml index d27222a..25933e1 100644 --- a/src/main/resources/pmd/customRules/AvoidUnnecessaryTestMethodsModifier/Testcases.xml +++ b/src/main/resources/pmd/customRules/AvoidUnnecessaryTestMethodsModifier/Testcases.xml @@ -1,16 +1,16 @@ - - Avoid public, protected or private modifier for test methods - 0 - + + Avoid public, protected or private modifier for test methods + 0 + - java 11 - + java 17 + \ No newline at end of file diff --git a/src/main/resources/pmd/customRules/AvoidUnnecessaryTestMethodsModifier/rule.xml b/src/main/resources/pmd/customRules/AvoidUnnecessaryTestMethodsModifier/rule.xml index decdad3..3e8ed97 100644 --- a/src/main/resources/pmd/customRules/AvoidUnnecessaryTestMethodsModifier/rule.xml +++ b/src/main/resources/pmd/customRules/AvoidUnnecessaryTestMethodsModifier/rule.xml @@ -1,14 +1,14 @@ + language="java" + minimumLanguageVersion="17" + message="Avoid public, protected or private modifier for test methods" + class="net.sourceforge.pmd.lang.rule.XPathRule"> Avoid public, protected or private modifier for test methods. There is no benefit. 1 - + - - + \ No newline at end of file diff --git a/src/main/resources/pmd/customRuleset.xml b/src/main/resources/pmd/customRuleset.xml index 82c8315..eb8a3c2 100644 --- a/src/main/resources/pmd/customRuleset.xml +++ b/src/main/resources/pmd/customRuleset.xml @@ -7,59 +7,59 @@ NeonBee PMD Custom Rules - + language="java" + minimumLanguageVersion="1.8" + message="Avoid final when declaring local variables" + class="net.sourceforge.pmd.lang.rule.XPathRule"> + Avoid final when declaring local variables. There is no benefit. See NeonBee community conventions. - 1 - - - - + 1 + + + + - - + + + language="java" + minimumLanguageVersion="1.8" + message="Avoid final in formal Parameters" + class="net.sourceforge.pmd.lang.rule.XPathRule"> Avoid final in formal Parameters 1 - + - - + + + language="java" + minimumLanguageVersion="17" + message="Avoid public, protected or private modifier for test methods" + class="net.sourceforge.pmd.lang.rule.XPathRule"> Avoid public, protected or private modifier for test methods. There is no benefit. 1 - + + language="java" + minimumLanguageVersion="17" + message="Avoid public, protected or private modifier for test classes" + class="net.sourceforge.pmd.lang.rule.XPathRule"> Avoid public, protected or private modifier for test classes. There is no benefit. 1 - + - + \ No newline at end of file diff --git a/src/main/resources/pmd/rulesetMain.xml b/src/main/resources/pmd/rulesetMain.xml index 654dc3f..e585f9c 100644 --- a/src/main/resources/pmd/rulesetMain.xml +++ b/src/main/resources/pmd/rulesetMain.xml @@ -1,7 +1,9 @@ - + NeonBee PMD Rules @@ -68,11 +70,15 @@ - + + + + @@ -100,13 +106,11 @@ - - @@ -211,15 +215,6 @@ - - - - - - - - - @@ -262,7 +257,6 @@ - @@ -325,7 +319,8 @@ - + diff --git a/src/main/resources/pmd/rulesetTest.xml b/src/main/resources/pmd/rulesetTest.xml index dadbd83..c43f57b 100644 --- a/src/main/resources/pmd/rulesetTest.xml +++ b/src/main/resources/pmd/rulesetTest.xml @@ -1,7 +1,9 @@ - + NeonBee PMD Rules @@ -57,7 +59,8 @@ - + + + @@ -100,13 +107,11 @@ - - @@ -211,15 +216,6 @@ - - - - - - - - - @@ -262,7 +258,13 @@ - + + + + + + @@ -325,7 +327,8 @@ - + diff --git a/src/main/resources/spotless/eclipse-formatter.xml b/src/main/resources/spotless/eclipse-formatter.xml index 1988bc1..3b6873f 100644 --- a/src/main/resources/spotless/eclipse-formatter.xml +++ b/src/main/resources/spotless/eclipse-formatter.xml @@ -169,7 +169,7 @@ - +