Skip to content

Commit

Permalink
Merge pull request #60 from ie3-institute/sp/#58-java-17
Browse files Browse the repository at this point in the history
Upgrading to Java 17
  • Loading branch information
johanneshiry authored Jan 10, 2022
2 parents 61605df + a4d56be commit 3741bf1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
9 changes: 4 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
)

Expand Down Expand Up @@ -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" +
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down Expand Up @@ -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"
Expand Down
11 changes: 10 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))"() {
Expand Down Expand Up @@ -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"() {
Expand Down

0 comments on commit 3741bf1

Please sign in to comment.