diff --git a/theodolite-benchmarks/application-kafkastreams-commons/build.gradle b/theodolite-benchmarks/application-kafkastreams-commons/build.gradle index c1ce7502eddd48c7fb50f754012334e01823a3c6..01daacba94e6be67a43767fd663b8089a6b965bc 100644 --- a/theodolite-benchmarks/application-kafkastreams-commons/build.gradle +++ b/theodolite-benchmarks/application-kafkastreams-commons/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'theodolite.java-commons' +} + dependencies { // These dependencies are used internally, and not exposed to consumers on their own compile classpath. // implementation 'org.slf4j:slf4j-simple:1.7.25' @@ -7,4 +11,4 @@ dependencies { // Use JUnit test framework testImplementation 'junit:junit:4.12' - } \ No newline at end of file +} diff --git a/theodolite-benchmarks/build.gradle b/theodolite-benchmarks/build.gradle index 01085ba4fea6cc30df480186ddcdcab38e21c66a..3395dcf80a26588287fd80b597fe24e0916c0002 100644 --- a/theodolite-benchmarks/build.gradle +++ b/theodolite-benchmarks/build.gradle @@ -6,7 +6,6 @@ buildscript { } } dependencies { - classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.6.0" classpath "com.github.jengelman.gradle.plugins:shadow:6.0.0" } } @@ -23,10 +22,7 @@ allprojects { } subprojects { - apply plugin: 'checkstyle' - apply plugin: 'pmd' - apply plugin: 'com.github.spotbugs' - apply plugin: 'java-library' + apply plugin: 'theodolite.java-conventions' } configure(useCaseProjects){ @@ -38,14 +34,6 @@ configure(useCaseApplicationsFlink){ applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"] } -// Java version for all subprojects -subprojects { - java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } -} - // Check for updates every build configurations.all { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' @@ -117,7 +105,7 @@ configure(useCaseApplicationsFlink) { // Use JUnit test framework testImplementation 'junit:junit:4.12' } - + run.classpath = sourceSets.main.runtimeClasspath jar { @@ -149,69 +137,6 @@ configure(useCaseGenerators) { } } -// Per default XML reports for SpotBugs are generated -// Include this to generate HTML reports -tasks.withType(com.github.spotbugs.snom.SpotBugsTask) { - reports { - // Either HTML or XML reports can be activated - html.enabled true - xml.enabled false - } -} - -// Subprojects quality tools tasks -subprojects { - task pmd { - group 'Quality Assurance' - description 'Run PMD' - - dependsOn 'pmdMain' - dependsOn 'pmdTest' - } - - task checkstyle { - group 'Quality Assurance' - description 'Run Checkstyle' - - dependsOn 'checkstyleMain' - dependsOn 'checkstyleTest' - } - - task spotbugs { - group 'Quality Assurance' - description 'Run SpotBugs' - - dependsOn 'spotbugsMain' - dependsOn 'spotbugsTest' - } -} - -// Subprojects quality tools configuration -subprojects { - pmd { - ruleSets = [] // Gradle requires to clean the rule sets first - ruleSetFiles = files("$rootProject.projectDir/config/pmd.xml") - ignoreFailures = false - toolVersion = "6.7.0" - } - - checkstyle { - configDirectory = file("$rootProject.projectDir/config") - configFile = file("$rootProject.projectDir/config/checkstyle.xml") - maxWarnings = 0 - ignoreFailures = false - toolVersion = "8.12" - } - - spotbugs { - excludeFilter = file("$rootProject.projectDir/config/spotbugs-exclude-filter.xml") - reportLevel = "low" - effort = "max" - ignoreFailures = false - toolVersion = '4.1.4' - } -} - allprojects { eclipse { classpath { diff --git a/theodolite-benchmarks/buildSrc/build.gradle b/theodolite-benchmarks/buildSrc/build.gradle index 678405245982197adc6506cdc8a6b728cfc12fbc..7abe60a90e3605163da5b00eade04de915664fa4 100644 --- a/theodolite-benchmarks/buildSrc/build.gradle +++ b/theodolite-benchmarks/buildSrc/build.gradle @@ -1,3 +1,11 @@ plugins { id 'groovy-gradle-plugin' } + +repositories { + gradlePluginPortal() // so that external plugins can be resolved in dependencies section +} + +dependencies { + implementation 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.6.0' +} diff --git a/theodolite-benchmarks/buildSrc/src/main/groovy/theodolite.java-commons.gradle b/theodolite-benchmarks/buildSrc/src/main/groovy/theodolite.java-commons.gradle new file mode 100644 index 0000000000000000000000000000000000000000..f195d6e117d29cad7a6d7494835626f92fb1c2b0 --- /dev/null +++ b/theodolite-benchmarks/buildSrc/src/main/groovy/theodolite.java-commons.gradle @@ -0,0 +1,7 @@ +plugins { + // common java conventions + id 'theodolite.java-conventions' + + // provide library capability in commons + id 'java-library' +} diff --git a/theodolite-benchmarks/buildSrc/src/main/groovy/theodolite.java-conventions.gradle b/theodolite-benchmarks/buildSrc/src/main/groovy/theodolite.java-conventions.gradle index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..773872648edfd4b30218a99d307b6e7c45ed3470 100644 --- a/theodolite-benchmarks/buildSrc/src/main/groovy/theodolite.java-conventions.gradle +++ b/theodolite-benchmarks/buildSrc/src/main/groovy/theodolite.java-conventions.gradle @@ -0,0 +1,70 @@ +plugins { + id 'java' + id 'checkstyle' + id 'pmd' + + // NOTE: external plugin version is specified in implementation dependency artifact of the project's build file + id 'com.github.spotbugs' +} + +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +// Per default XML reports for SpotBugs are generated +// Include this to generate HTML reports +tasks.withType(com.github.spotbugs.snom.SpotBugsTask) { + reports { + // Either HTML or XML reports can be activated + html.enabled true + xml.enabled false + } +} + +task pmd { + group 'Quality Assurance' + description 'Run PMD' + + dependsOn 'pmdMain' + dependsOn 'pmdTest' +} + +task checkstyle { + group 'Quality Assurance' + description 'Run Checkstyle' + + dependsOn 'checkstyleMain' + dependsOn 'checkstyleTest' +} + +task spotbugs { + group 'Quality Assurance' + description 'Run SpotBugs' + + dependsOn 'spotbugsMain' + dependsOn 'spotbugsTest' +} + +pmd { + ruleSets = [] // Gradle requires to clean the rule sets first + ruleSetFiles = files("$rootProject.projectDir/config/pmd.xml") + ignoreFailures = false + toolVersion = "6.7.0" +} + +checkstyle { + configDirectory = file("$rootProject.projectDir/config") + configFile = file("$rootProject.projectDir/config/checkstyle.xml") + maxWarnings = 0 + ignoreFailures = false + toolVersion = "8.12" +} + +spotbugs { + excludeFilter = file("$rootProject.projectDir/config/spotbugs-exclude-filter.xml") + reportLevel = "low" + effort = "max" + ignoreFailures = false + toolVersion = '4.1.4' +} diff --git a/theodolite-benchmarks/buildSrc/src/main/groovy/theodolite.java-uc.gradle b/theodolite-benchmarks/buildSrc/src/main/groovy/theodolite.java-uc.gradle new file mode 100644 index 0000000000000000000000000000000000000000..b182c9d7f56d7d6df4b95e0fa4b449b101c6c5cd --- /dev/null +++ b/theodolite-benchmarks/buildSrc/src/main/groovy/theodolite.java-uc.gradle @@ -0,0 +1,7 @@ +plugins { + // common java conventions + id 'theodolite.java-conventions' + + // make executable + id 'application' +} diff --git a/theodolite-benchmarks/flink-commons/build.gradle b/theodolite-benchmarks/flink-commons/build.gradle index 26b3a68ff550d9246ce03c6db7471f739c63f0dc..a1f048b67da5b21a48c9d00951f6033a28ddd448 100644 --- a/theodolite-benchmarks/flink-commons/build.gradle +++ b/theodolite-benchmarks/flink-commons/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'theodolite.java-commons' +} + ext { flinkVersion = '1.12.0' scalaBinaryVersion = '2.12' @@ -10,7 +14,7 @@ dependencies { implementation 'com.google.guava:guava:30.1-jre' compile group: 'org.apache.flink', name: "flink-connector-kafka_${scalaBinaryVersion}", version: "${flinkVersion}" compile group: 'org.apache.flink', name: 'flink-java', version: "${flinkVersion}" - + // Use JUnit test framework testImplementation 'junit:junit:4.12' - } \ No newline at end of file + } diff --git a/theodolite-benchmarks/uc1-application-flink/build.gradle b/theodolite-benchmarks/uc1-application-flink/build.gradle index 8b8552dbc0c116a0987dbdfe874ca3111c8f11b9..5626314b03684a458ffc91027595d0298a30b0b5 100644 --- a/theodolite-benchmarks/uc1-application-flink/build.gradle +++ b/theodolite-benchmarks/uc1-application-flink/build.gradle @@ -1 +1,5 @@ +plugins { + id 'theodolite.java-uc' +} + mainClassName = "theodolite.uc1.application.HistoryServiceFlinkJob" diff --git a/theodolite-benchmarks/uc1-application/build.gradle b/theodolite-benchmarks/uc1-application/build.gradle index 3b197e85116f41dde5574d9253d60e1146fe44a2..c13b8962726296230ff0fdb7ec104263839d0fae 100644 --- a/theodolite-benchmarks/uc1-application/build.gradle +++ b/theodolite-benchmarks/uc1-application/build.gradle @@ -1 +1,5 @@ +plugins { + id 'theodolite.java-uc' +} + mainClassName = "theodolite.uc1.application.HistoryService" diff --git a/theodolite-benchmarks/uc1-workload-generator/build.gradle b/theodolite-benchmarks/uc1-workload-generator/build.gradle index 9cc0bdbf01032efa3b251db06a2837cc9b920675..490dbb66314f6b76eb954865ef17a8c0810b6eb4 100644 --- a/theodolite-benchmarks/uc1-workload-generator/build.gradle +++ b/theodolite-benchmarks/uc1-workload-generator/build.gradle @@ -1 +1,5 @@ +plugins { + id 'theodolite.java-uc' +} + mainClassName = "theodolite.uc1.workloadgenerator.LoadGenerator" diff --git a/theodolite-benchmarks/uc2-application-flink/build.gradle b/theodolite-benchmarks/uc2-application-flink/build.gradle index b5e847553db8f3847d5fe858c76b31520f728aff..173c3ceacc79f7a8b8a2ace51fcf24b8d8b025fe 100644 --- a/theodolite-benchmarks/uc2-application-flink/build.gradle +++ b/theodolite-benchmarks/uc2-application-flink/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'theodolite.java-uc' +} + allprojects { repositories { maven { diff --git a/theodolite-benchmarks/uc2-application/build.gradle b/theodolite-benchmarks/uc2-application/build.gradle index e4d3f5346e401def9c9a5a49820d0682eafb0ad3..9195550317150f8890a10ecf8e0fd5e61d0ad153 100644 --- a/theodolite-benchmarks/uc2-application/build.gradle +++ b/theodolite-benchmarks/uc2-application/build.gradle @@ -1 +1,5 @@ +plugins { + id 'theodolite.java-uc' +} + mainClassName = "theodolite.uc2.application.HistoryService" diff --git a/theodolite-benchmarks/uc2-workload-generator/build.gradle b/theodolite-benchmarks/uc2-workload-generator/build.gradle index f2c3e5d2e73b655dffd94222ecfbc4fc31b7f722..498e05fc87a0b4eb41f6f1f6dba1f647d6519f91 100644 --- a/theodolite-benchmarks/uc2-workload-generator/build.gradle +++ b/theodolite-benchmarks/uc2-workload-generator/build.gradle @@ -1 +1,5 @@ +plugins { + id 'theodolite.java-uc' +} + mainClassName = "theodolite.uc2.workloadgenerator.LoadGenerator" diff --git a/theodolite-benchmarks/uc3-application-flink/build.gradle b/theodolite-benchmarks/uc3-application-flink/build.gradle index d50fa8efecd9b17e387d00c71934b8cc144240a1..a1ed6ba07d7d3d277a4879d118253dea311b3293 100644 --- a/theodolite-benchmarks/uc3-application-flink/build.gradle +++ b/theodolite-benchmarks/uc3-application-flink/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'theodolite.java-uc' +} + allprojects { repositories { maven { diff --git a/theodolite-benchmarks/uc3-application/build.gradle b/theodolite-benchmarks/uc3-application/build.gradle index aa96b6dbf90c4895dfda57a51c753c9103c29414..ee4917278689e9dfa1848d24f8c6dc9d0c082c43 100644 --- a/theodolite-benchmarks/uc3-application/build.gradle +++ b/theodolite-benchmarks/uc3-application/build.gradle @@ -1 +1,5 @@ +plugins { + id 'theodolite.java-uc' +} + mainClassName = "theodolite.uc3.application.HistoryService" diff --git a/theodolite-benchmarks/uc3-workload-generator/build.gradle b/theodolite-benchmarks/uc3-workload-generator/build.gradle index c3ca94290c8600d8482210362666efc1249b8f02..22103aaf28e60d276d98d946613e7f74b52ecc0e 100644 --- a/theodolite-benchmarks/uc3-workload-generator/build.gradle +++ b/theodolite-benchmarks/uc3-workload-generator/build.gradle @@ -1 +1,5 @@ +plugins { + id 'theodolite.java-uc' +} + mainClassName = "theodolite.uc3.workloadgenerator.LoadGenerator" diff --git a/theodolite-benchmarks/uc4-application-flink/build.gradle b/theodolite-benchmarks/uc4-application-flink/build.gradle index 0ad804c62566aff81d05f71a874f52c09be4ebcb..9ef66cb39de68032c478a4455ac8544d0ed25452 100644 --- a/theodolite-benchmarks/uc4-application-flink/build.gradle +++ b/theodolite-benchmarks/uc4-application-flink/build.gradle @@ -1 +1,5 @@ +plugins { + id 'theodolite.java-uc' +} + mainClassName = "theodolite.uc4.application.AggregationServiceFlinkJob" diff --git a/theodolite-benchmarks/uc4-application/build.gradle b/theodolite-benchmarks/uc4-application/build.gradle index 9cb1b311d8f50769d371952db886e4a00a454591..061650e31471fd313316036e4764ed761d8c6ab6 100644 --- a/theodolite-benchmarks/uc4-application/build.gradle +++ b/theodolite-benchmarks/uc4-application/build.gradle @@ -1 +1,5 @@ +plugins { + id 'theodolite.java-uc' +} + mainClassName = "theodolite.uc4.application.AggregationService" diff --git a/theodolite-benchmarks/uc4-workload-generator/build.gradle b/theodolite-benchmarks/uc4-workload-generator/build.gradle index 8865ec9391213f3d8c52be2366573dee09652087..5d419e67c1b88dc8ef1c70b04318ac31785db250 100644 --- a/theodolite-benchmarks/uc4-workload-generator/build.gradle +++ b/theodolite-benchmarks/uc4-workload-generator/build.gradle @@ -1 +1,5 @@ +plugins { + id 'theodolite.java-uc' +} + mainClassName = "theodolite.uc4.workloadgenerator.LoadGenerator" diff --git a/theodolite-benchmarks/workload-generator-commons/build.gradle b/theodolite-benchmarks/workload-generator-commons/build.gradle index c42fff0412c332bc8292e175a352c03ada71f659..06dd5b2b85a7fee15df6203bf1c22ac9e666a2ee 100644 --- a/theodolite-benchmarks/workload-generator-commons/build.gradle +++ b/theodolite-benchmarks/workload-generator-commons/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'theodolite.java-commons' +} + dependencies { implementation 'com.google.guava:guava:30.1-jre' implementation 'com.hazelcast:hazelcast:4.1.1' @@ -6,7 +10,7 @@ dependencies { implementation('org.industrial-devops:titan-ccp-common:0.1.0-SNAPSHOT') { changing = true } implementation('org.industrial-devops:titan-ccp-common-kafka:0.1.0-SNAPSHOT') { changing = true } implementation 'org.apache.kafka:kafka-streams:2.6.0' // TODO required? - + // Use JUnit test framework testImplementation 'junit:junit:4.12' -} \ No newline at end of file +}