Skip to content

Commit

Permalink
build: update all the things (#109)
Browse files Browse the repository at this point in the history
Also trying to remove as many build warnings as possible in the process
  • Loading branch information
lucapette authored Jan 31, 2025
1 parent af5c433 commit c6e92ff
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 31 deletions.
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ repositories {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24")
implementation("org.jetbrains.kotlin:kotlin-serialization:1.9.24")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.0")
implementation("org.jetbrains.kotlin:kotlin-serialization:2.1.0")
implementation("com.adarshr:gradle-test-logger-plugin:4.0.0")
implementation("org.jetbrains.kotlinx:kover:0.6.1")
}
42 changes: 23 additions & 19 deletions buildSrc/src/main/kotlin/typestream.kotlin-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.adarshr.gradle.testlogger.theme.ThemeType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
Expand All @@ -15,40 +14,45 @@ repositories {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.24")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.9.24")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.5.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.6.3")
implementation("org.jetbrains.kotlin:kotlin-stdlib:2.1.0")
implementation("org.jetbrains.kotlin:kotlin-reflect:2.1.0")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.10.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.8.0")

implementation("io.github.oshai:kotlin-logging-jvm:5.1.0")
implementation("io.github.oshai:kotlin-logging-jvm:7.0.3")

testImplementation(kotlin("test"))
testImplementation("org.assertj:assertj-core:3.24.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.1")
testImplementation("org.assertj:assertj-core:3.27.3")
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("nz.lae.stacksrc:stacksrc-junit5:0.6.0")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test-jvm:1.7.3")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.1")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test-jvm:1.10.1")
}

tasks.test {
useJUnitPlatform()
systemProperty("junit.jupiter.extensions.autodetection.enabled", true)
// see https://github.com/mockito/mockito/issues/3111#issuecomment-2362647742
jvmArgs(listOf("-XX:+EnableDynamicAgentLoading", "-Xshare:off"))
}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
kotlin {
jvmToolchain(21)

target {
compilerOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
}
}
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

testlogger {
Expand Down
8 changes: 3 additions & 5 deletions buildSrc/src/main/kotlin/typestream.version-info.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import java.io.ByteArrayOutputStream
import java.util.Properties

//TODO It would be nice to package the task and the code it depends on in the same place. (e.g. the libs/version-info project)
Expand All @@ -7,12 +6,11 @@ tasks.register("createProperties") {

doLast {
val propertiesFile = File("${layout.buildDirectory.get()}/resources/main/version-info.properties")
val stdout = ByteArrayOutputStream()
rootProject.exec {
val gitCommand = providers.exec {
isIgnoreExitValue = true
commandLine("git", "rev-parse", "--verify", "--short", "HEAD")
standardOutput = stdout
}
val commitHash = stdout.toString().trim()
val commitHash = gitCommand.standardOutput.asText.get().trim()

propertiesFile.bufferedWriter().use { writer ->
val properties = Properties()
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ dependencyResolutionManagement {
version("grpcKotlin", "1.3.1")
version("kafka", "3.1.0")
version("kubernetes-client", "6.9.0")
version("okhttp", "4.11.0")
version("okhttp", "4.12.0")
version("mockk", "1.13.9")
version("protobuf", "3.24.2")
version("rocksdbjni", "6.29.4.1")
version("slf4j", "2.0.7")
version("testcontainers", "1.19.0")
version("testcontainers", "1.20.4")

library("avro", "org.apache.avro", "avro").versionRef("avro")
library("grpc-netty", "io.grpc", "grpc-netty").versionRef("grpc")
Expand Down
9 changes: 6 additions & 3 deletions stub/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ sourceSets {
main.java.srcDirs("build/generated/source/proto/main/grpckt")
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
kotlinOptions {
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")

kotlin {
target {
compilerOptions {
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
}
}
}

Expand Down

0 comments on commit c6e92ff

Please sign in to comment.