diff --git a/build.gradle.kts b/build.gradle.kts index 834767ac52..c9055cf1fb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,7 +28,7 @@ buildscript { allprojects { group = "hu.bme.mit.theta" - version = "6.0.0" + version = "6.0.1" apply(from = rootDir.resolve("gradle/shared-with-buildSrc/mirrors.gradle.kts")) } @@ -39,7 +39,7 @@ sonar { property("sonar.organization", "ftsrg-github") property("sonar.host.url", "https://sonarcloud.io") property("sonar.coverage.jacoco.xmlReportPaths", - "${project.buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml") + "${project.layout.buildDirectory.asFile.get()}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml") } } @@ -51,9 +51,9 @@ tasks { description = "Generates merged code coverage report for all test tasks." reports { - html.isEnabled = false - xml.isEnabled = true - csv.isEnabled = false + html.required.set(false) + xml.required.set(true) + csv.required.set(false) } val reportTasks = subprojects.mapNotNull { subproject -> diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 36b1f85544..093b423f12 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -29,10 +28,6 @@ repositories { apply(from = rootDir.resolve("../gradle/shared-with-buildSrc/mirrors.gradle.kts")) -kotlinDslPluginOptions { - experimentalWarning.set(false) -} - val kotlinVersion: String by project val shadowVersion: String by project @@ -60,30 +55,29 @@ configurations.all { } val versionsClassName = "Versions" -val generatedVersionsKotlinSrcDir = buildDir.resolve("generated-sources/versions/kotlin") +val generatedVersionsKotlinSrcDir = layout.buildDirectory.dir("generated-sources/versions/kotlin").get().asFile val generatedVersionsFile = generatedVersionsKotlinSrcDir.resolve("$versionsClassName.kt") sourceSets { named("main") { - withConvention(KotlinSourceSet::class) { - kotlin.srcDir(generatedVersionsKotlinSrcDir) - } + kotlin.srcDir(generatedVersionsKotlinSrcDir) } } + fun generateVersionsSource(): String { val text = StringBuilder() - text.appendln("object $versionsClassName {") + text.appendLine("object $versionsClassName {") for (property in project.properties) { if (property.key.endsWith("Version")) { val keyWithoutVersion = property.key.substringBefore("Version") - text.appendln(" const val `$keyWithoutVersion` = \"${property.value}\"") + text.appendLine(" const val `$keyWithoutVersion` = \"${property.value}\"") } } - text.appendln("}") + text.appendLine("}") return text.toString() } diff --git a/buildSrc/gradle.properties b/buildSrc/gradle.properties index 499eb7e837..ecd967b559 100644 --- a/buildSrc/gradle.properties +++ b/buildSrc/gradle.properties @@ -15,7 +15,7 @@ # javaVersion=17 -kotlinVersion=1.7.10 +kotlinVersion=1.9.25 shadowVersion=7.1.2 antlrVersion=4.9.2 guavaVersion=31.1-jre @@ -24,7 +24,8 @@ z3Version=4.5.0 junitVersion=5.9.3 junit4Version=4.12 jacocoVersion=0.8.8 -mockitoVersion=2.2.11 +mockitoVersion=5.12.0 +mockitoKotlinVersion=5.4.0 pnmlFrameworkVersion=2.2.12 emfCommonVersion=2.10.1 emfCodegenVersion=2.10.0 diff --git a/buildSrc/src/main/kotlin/Deps.kt b/buildSrc/src/main/kotlin/Deps.kt index ab28cb0deb..652a9f0678 100644 --- a/buildSrc/src/main/kotlin/Deps.kt +++ b/buildSrc/src/main/kotlin/Deps.kt @@ -68,6 +68,8 @@ object Deps { object Mockito { val core = "org.mockito:mockito-core:${Versions.mockito}" + val extension = "org.mockito:mockito-junit-jupiter:${Versions.mockito}" + val kotlin = "org.mockito.kotlin:mockito-kotlin:${Versions.mockitoKotlin}" } object Kotlin { diff --git a/buildSrc/src/main/kotlin/jacoco-common.gradle.kts b/buildSrc/src/main/kotlin/jacoco-common.gradle.kts index 74e95ad419..4f8c7b9522 100644 --- a/buildSrc/src/main/kotlin/jacoco-common.gradle.kts +++ b/buildSrc/src/main/kotlin/jacoco-common.gradle.kts @@ -19,8 +19,8 @@ extensions.configure { toolVersion = Versions.jacoco } -tasks.withType(JacocoReport::class.java).all { +tasks.withType().configureEach { reports { - xml.isEnabled = true + xml.required.set(true) } -} \ No newline at end of file +} diff --git a/buildSrc/src/main/kotlin/java-common.gradle.kts b/buildSrc/src/main/kotlin/java-common.gradle.kts index 4981d2394a..48a37e8235 100644 --- a/buildSrc/src/main/kotlin/java-common.gradle.kts +++ b/buildSrc/src/main/kotlin/java-common.gradle.kts @@ -13,9 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -apply() -apply(plugin = "jacoco-common") -apply(plugin = "maven-artifact") +plugins { + java + id("jacoco-common") + id("maven-publish") // The correct plugin id for maven-related tasks +} dependencies { val implementation: Configuration by configurations @@ -33,6 +35,7 @@ dependencies { testImplementation(Deps.junit5param) testImplementation(Deps.junit5engine) testImplementation(Deps.Mockito.core) + testImplementation(Deps.Mockito.extension) } tasks { diff --git a/buildSrc/src/main/kotlin/kotlin-common.gradle.kts b/buildSrc/src/main/kotlin/kotlin-common.gradle.kts index cf53f36826..59eef2f722 100644 --- a/buildSrc/src/main/kotlin/kotlin-common.gradle.kts +++ b/buildSrc/src/main/kotlin/kotlin-common.gradle.kts @@ -13,15 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin import org.jetbrains.kotlin.gradle.tasks.KotlinCompile apply(plugin = "java-common") -apply() +plugins { + kotlin("jvm") +} dependencies { val implementation: Configuration by configurations implementation(Deps.Kotlin.stdlib) implementation(Deps.Kotlin.reflect) + implementation(Deps.Mockito.kotlin) } tasks { withType() { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fceae..19cfad969b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/subprojects/cfa/cfa-cli/build.gradle.kts b/subprojects/cfa/cfa-cli/build.gradle.kts index d3f5e363cb..bb62725072 100644 --- a/subprojects/cfa/cfa-cli/build.gradle.kts +++ b/subprojects/cfa/cfa-cli/build.gradle.kts @@ -30,5 +30,5 @@ dependencies { } application { - mainClassName = "hu.bme.mit.theta.cfa.cli.CfaCli" + mainClass.set("hu.bme.mit.theta.cfa.cli.CfaCli") } diff --git a/subprojects/solver/solver-smtlib-cli/build.gradle.kts b/subprojects/solver/solver-smtlib-cli/build.gradle.kts index a7a8734efd..95cbb948f4 100644 --- a/subprojects/solver/solver-smtlib-cli/build.gradle.kts +++ b/subprojects/solver/solver-smtlib-cli/build.gradle.kts @@ -25,5 +25,5 @@ dependencies { } application { - mainClassName = "hu.bme.mit.theta.solver.smtlib.cli.SmtLibCli" + mainClass.set("hu.bme.mit.theta.solver.smtlib.cli.SmtLibCli") } diff --git a/subprojects/sts/sts-cli/build.gradle.kts b/subprojects/sts/sts-cli/build.gradle.kts index 66685b6eb5..cb1eedf2e2 100644 --- a/subprojects/sts/sts-cli/build.gradle.kts +++ b/subprojects/sts/sts-cli/build.gradle.kts @@ -29,5 +29,5 @@ dependencies { } application { - mainClassName = "hu.bme.mit.theta.sts.cli.StsCli" + mainClass.set("hu.bme.mit.theta.sts.cli.StsCli") } diff --git a/subprojects/xcfa/xcfa-cli/build.gradle.kts b/subprojects/xcfa/xcfa-cli/build.gradle.kts index dc92ba6f04..f695b775af 100644 --- a/subprojects/xcfa/xcfa-cli/build.gradle.kts +++ b/subprojects/xcfa/xcfa-cli/build.gradle.kts @@ -48,6 +48,6 @@ dependencies { } application { - mainClassName = "hu.bme.mit.theta.xcfa.cli.XcfaCli" + mainClass.set("hu.bme.mit.theta.xcfa.cli.XcfaCli") } diff --git a/subprojects/xsts/xsts-cli/build.gradle.kts b/subprojects/xsts/xsts-cli/build.gradle.kts index f73e672db1..1016451f40 100644 --- a/subprojects/xsts/xsts-cli/build.gradle.kts +++ b/subprojects/xsts/xsts-cli/build.gradle.kts @@ -33,5 +33,5 @@ dependencies { } application { - mainClassName = "hu.bme.mit.theta.xsts.cli.XstsCli" + mainClass.set("hu.bme.mit.theta.xsts.cli.XstsCli") } diff --git a/subprojects/xta/xta-cli/build.gradle.kts b/subprojects/xta/xta-cli/build.gradle.kts index 8c5551b6d9..5e0a67ed33 100644 --- a/subprojects/xta/xta-cli/build.gradle.kts +++ b/subprojects/xta/xta-cli/build.gradle.kts @@ -29,5 +29,5 @@ dependencies { } application { - mainClassName = "hu.bme.mit.theta.xta.cli.XtaCli" + mainClass.set("hu.bme.mit.theta.xta.cli.XtaCli") }