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 2341e1d8c69e1753415e7207b2492a5fcf2596a3..ec18bbebfae085ea227cd94dd19ed5fe06cfc80d 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 = "spesb.uc1.application.HistoryService" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} diff --git a/uc1-workload-generator/build.gradle b/uc1-workload-generator/build.gradle index 7739f874768b02cd4a042630438905d8e7f4080d..d934bd09de1d64cadac982669d7cab5b564f0dd5 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 = "spesb.uc1.workloadgenerator.LoadGenerator" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} diff --git a/uc2-application/build.gradle b/uc2-application/build.gradle index 4503bb94d23b558c7e3ea2c2c28e34c03f94c8c8..90f54fc6110ac88ef7d0d80ae8ec60c6087ce808 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 = "spesb.uc2.application.AggregationService" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} diff --git a/uc2-workload-generator/build.gradle b/uc2-workload-generator/build.gradle index bf670e8ab900706d487339db2ce714a063d45b4d..d165ab24e81b56d85f8183b41d5ec4f254be43b8 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 = "spesb.uc2.workloadgenerator.LoadGenerator" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} diff --git a/uc3-application/build.gradle b/uc3-application/build.gradle index 6f6e5fb21bde58635a661423ba57578ba479d736..89d122ba69512548a011505c71f636c0bd3b0b47 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 { 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 = "spesb.uc3.application.HistoryService" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} diff --git a/uc3-workload-generator/build.gradle b/uc3-workload-generator/build.gradle index a288378c82d84a882f416bcc0f7475f6a34f76a3..e27cf26d28ba0d3f85a4c2a11e4eae2b85f29e4c 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 = "spesb.uc3.workloadgenerator.LoadGenerator" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} diff --git a/uc4-application/build.gradle b/uc4-application/build.gradle index b39d11bdb34e3befc288853a875c6f5aa153ee17..c89b18b1bfd5a131e58e512e79934e498f182adb 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 { 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 = "spesb.uc4.application.HistoryService" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -} diff --git a/uc4-workload-generator/build.gradle b/uc4-workload-generator/build.gradle index 779a890b48e910cbd213f22bdc0874919dbc351c..8bbdedf4f7c41da73dd2d591b8fd56830d7060b7 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 = "spesb.uc4.workloadgenerator.LoadGenerator" - -eclipse { - classpath { - downloadSources=true - downloadJavadoc=true - } -}