Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased/Snapshot]
## [Unreleased]

### Added
- Read the docs capabilities
Expand All @@ -19,6 +19,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Coordinated shut down phase

### Changed
- Rely on Java 17
- Workaround for `spotless`: Add module exports to `gradle.properties`

### Fixed
- ...
### Removed
- Legacy Java code
- Jacoco gradle pluginfgc

[Unreleased]: https://github.com/ie3-institute/OSMoGrid/compare/7e598e53e333c9c1a7b19906584f0357ddf07990...HEAD
14 changes: 5 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
////////////////////////////////

/* project configuration */
String javaVersionId = 'jdk-11' // id that matches the java tool with the java version that should be used set as jenkins property
String javaVersionId = 'jdk-17' // id that matches the java tool with the java version that should be used set as jenkins property

/* git configuration */
String projectName = 'OSMoGrid' // name of the repository, is case insensitive
Expand Down Expand Up @@ -112,11 +112,10 @@ node {

sh 'java -version'

gradle('--refresh-dependencies clean spotlessCheck pmdMain pmdTest spotbugsMain ' +
'spotbugsTest test jacocoTestReport jacocoTestCoverageVerification', projectName)
gradle('--refresh-dependencies clean spotlessCheck pmdMain pmdTest spotbugsMain spotbugsTest test', projectName)

// due to an issue with openjdk-8 we use openjdk-11 for javadocs generation
sh(script: """set +x && cd $projectName""" + ''' set +x; ./gradlew clean javadoc -Dorg.gradle.java.home=/opt/java/openjdk''', returnStdout: true)
sh(script: """set +x && cd $projectName""" + ''' set +x; ./gradlew clean javadoc''', returnStdout: true)
}

