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: ...@@ -30,25 +30,21 @@ test:
stage: test stage: test
tags: tags:
- exec-docker - exec-docker
script: ./gradlew test script: ./gradlew test --continue
artifacts:
reports:
junit:
- "**/build/test-results/test/TEST-*.xml"
checkstyle: checkstyle:
stage: check stage: check
tags: tags:
- exec-docker - exec-docker
script: ./gradlew checkstyle script: ./gradlew checkstyle --continue
allow_failure: true allow_failure: true
artifacts: artifacts:
paths: paths:
- build/reports/checkstyle/main.html - "*/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
when: on_failure when: on_failure
expire_in: 1 day expire_in: 1 day
...@@ -56,19 +52,11 @@ pmd: ...@@ -56,19 +52,11 @@ pmd:
stage: check stage: check
tags: tags:
- exec-docker - exec-docker
script: ./gradlew pmd script: ./gradlew pmd --continue
allow_failure: true allow_failure: true
artifacts: artifacts:
paths: paths:
- build/reports/pmd/*.html - "*/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
when: on_failure when: on_failure
expire_in: 1 day expire_in: 1 day
...@@ -76,19 +64,11 @@ spotbugs: ...@@ -76,19 +64,11 @@ spotbugs:
stage: check stage: check
tags: tags:
- exec-docker - exec-docker
script: ./gradlew spotbugs script: ./gradlew spotbugs --continue
allow_failure: true allow_failure: true
artifacts: artifacts:
paths: paths:
- build/reports/spotbugs/*.html - "*/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
when: on_failure when: on_failure
expire_in: 1 day expire_in: 1 day
......
apply plugin: 'java-library' // Inherited to all subprojects
apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: 'com.github.spotbugs'
apply plugin: 'eclipse'
buildscript { buildscript {
repositories { repositories {
maven { maven {
...@@ -15,14 +10,34 @@ buildscript { ...@@ -15,14 +10,34 @@ buildscript {
} }
} }
sourceCompatibility = "1.11" // Plugins for all projects
targetCompatibility = "1.11" 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 // Check for updates every build
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds' resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
} }
// Repositories for all projects
allprojects { allprojects {
repositories { repositories {
jcenter() jcenter()
...@@ -32,6 +47,8 @@ allprojects { ...@@ -32,6 +47,8 @@ allprojects {
} }
} }
// Dependencies
subprojects {
dependencies { dependencies {
// These dependencies is exported to consumers, that is to say found on their compile classpath. // 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('org.industrial-devops:titan-ccp-common:0.0.3-SNAPSHOT') { changing = true }
...@@ -42,32 +59,11 @@ dependencies { ...@@ -42,32 +59,11 @@ dependencies {
implementation 'org.apache.kafka:kafka-clients:2.1.0' implementation 'org.apache.kafka:kafka-clients:2.1.0'
implementation 'com.google.guava:guava:24.1-jre' implementation 'com.google.guava:guava:24.1-jre'
implementation 'org.jctools:jctools-core:2.1.1' implementation 'org.jctools:jctools-core:2.1.1'
implementation 'org.slf4j:slf4j-simple:1.6.1'
// Use JUnit test framework // Use JUnit test framework
testImplementation 'junit:junit:4.12' 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 // Per default XML reports for SpotBugs are generated
...@@ -80,14 +76,8 @@ tasks.withType(com.github.spotbugs.SpotBugsTask) { ...@@ -80,14 +76,8 @@ tasks.withType(com.github.spotbugs.SpotBugsTask) {
} }
} }
task checkstyle { // Subprojects quality tools tasks
group 'Quality Assurance' subprojects {
description 'Run Checkstyle'
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
}
task pmd { task pmd {
group 'Quality Assurance' group 'Quality Assurance'
description 'Run PMD' description 'Run PMD'
...@@ -96,6 +86,14 @@ task pmd { ...@@ -96,6 +86,14 @@ task pmd {
dependsOn 'pmdTest' dependsOn 'pmdTest'
} }
task checkstyle {
group 'Quality Assurance'
description 'Run Checkstyle'
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
}
task spotbugs { task spotbugs {
group 'Quality Assurance' group 'Quality Assurance'
description 'Run SpotBugs' description 'Run SpotBugs'
...@@ -103,10 +101,39 @@ task spotbugs { ...@@ -103,10 +101,39 @@ task spotbugs {
dependsOn 'spotbugsMain' dependsOn 'spotbugsMain'
dependsOn 'spotbugsTest' 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 { eclipse {
classpath { classpath {
downloadSources=true downloadSources=true
downloadJavadoc=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" 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" 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" 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" 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 { allprojects {
repositories { repositories {
jcenter()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven { maven {
url 'https://packages.confluent.io/maven/' url 'https://packages.confluent.io/maven/'
} }
...@@ -25,20 +7,7 @@ allprojects { ...@@ -25,20 +7,7 @@ allprojects {
} }
dependencies { dependencies {
compile project(':')
compile('org.industrial-devops:titan-ccp-common-kafka:0.1.0-SNAPSHOT') 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" 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" 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 { allprojects {
repositories { repositories {
jcenter()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven { maven {
url 'https://packages.confluent.io/maven/' url 'https://packages.confluent.io/maven/'
} }
...@@ -25,20 +7,7 @@ allprojects { ...@@ -25,20 +7,7 @@ allprojects {
} }
dependencies { dependencies {
compile project(':')
compile 'org.slf4j:slf4j-simple:1.6.1'
compile('org.industrial-devops:titan-ccp-common-kafka:0.1.0-SNAPSHOT') 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" 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" 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 register or to comment