diff --git a/Jenkinsfile b/Jenkinsfile index 83f4d175a2..144f746121 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ //////////////////////////////// /* project configuration */ -String javaVersionId = 'jdk-8' // 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 = 'simona' // name of the repository, is case insensitive @@ -114,8 +114,7 @@ node { gradle('--refresh-dependencies clean spotlessCheck pmdMain pmdTest reportScoverage checkScoverage', projectName) - // due to an issue with openjdk-8 we use openjdk-11 for javadocs generation - sh(script: """set +x && cd $projectName""" + ''' set +x; ./gradlew javadoc -Dorg.gradle.java.home=/opt/java/openjdk''', returnStdout: true) + sh(script: """set +x && cd $projectName""" + ''' set +x; ./gradlew javadoc''', returnStdout: true) } // sonarqube analysis @@ -158,7 +157,7 @@ node { */ sh( script: """set +x && cd $projectName""" + - ''' set +x; ./gradlew javadoc -Dorg.gradle.java.home=/opt/java/openjdk''', + ''' set +x; ./gradlew javadoc''', returnStdout: true ) @@ -388,7 +387,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 javadoc -Dorg.gradle.java.home=/opt/java/openjdk && " + + "cd .. && ./gradlew 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" + diff --git a/build.gradle b/build.gradle index 41fd7a3905..873cb34310 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { id 'signing' id 'maven-publish' // publish to a maven repo (local or mvn central, has to be defined) id 'pmd' // code check, working on source code - id 'com.diffplug.spotless' version '6.1.0'// code format + id 'com.diffplug.spotless' version '6.1.2'// code format id 'com.github.onslip.gradle-one-jar' version '1.0.6' // pack a self contained jar id "com.github.ben-manes.versions" version '0.40.0' id "de.undercouch.download" version "4.1.2" // downloads plugin @@ -22,7 +22,7 @@ plugins { ext { //version (changing these should be considered thoroughly!) - javaVersion = JavaVersion.VERSION_1_8 + javaVersion = JavaVersion.VERSION_17 scalaVersion = '2.13' scalaBinaryVersion = '2.13.7' @@ -92,7 +92,7 @@ dependencies { implementation "ch.qos.logback:logback-classic:1.2.10" /* testing */ - testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' + testImplementation 'org.spockframework:spock-core:2.1-M2-groovy-3.0' testImplementation 'org.scalatestplus:mockito-3-4_2.13:3.2.9.0' implementation 'org.mockito:mockito-core:4.2.0' // mocking framework testImplementation "org.scalatest:scalatest_${scalaVersion}:3.2.10" diff --git a/gradle.properties b/gradle.properties index 437a644249..b761da57f7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,16 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx4096m + +# Workaround to make spotless work with java 17 - +# see https://github.com/diffplug/spotless/tree/main/plugin-gradle#google-java-format and +# https://github.com/ie3-institute/simona/issues/59 for details +org.gradle.jvmargs=-Xmx4096m \ + --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 # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit diff --git a/src/test/groovy/edu/ie3/simona/model/participant/PVModelTest.groovy b/src/test/groovy/edu/ie3/simona/model/participant/PVModelTest.groovy index 01a755c624..6cb8535c2c 100644 --- a/src/test/groovy/edu/ie3/simona/model/participant/PVModelTest.groovy +++ b/src/test/groovy/edu/ie3/simona/model/participant/PVModelTest.groovy @@ -317,7 +317,7 @@ class PVModelTest extends Specification { where: "the following parameters are given" latitudeInDeg | deltaIn | omegaIn || alphaSOut 43d | -14d | -37.5d || 23.4529893659531784299686037109330117049955654837550 // '2011-02-13T09:30:00' - 43d | 23.1d | 97.5d || 10.3561513175064165807300181176479988436754378357928 // '2011-07-01T06:30:00' + 43d | 23.1d | 97.5d || 10.356151317506402829742934977890382350725031728508 // '2011-07-01T06:30:00' } def "Calculate Rb (cos(thetaG)/cos(thetaZ))"() { @@ -349,8 +349,8 @@ class PVModelTest extends Specification { 45 | -7.15 | -82.5 | 0 | 0 || 89.795654742951077439582101317248278436936658210074 // thetaZ 40 | -11.6 | -82.5 | 60 | 0 || 79.110119287443572813858647674599902596082559960114 40 | -11.6 | 82.5 | 60 | 0 || 79.110119287443572813858647674599902596082559960114 - 40 | -11.6 | -78.0 | 60 | 0 || 74.9207206518514467357682971033566198212518156744 - 40 | -11.6 | 78.0 | 60 | 0 || 74.9207206518514467357682971033566198212518156744 + 40 | -11.6 | -78.0 | 60 | 0 || 74.920720651851429547034443178659599205063808040294 + 40 | -11.6 | 78.0 | 60 | 0 || 74.920720651851429547034443178659599205063808040294 } def "Calculate the estimate beam radiation eBeamS"() {