// sonarqube analysis
Expand Down Expand Up @@ -159,7 +158,7 @@ node {
*/
sh(
script: """set +x && cd $projectName""" +
''' set +x; ./gradlew clean javadoc -Dorg.gradle.java.home=/opt/java/openjdk''',
''' set +x; ./gradlew clean javadoc''',
returnStdout: true
)

Expand Down Expand Up @@ -389,7 +388,7 @@ def deployJavaDocs(String projectName, String sshCredentialsId, String gitChecko
"git config user.name 'Johannes Hiry' && " +
"git fetch --depth=1 origin api-docs && " +
"git checkout api-docs && " +
"cd .. && ./gradlew clean javadoc -Dorg.gradle.java.home=/opt/java/openjdk && " +
"cd .. && ./gradlew clean javadoc && " +
"cp -R build/docs/javadoc/* tmp-api-docs && " +
"cd tmp-api-docs &&" +
"git add --all && git commit -m 'updated api-docs' && git push origin api-docs:api-docs" +
Expand Down Expand Up @@ -458,9 +457,6 @@ def publishReports(String relativeProjectDir) {
// publish test reports
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/tests/test', reportFiles: 'index.html', reportName: "${relativeProjectDir}_java_tests_report", reportTitles: ''])

// publish jacoco report for main project only
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/jacoco', reportFiles: 'index.html', reportName: "${relativeProjectDir}_jacoco_report", reportTitles: ''])

// publish pmd report for main project only
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/pmd', reportFiles: 'main.html', reportName: "${relativeProjectDir}_pmd_report", reportTitles: ''])

Expand Down
12 changes: 5 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
plugins {
// todo revise
id 'java' //java support
id 'groovy' // groovy support
id 'scala'
id 'pmd' // code check, working on source code
id 'com.diffplug.spotless' version '6.2.0'//code format
id 'com.github.spotbugs' version '5.0.4' // code check, working on byte code
id 'de.undercouch.download' version '4.1.2'
id 'kr.motd.sphinx' version '2.10.1' // documentation generation
id "com.github.maiflai.scalatest" version "0.32" // run scalatest without specific spec task
id 'jacoco' // java code coverage plugin
id "org.sonarqube" version "3.3" // sonarqube
id 'net.thauvin.erik.gradle.semver' version '1.0.4' // semantic versioning
id 'scala'
}

ext {
javaVersion = JavaVersion.VERSION_11
javaVersion = JavaVersion.VERSION_17

scalaMajorVersion = '3'
scalaVersion = '3.1.0'
Expand All @@ -41,15 +39,15 @@ apply from: scriptsLocation + 'spotbugs.gradle'
apply from: scriptsLocation + 'spotless.gradle'
apply from: scriptsLocation + 'checkJavaVersion.gradle'
apply from: scriptsLocation + 'documentation.gradle'
apply from: scriptsLocation + 'jacoco.gradle' // jacoco java code coverage
apply from: scriptsLocation + 'sonarqube.gradle'
apply from: scriptsLocation + 'vcs.gradle'
apply from: scriptsLocation + 'semVer.gradle'
apply from: scriptsLocation + 'tscfg.gradle'

repositories {
mavenCentral() //searches in bintray's repository 'jCenter', which contains Maven Central
maven { url 'https://www.jitpack.io' } // allows github repos as dependencies
maven { url 'https://www.jitpack.io' } // allows github repos as dependencies// sonatype snapshot repo
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } // Snapshot-Repository
}

dependencies {
Expand All @@ -76,7 +74,7 @@ dependencies {

// todo CLEANUP following old dependencies
// ie³ power system utils
implementation('com.github.ie3-institute:PowerSystemUtils:1.6') {
implementation('com.github.ie3-institute:PowerSystemUtils:2.0-SNAPSHOT') {
exclude group: 'org.slf4j'
exclude group: 'org.apache.logging.log4j'
exclude group: 'com.github.ie3-institute'
Expand Down
6 changes: 6 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Workaround for splotless with java 17
org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
Comment on lines +1 to +6
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only a workaround and shall be fixed with #130

59 changes: 0 additions & 59 deletions gradle/scripts/jacoco.gradle

This file was deleted.

2 changes: 1 addition & 1 deletion gradle/scripts/pmd.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

pmd {
consoleOutput = true
toolVersion = "6.40.0"
toolVersion = "6.41.0"
rulesMinimumPriority = 2
}
14 changes: 0 additions & 14 deletions gradle/scripts/sonarqube.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,13 @@ sonarqube {
property 'sonar.sourceEncoding', 'UTF-8' // encoding
property 'sonar.sources', [
'src/main/resources',
'src/main/java',
'src/main/scala'] // src dirs
property "sonar.tests", [
'src/test/resources',
'src/test/java',
'src/test/scala'] // test src dirs
// reports stuff (for all languages)
property 'sonar.junit.reportPaths', [
'build/test-results/test'] // Comma-delimited list of paths to Surefire XML-format reports.
// unit tests reports dirs
property "sonar.coverage.jacoco.xmlReportsPath", [
"build/reports/jacoco/test/jacocoTestReport.xml"] // Comma-separated list of paths to JaCoCo (jacoco.xml) report files.
// spotbugs report dir
property "sonar.java.spotbugs.reportPaths", [
"build/reports/spotbugs/main.xml",
Expand All @@ -27,12 +22,6 @@ sonarqube {
property "sonar.java.pmd.reportPaths", [
"build/reports/pmd/test.xml",
"build/reports/pmd/main.xml"] // Comma-delimited list of paths to PMD Apex XML reports
// groovy specific stuff
property 'sonar.groovy.jacoco.reportPath', 'build/jacoco/test.exec' // unit tests reports dir
/// integration tests reports dir (if any)
property 'sonar.groovy.jacoco.itReportPath', 'build/jacoco/test.exec'
property 'sonar.groovy.binaries', 'build/classes/groovy' // groovy binaries

// exclusions
property 'sonar.exclusions', [
'docs/**',
Expand All @@ -49,6 +38,3 @@ project.tasks["sonarqube"].dependsOn "check"
// - pmdTest
// - spotBugsTest
// - test

project.tasks["sonarqube"].dependsOn "jacocoTestReport"
project.tasks["sonarqube"].dependsOn "jacocoTestCoverageVerification"
8 changes: 4 additions & 4 deletions gradle/scripts/spotbugs.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ spotbugs{

spotbugsMain{
reports{
html.enabled = false
xml.enabled = true
html.enabled false
xml.enabled true
}
}

spotbugsTest{
reports{
html.enabled = false
xml.enabled = true
html.enabled false
xml.enabled true
}
}
Loading