Skip to content

Commit 9da3a3a

Browse files
Merge pull request #199 from ie3-institute/jh/#194_switch_to_java17
Switch to java 17
2 parents 6f850ad + fbdea11 commit 9da3a3a

File tree

12 files changed

+591
-709
lines changed

12 files changed

+591
-709
lines changed

.scalafmt.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
runner.dialect = scala3

Jenkinsfile

Lines changed: 561 additions & 536 deletions
Large diffs are not rendered by default.

build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,17 @@ plugins {
1010
id 'jacoco' // java code coverage plugin
1111
id "org.sonarqube" version "3.3" // sonarqube
1212
id "com.github.maiflai.scalatest" version "0.32" // run scalatest without specific spec task
13-
id 'org.scoverage' version '7.0.0' // Code coverage plugin for scala
1413
}
1514

1615
ext {
17-
javaVersion = JavaVersion.VERSION_1_8
18-
scalaVersion = '2.13'
19-
scalaBinaryVersion = '2.13.7'
16+
javaVersion = JavaVersion.VERSION_17
17+
scalaVersion = '3'
18+
scalaBinaryVersion = '3.1.0'
2019
scriptsLocation = 'gradle' + File.separator + 'scripts' + File.separator //location of script plugins
2120
}
2221

2322
group = 'com.github.ie3-institute'
24-
version = '1.6'
23+
version = '2.0-SNAPSHOT'
2524
description = 'PowerSystemUtils'
2625
sourceCompatibility = javaVersion
2726
targetCompatibility = javaVersion
@@ -32,7 +31,6 @@ apply from: scriptsLocation + 'spotless.gradle'
3231
apply from: scriptsLocation + 'checkJavaVersion.gradle'
3332
apply from: scriptsLocation + 'jacoco.gradle' // jacoco java code coverage
3433
apply from: scriptsLocation + 'mavenCentralPublish.gradle'
35-
apply from: scriptsLocation + 'scoverage.gradle'
3634
apply from: scriptsLocation + 'sonarqube.gradle'
3735

3836
repositories {
@@ -68,14 +66,16 @@ dependencies {
6866
implementation 'org.apache.commons:commons-compress:1.21' // I/O functionalities
6967

7068
// testing
71-
testImplementation 'org.spockframework:spock-core:1.3-groovy-2.5'
69+
testImplementation 'org.spockframework:spock-core:2.1-M2-groovy-3.0'
70+
7271

7372
/* --- Scala libs --- */
7473
// CORE Scala //
75-
implementation "org.scala-lang:scala-library:${scalaBinaryVersion}"
74+
implementation "org.scala-lang:scala3-library_3:${scalaBinaryVersion}"
75+
implementation 'org.scala-lang.modules:scala-parallel-collections_3:1.0.4'
7676

7777
// TEST Scala //
78-
implementation "org.scalatest:scalatest_${scalaVersion}:3.2.10"
78+
implementation "org.scalatest:scalatest_$scalaVersion:3.2.10"
7979
testRuntimeClasspath 'com.vladsch.flexmark:flexmark-all:0.62.2'
8080
}
8181

gradle.properties

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,20 @@
99

1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
12-
org.gradle.jvmargs=-Xmx4096m
12+
13+
# Workaround to make spotless work with java 17 -
14+
# see https://github.com/diffplug/spotless/tree/main/plugin-gradle#google-java-format and
15+
# https://github.com/ie3-institute/PowerSystemUtils/issues/200 for details
16+
org.gradle.jvmargs=-Xmx4096m \
17+
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
18+
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
19+
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
20+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
21+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
1322

1423
# When configured, Gradle will run in incubating parallel mode.
1524
# This option should only be used with decoupled projects. More details, visit
1625
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1726
# org.gradle.parallel=true
1827

19-
com.github.maiflai.gradle-scalatest.mode = append
28+
com.github.maiflai.gradle-scalatest.mode = append

gradle/scripts/scoverage.gradle

Lines changed: 0 additions & 9 deletions
This file was deleted.

gradle/scripts/sonarqube.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,3 @@ project.tasks["sonarqube"].dependsOn "check"
4848

4949
project.tasks["sonarqube"].dependsOn "jacocoTestReport"
5050
project.tasks["sonarqube"].dependsOn "jacocoTestCoverageVerification"
51-
52-
project.tasks["sonarqube"].dependsOn "reportScoverage"
53-
project.tasks["sonarqube"].dependsOn "checkScoverage"

gradle/scripts/spotless.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ spotless {
1010
//sets a license header, removes unused imports and formats conforming to the google java format
1111
java {
1212
removeUnusedImports() // removes any unused imports
13-
googleJavaFormat()
13+
googleJavaFormat('1.13.0')
1414
licenseHeader ie3LicHead
1515
}
1616

1717
/* cf. https://github.com/diffplug/spotless/tree/master/plugin-gradle */
1818
groovy {
19-
licenseHeader ie3LicHead
20-
excludeJava() // excludes all Java sources within the Groovy source dirs from formatting
19+
target '**.groovy', 'Jenkinsfile'
20+
licenseHeader "#!groovy\n\n" + ie3LicHead, "////////////////////////////////"
2121
// the Groovy Eclipse formatter extends the Java Eclipse formatter,
2222
// so it formats Java files by default (unless `excludeJava` is used).
2323
greclipse()
24+
indentWithSpaces 2
2425
}
2526

2627
groovyGradle {
@@ -31,7 +32,7 @@ spotless {
3132

3233
//sets a license header, removes unused imports and formats conforming to the scala fmt formatter
3334
scala {
34-
scalafmt()
35+
scalafmt('3.0.0').configFile('.scalafmt.conf')
3536
licenseHeader ie3LicHead, "package.*\\n"
3637
}
3738

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/java/edu/ie3/util/io/xmladapter/StringToIntegerListAdapter.java

Lines changed: 0 additions & 74 deletions
This file was deleted.

src/main/java/edu/ie3/util/io/xmladapter/StringToStringListAdapter.java

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)