diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 680f78f688871c5a60ecbb4338316d416d078ea4..90effd8588932aca1b1ff6591ccceeda1854908e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,65 +30,45 @@ test: stage: test tags: - exec-docker - script: ./gradlew test + script: ./gradlew test --continue + artifacts: + reports: + junit: + - "**/build/test-results/test/TEST-*.xml" checkstyle: stage: check tags: - exec-docker - script: ./gradlew checkstyle + script: ./gradlew checkstyle --continue allow_failure: true artifacts: paths: - - build/reports/checkstyle/main.html - - uc1-application/build/reports/checkstyle/main.html - - uc1-workload-generator/build/reports/checkstyle/main.html - - uc2-application/build/reports/checkstyle/main.html - - uc2-workload-generator/build/reports/checkstyle/main.html - - uc3-application/build/reports/checkstyle/main.html - - uc3-workload-generator/build/reports/checkstyle/main.html - - uc4-application/build/reports/checkstyle/main.html - - uc4-workload-generator/build/reports/checkstyle/main.html + - "*/build/reports/checkstyle/main.html" when: on_failure expire_in: 1 day - + pmd: stage: check tags: - exec-docker - script: ./gradlew pmd + script: ./gradlew pmd --continue allow_failure: true artifacts: paths: - - build/reports/pmd/*.html - - uc1-application/build/reports/pmd/*.html - - uc1-workload-generator/build/reports/pmd/*.html - - uc2-application/build/reports/pmd/*.html - - uc2-workload-generator/build/reports/pmd/*.html - - uc3-application/build/reports/pmd/*.html - - uc3-workload-generator/build/reports/pmd/*.html - - uc4-application/build/reports/pmd/*.html - - uc4-workload-generator/build/reports/pmd/*.html + - "*/build/reports/pmd/*.html" when: on_failure expire_in: 1 day - + spotbugs: stage: check tags: - exec-docker - script: ./gradlew spotbugs + script: ./gradlew spotbugs --continue allow_failure: true artifacts: paths: - - build/reports/spotbugs/*.html - - uc1-application/build/reports/spotbugs/*.html - - uc1-workload-generator/build/reports/spotbugs/*.html - - uc2-application/build/reports/spotbugs/*.html - - uc2-workload-generator/build/reports/spotbugs/*.html - - uc3-application/build/reports/spotbugs/*.html - - uc3-workload-generator/build/reports/spotbugs/*.html - - uc4-application/build/reports/spotbugs/*.html - - uc4-workload-generator/build/reports/spotbugs/*.html + - "*/build/reports/spotbugs/*.html" when: on_failure expire_in: 1 day @@ -116,4 +96,4 @@ spotbugs: variables: - $DOCKERHUB_ORG - $DOCKERHUB_ID - - $DOCKERHUB_PW \ No newline at end of file + - $DOCKERHUB_PW diff --git a/build.gradle b/build.gradle index c73a8582d8b08b21bb5667ebcc047933c890855b..6827860869614f2d0ff575cfb5e6229e6d4a3806 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,4 @@ -apply plugin: 'java-library' -apply plugin: 'pmd' -apply plugin: 'checkstyle' -apply plugin: 'com.github.spotbugs' -apply plugin: 'eclipse' - +// Inherited to all subprojects buildscript { repositories { maven { @@ -15,15 +10,35 @@ buildscript { } } -sourceCompatibility = "1.11" -targetCompatibility = "1.11" +// Plugins for all projects +allprojects { + apply plugin: 'eclipse' +} + +// Plugins for subprojects +subprojects { + apply plugin: 'application' + apply plugin: 'checkstyle' + apply plugin: 'pmd' + apply plugin: 'com.github.spotbugs' + apply plugin: 'java-library' +} + +// Java version for all subprojects +subprojects { + java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } +} +// Check for updates every build configurations.all { - // Check for updates every build resolutionStrategy.cacheChangingModulesFor 0, 'seconds' } -allprojects { +// Repositories for all projects +allprojects { repositories { jcenter() maven { @@ -32,42 +47,23 @@ allprojects { } } -dependencies { - // These dependencies is exported to consumers, that is to say found on their compile classpath. - api('org.industrial-devops:titan-ccp-common:0.0.3-SNAPSHOT') { changing = true } - api 'net.kieker-monitoring:kieker:1.14-SNAPSHOT' - api 'net.sourceforge.teetime:teetime:3.0' - - // These dependencies are used internally, and not exposed to consumers on their own compile classpath. - implementation 'org.apache.kafka:kafka-clients:2.1.0' - implementation 'com.google.guava:guava:24.1-jre' - implementation 'org.jctools:jctools-core:2.1.1' - - // Use JUnit test framework - testImplementation 'junit:junit:4.12' -} - -pmd { - ruleSets = [] // Gradle requires to clean the rule sets first - ruleSetFiles = files("config/pmd.xml") - ignoreFailures = false - toolVersion = "6.7.0" -} - -checkstyle { - configDir = file("config") - configFile = file("config/checkstyle.xml") - maxWarnings = 0 - ignoreFailures = false - toolVersion = "8.12" -} - -spotbugs { - excludeFilter = file("config/spotbugs-exclude-filter.xml") - reportLevel = "low" - effort = "max" - ignoreFailures = false - toolVersion = '3.1.7' +// Dependencies +subprojects { + dependencies { + // These dependencies is exported to consumers, that is to say found on their compile classpath. + api('org.industrial-devops:titan-ccp-common:0.0.3-SNAPSHOT') { changing = true } + api 'net.kieker-monitoring:kieker:1.14-SNAPSHOT' + api 'net.sourceforge.teetime:teetime:3.0' + + // These dependencies are used internally, and not exposed to consumers on their own compile classpath. + implementation 'org.apache.kafka:kafka-clients:2.1.0' + implementation 'com.google.guava:guava:24.1-jre' + implementation 'org.jctools:jctools-core:2.1.1' + implementation 'org.slf4j:slf4j-simple:1.6.1' + + // Use JUnit test framework + testImplementation 'junit:junit:4.12' + } } // Per default XML reports for SpotBugs are generated @@ -80,33 +76,64 @@ tasks.withType(com.github.spotbugs.SpotBugsTask) { } } -task checkstyle { - group 'Quality Assurance' - description 'Run Checkstyle' - - dependsOn 'checkstyleMain' - dependsOn 'checkstyleTest' -} +// Subprojects quality tools tasks +subprojects { + task pmd { + group 'Quality Assurance' + description 'Run PMD' + + dependsOn 'pmdMain' + dependsOn 'pmdTest' + } -task pmd { - group 'Quality Assurance' - description 'Run PMD' + task checkstyle { + group 'Quality Assurance' + description 'Run Checkstyle' - dependsOn 'pmdMain' - dependsOn 'pmdTest' + dependsOn 'checkstyleMain' + dependsOn 'checkstyleTest' + } + + task spotbugs { + group 'Quality Assurance' + description 'Run SpotBugs' + + dependsOn 'spotbugsMain' + dependsOn 'spotbugsTest' + } } -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 = '3.1.7' + } } -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} \ No newline at end of file +allprojects { + eclipse { + classpath { + downloadSources=true + downloadJavadoc=true + } + } +} diff --git a/uc1-application/build.gradle b/uc1-application/build.gradle index 3fe8803745e42682cf43d068779e63183d62c792..f6b2ee26aa8ad435700553cc435f4d864b2f6d8b 100644 --- a/uc1-application/build.gradle +++ b/uc1-application/build.gradle @@ -1,31 +1 @@ -apply plugin: 'application' -apply plugin: 'eclipse' - -buildscript { - repositories { - maven { - url "https://plugins.gradle.org/m2/" - } - } -} - -sourceCompatibility = "1.11" -targetCompatibility = "1.11" - -dependencies { - compile project(':') - - compile 'org.slf4j:slf4j-simple:1.6.1' - - // Use JUnit test framework - testCompile 'junit:junit:4.12' -} - mainClassName = "uc1.application.HistoryService" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} \ No newline at end of file diff --git a/uc1-workload-generator/build.gradle b/uc1-workload-generator/build.gradle index 824566a24158d5f535e0dec8ef948903738c9100..0663dcd33e42967dbf79c33a7c717346718dabd6 100644 --- a/uc1-workload-generator/build.gradle +++ b/uc1-workload-generator/build.gradle @@ -1,31 +1 @@ -apply plugin: 'application' -apply plugin: 'eclipse' - -buildscript { - repositories { - maven { - url "https://plugins.gradle.org/m2/" - } - } -} - -sourceCompatibility = "1.11" -targetCompatibility = "1.11" - -dependencies { - compile project(':') - - compile 'org.slf4j:slf4j-simple:1.6.1' - - // Use JUnit test framework - testCompile 'junit:junit:4.12' -} - mainClassName = "uc1.workloadGenerator.LoadGenerator" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} \ No newline at end of file diff --git a/uc2-application/build.gradle b/uc2-application/build.gradle index 42bc3e0770db50e93bf2a08d5c039677489c4492..5ef5e63a04db8ce01659c149d10c9684bf614099 100644 --- a/uc2-application/build.gradle +++ b/uc2-application/build.gradle @@ -1,31 +1 @@ -apply plugin: 'application' -apply plugin: 'eclipse' - -buildscript { - repositories { - maven { - url "https://plugins.gradle.org/m2/" - } - } -} - -sourceCompatibility = "1.11" -targetCompatibility = "1.11" - -dependencies { - compile project(':') - - compile 'org.slf4j:slf4j-simple:1.6.1' - - // Use JUnit test framework - testCompile 'junit:junit:4.12' -} - mainClassName = "uc2.application.AggregationService" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} \ No newline at end of file diff --git a/uc2-workload-generator/build.gradle b/uc2-workload-generator/build.gradle index 833291011bb60bf84fcec323f2f0f63f9915d245..bb4f4a0ca5e07abcc32a7bf0013e6047239da9dc 100644 --- a/uc2-workload-generator/build.gradle +++ b/uc2-workload-generator/build.gradle @@ -1,31 +1 @@ -apply plugin: 'application' -apply plugin: 'eclipse' - -buildscript { - repositories { - maven { - url "https://plugins.gradle.org/m2/" - } - } -} - -sourceCompatibility = "1.11" -targetCompatibility = "1.11" - -dependencies { - compile project(':') - - compile 'org.slf4j:slf4j-simple:1.6.1' - - // Use JUnit test framework - testCompile 'junit:junit:4.12' -} - mainClassName = "uc2.workloadGenerator.LoadGenerator" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} \ No newline at end of file diff --git a/uc3-application/build.gradle b/uc3-application/build.gradle index 01f47ffbcde8beb2e02f40ff498516742b3ed49f..343619a6a5f9c30bf62d405830ae4169ae911f4a 100644 --- a/uc3-application/build.gradle +++ b/uc3-application/build.gradle @@ -1,23 +1,5 @@ -apply plugin: 'application' -apply plugin: 'eclipse' - -buildscript { - repositories { - maven { - url "https://plugins.gradle.org/m2/" - } - } -} - -sourceCompatibility = "1.11" -targetCompatibility = "1.11" - -allprojects { +allprojects { repositories { - jcenter() - maven { - url "https://oss.sonatype.org/content/repositories/snapshots/" - } maven { url 'https://packages.confluent.io/maven/' } @@ -25,20 +7,7 @@ allprojects { } dependencies { - compile project(':') - compile('org.industrial-devops:titan-ccp-common-kafka:0.1.0-SNAPSHOT') - compile 'org.slf4j:slf4j-simple:1.6.1' - - // Use JUnit test framework - testCompile 'junit:junit:4.12' } mainClassName = "uc3.application.HistoryService" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} \ No newline at end of file diff --git a/uc3-workload-generator/build.gradle b/uc3-workload-generator/build.gradle index 5cb1fdfccc5677b64447b3e644e7fca47c2cd571..f1019cd12c9bf23e75816cad9640c8d8396f5c9b 100644 --- a/uc3-workload-generator/build.gradle +++ b/uc3-workload-generator/build.gradle @@ -1,31 +1 @@ -apply plugin: 'application' -apply plugin: 'eclipse' - -buildscript { - repositories { - maven { - url "https://plugins.gradle.org/m2/" - } - } -} - -sourceCompatibility = "1.11" -targetCompatibility = "1.11" - -dependencies { - compile project(':') - - compile 'org.slf4j:slf4j-simple:1.6.1' - - // Use JUnit test framework - testCompile 'junit:junit:4.12' -} - mainClassName = "uc3.workloadGenerator.LoadGenerator" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} \ No newline at end of file diff --git a/uc4-application/build.gradle b/uc4-application/build.gradle index 009c083e1fcd3dffcbb358098e2e0e0900f98e07..ce402c3cc109a5591e518c4bc263c024e892116c 100644 --- a/uc4-application/build.gradle +++ b/uc4-application/build.gradle @@ -1,23 +1,5 @@ -apply plugin: 'application' -apply plugin: 'eclipse' - -buildscript { - repositories { - maven { - url "https://plugins.gradle.org/m2/" - } - } -} - -sourceCompatibility = "1.11" -targetCompatibility = "1.11" - -allprojects { +allprojects { repositories { - jcenter() - maven { - url "https://oss.sonatype.org/content/repositories/snapshots/" - } maven { url 'https://packages.confluent.io/maven/' } @@ -25,20 +7,7 @@ allprojects { } dependencies { - compile project(':') - - compile 'org.slf4j:slf4j-simple:1.6.1' compile('org.industrial-devops:titan-ccp-common-kafka:0.1.0-SNAPSHOT') - - // Use JUnit test framework - testCompile 'junit:junit:4.12' } mainClassName = "uc4.application.HistoryService" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} diff --git a/uc4-workload-generator/build.gradle b/uc4-workload-generator/build.gradle index 5902b630740148b0cfe0a387d76d16e9e19468e1..9d61f82a876eff5ac7ffa26beb6aa7ba50c91503 100644 --- a/uc4-workload-generator/build.gradle +++ b/uc4-workload-generator/build.gradle @@ -1,31 +1 @@ -apply plugin: 'application' -apply plugin: 'eclipse' - -buildscript { - repositories { - maven { - url "https://plugins.gradle.org/m2/" - } - } -} - -sourceCompatibility = "1.11" -targetCompatibility = "1.11" - -dependencies { - compile project(':') - - compile 'org.slf4j:slf4j-simple:1.6.1' - - // Use JUnit test framework - testCompile 'junit:junit:4.12' -} - mainClassName = "uc4.workloadGenerator.LoadGenerator" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} \ No newline at end of file