Skip to content

Commit

Permalink
Upgrade gradle, kotlin, mockito, mockito-kt
Browse files Browse the repository at this point in the history
Gradle 7.4.2 -> 8.9
Kotlin 1.7.10 -> 1.9.25
Mockito 2.2.11 -> 5.12.0
Mockito-kotlin add 5.4.0
  • Loading branch information
RipplB committed Jul 23, 2024
1 parent 27398b9 commit 951c049
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 34 deletions.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
Expand All @@ -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")
}
}

Expand All @@ -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 ->
Expand Down
18 changes: 6 additions & 12 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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

Expand Down Expand Up @@ -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()
}
Expand Down
5 changes: 3 additions & 2 deletions buildSrc/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/jacoco-common.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ extensions.configure<JacocoPluginExtension> {
toolVersion = Versions.jacoco
}

tasks.withType(JacocoReport::class.java).all {
tasks.withType<JacocoReport>().configureEach {
reports {
xml.isEnabled = true
xml.required.set(true)
}
}
}
9 changes: 6 additions & 3 deletions buildSrc/src/main/kotlin/java-common.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply<JavaPlugin>()
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
Expand All @@ -33,6 +35,7 @@ dependencies {
testImplementation(Deps.junit5param)
testImplementation(Deps.junit5engine)
testImplementation(Deps.Mockito.core)
testImplementation(Deps.Mockito.extension)
}

tasks {
Expand Down
6 changes: 4 additions & 2 deletions buildSrc/src/main/kotlin/kotlin-common.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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<KotlinPlatformJvmPlugin>()
plugins {
kotlin("jvm")
}
dependencies {
val implementation: Configuration by configurations
implementation(Deps.Kotlin.stdlib)
implementation(Deps.Kotlin.reflect)
implementation(Deps.Mockito.kotlin)
}
tasks {
withType<KotlinCompile>() {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion subprojects/cfa/cfa-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ dependencies {
}

application {
mainClassName = "hu.bme.mit.theta.cfa.cli.CfaCli"
mainClass.set("hu.bme.mit.theta.cfa.cli.CfaCli")
}
2 changes: 1 addition & 1 deletion subprojects/solver/solver-smtlib-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
2 changes: 1 addition & 1 deletion subprojects/sts/sts-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ dependencies {
}

application {
mainClassName = "hu.bme.mit.theta.sts.cli.StsCli"
mainClass.set("hu.bme.mit.theta.sts.cli.StsCli")
}
2 changes: 1 addition & 1 deletion subprojects/xcfa/xcfa-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ dependencies {
}

application {
mainClassName = "hu.bme.mit.theta.xcfa.cli.XcfaCli"
mainClass.set("hu.bme.mit.theta.xcfa.cli.XcfaCli")
}

2 changes: 1 addition & 1 deletion subprojects/xsts/xsts-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ dependencies {
}

application {
mainClassName = "hu.bme.mit.theta.xsts.cli.XstsCli"
mainClass.set("hu.bme.mit.theta.xsts.cli.XstsCli")
}
2 changes: 1 addition & 1 deletion subprojects/xta/xta-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ dependencies {
}

application {
mainClassName = "hu.bme.mit.theta.xta.cli.XtaCli"
mainClass.set("hu.bme.mit.theta.xta.cli.XtaCli")
}

0 comments on commit 951c049

Please sign in to comment.