Skip to content
Snippets Groups Projects
Commit 96c89d1b authored by Sören Henning's avatar Sören Henning
Browse files

Merge branch 'feature/gradleCIImprovements' into 'master'

Gradle + CI improvements

Closes #7

See merge request she/spesb!2
parents 40fd6d50 d4e9ed7b
No related branches found
No related tags found
No related merge requests found
......@@ -30,25 +30,21 @@ 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
......@@ -56,19 +52,11 @@ 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
......@@ -76,19 +64,11 @@ 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
......
......
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,14 +10,34 @@ 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
}
}
configurations.all {
// Check for updates every build
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
// Repositories for all projects
allprojects {
repositories {
jcenter()
......@@ -32,6 +47,8 @@ allprojects {
}
}
// 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 }
......@@ -42,32 +59,11 @@ dependencies {
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'
}
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'
}
// Per default XML reports for SpotBugs are generated
......@@ -80,14 +76,8 @@ 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'
......@@ -96,6 +86,14 @@ task pmd {
dependsOn 'pmdTest'
}
task checkstyle {
group 'Quality Assurance'
description 'Run Checkstyle'
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
}
task spotbugs {
group 'Quality Assurance'
description 'Run SpotBugs'
......@@ -103,10 +101,39 @@ task 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'
}
}
allprojects {
eclipse {
classpath {
downloadSources=true
downloadJavadoc=true
}
}
}
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
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
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
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
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 = "uc3.application.HistoryService"
eclipse {
classpath {
downloadSources=true
downloadJavadoc=true
}
}
\ No newline at end of file
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
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 = "uc4.application.HistoryService"
eclipse {
classpath {
downloadSources=true
downloadJavadoc=true
}
}
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment