Skip to content

Commit

Permalink
feat!: bump Java to 21, Gradle to 8.5 and libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
pk-work committed Mar 15, 2024
1 parent 1f4b8c5 commit ee75def
Show file tree
Hide file tree
Showing 22 changed files with 146 additions and 144 deletions.
35 changes: 17 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,71 @@ 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()
gradlePluginPortal()
}

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 {
id = 'io.neonbee.gradle.kickstart.models'
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 {
id = 'io.neonbee.gradle.kickstart.quality'
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 {
id = 'io.neonbee.gradle.kickstart.application'
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'])
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ApplicationExtension {

String workingDir = 'working_dir'

String neonbeeVersion = '0.10.0'
String neonbeeVersion = '0.34.0'

ApplicationExtension(Project project) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ApplicationPlugin implements Plugin<Project> {
}

project.configure(project.extensions.getByType(JavaApplication)) {
mainClassName = 'io.neonbee.Launcher'
mainClass = 'io.neonbee.Launcher'
}

project.tasks.named(TEST_TASK_NAME) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,11 +19,20 @@ class CheckstylePlugin implements Plugin<Project> {
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)
Expand All @@ -35,7 +45,7 @@ class CheckstylePlugin implements Plugin<Project> {
// 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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Project> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ErrorPronePlugin implements Plugin<Project> {
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class JacocoPlugin implements Plugin<Project> {
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PmdPlugin implements Plugin<Project> {
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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Project> {
Expand All @@ -31,9 +34,10 @@ class SpotBugsPlugin implements Plugin<Project> {
// 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<Task> spotbugsMain = project.tasks.named(SPOT_BUGS_MAIN_TASK_NAME) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Project> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data xmlns="http://pmd.sourceforge.net/rule-tests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
<test-code>
<description>Avoid final for local variables</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
<test-code>
<description>Avoid final for local variables</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Foo {
public void bar() {
Expand All @@ -14,7 +14,7 @@ public class Foo {
}
]]></code>
<source-type>java 11</source-type>
</test-code>
<source-type>java 17</source-type>
</test-code>

</test-data>
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data xmlns="http://pmd.sourceforge.net/rule-tests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
<test-code>
<description>Avoid public, protected or private modifier for test classes</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
<test-code>
<description>Avoid public, protected or private modifier for test classes</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Foo {
private static class TestJobVerticle {
Expand Down Expand Up @@ -44,7 +44,7 @@ class Foo4 {
}
}
]]></code>
<source-type>java 11</source-type>
</test-code>
<source-type>java 17</source-type>
</test-code>

</test-data>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<rule name="AvoidUnnecessaryTestClassesModifier"
language="java"
minimumLanguageVersion="11"
message="Avoid public, protected or private modifier for test classes"
class="net.sourceforge.pmd.lang.rule.XPathRule">
language="java"
minimumLanguageVersion="17"
message="Avoid public, protected or private modifier for test classes"
class="net.sourceforge.pmd.lang.rule.XPathRule">
<description>
Avoid public, protected or private modifier for test classes. There is no benefit.
</description>
<priority>1</priority>
<properties>
<property name="version" value="2.0"/>
<property name="version" value="2.0" />
<property name="xpath">
<value>
<![CDATA[
Expand All @@ -18,5 +18,4 @@
</value>
</property>
</properties>
</rule>

</rule>
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data xmlns="http://pmd.sourceforge.net/rule-tests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
<test-code>
<description>Avoid public, protected or private modifier for test methods</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
<test-code>
<description>Avoid public, protected or private modifier for test methods</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
class Foo {
@Test
public void bar() {
}
@Test
private void foo() {
}
Expand All @@ -22,22 +22,9 @@ class Foo {
@Test
protected void foobar() {
}
static class TestPreProcessor implements LauncherPreProcessor {
private boolean preProcessorExecuted;
@Override
public void execute(NeonBeeOptions options) {
this.preProcessorExecuted = true;
}
public boolean isPreProcessorExecuted() {
return preProcessorExecuted;
}
}
}
]]></code>
<source-type>java 11</source-type>
</test-code>
<source-type>java 17</source-type>
</test-code>

</test-data>
Loading

0 comments on commit ee75def

Please sign in to comment.