Skip to content

Commit dbfac1f

Browse files
committed
chore: kotlin 2.1.20-Beta1 update
1 parent b21b6f1 commit dbfac1f

22 files changed

+220
-89
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ The next version will be based on the semantic version scope (`major`, `minor`,
116116
jaegertracing/all-in-one:latest
117117
$ open http://localhost:16686
118118

119+
# Run otel tui
120+
$ brew install ymtdzzz/tap/otel-tui
121+
$ otel-tui
122+
119123
# Run the app
120124
$ docker run -it --rm \
121125
--name jvm \

backend/agent/otel/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ dependencies {
7373
compileOnly(libs.bundles.otel.agent.extn)
7474
compileOnly(libs.google.auto.annotations)
7575
annotationProcessor(libs.google.auto.service.apt)
76+
implementation(libs.otel.samplers)
7677

7778
testImplementation(platform(libs.junit.bom))
7879
testImplementation(libs.junit.jupiter)

backend/jvm/src/main/resources/logback.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<configuration scan="true" scanPeriod="15 seconds" packagingData="true" debug="false">
33
<import class="ch.qos.logback.classic.encoder.JsonEncoder"/>
44
<import class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"/>
5+
<import class="ch.qos.logback.classic.AsyncAppender"/>
56
<import class="ch.qos.logback.core.rolling.RollingFileAppender"/>
67
<import class="ch.qos.logback.core.FileAppender"/>
78
<import class="ch.qos.logback.core.ConsoleAppender"/>
@@ -48,6 +49,11 @@
4849
</encoder>
4950
</appender>
5051

52+
<!--appender name="ASYNC-APP1" class="AsyncAppender">
53+
<appender-ref ref="APP1"/>
54+
<neverBlock>true</neverBlock>
55+
</appender-->
56+
5157
<appender name="JSON" class="RollingFileAppender">
5258
<file>${LOG_DIR}/app.json</file>
5359
<rollingPolicy class="TimeBasedRollingPolicy">
@@ -95,8 +101,9 @@
95101

96102
<root level="INFO">
97103
<appender-ref ref="STDOUT"/>
98-
<!--appender-ref ref="OTEL"/-->
104+
<!-- appender-ref ref="OTEL"/-->
99105
<!-- appender-ref ref="JSON"/-->
106+
<!-- appender-ref ref="ASYNC-APP1" /-->
100107
</root>
101108

102109
<logger name="dev.suresh" level="INFO" additivity="false">

backend/native/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ tasks {
122122
val linkReleaseExecutableMacosArm64 by getting(KotlinNativeLink::class)
123123

124124
val macOsUniversalBinary by
125-
creating(Exec::class) {
125+
registering(Exec::class) {
126126
val binName = "${project.name}-macos"
127127
dependsOn(linkReleaseExecutableMacosX64, linkReleaseExecutableMacosArm64)
128128
commandLine(

gradle.properties

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ kotlin.js.yarn=false
3131
kotlin.incremental.native=true
3232
kotlin.native.binary.gc=cms
3333
kotlin.native.ignoreDisabledTargets=true
34-
kotlin.mpp.enableCInteropCommonization=true
34+
# kotlin.mpp.enableCInteropCommonization=true
3535

3636
## Dokka
3737
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
3838
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
39+
org.jetbrains.dokka.experimental.tryK2=true
40+
org.jetbrains.dokka.experimental.tryK2.nowarn=true
3941

4042
## KSP
4143
ksp.useKSP2=true
@@ -63,5 +65,6 @@ enableMavenSnapshot=false
6365
# Other projects
6466
composeBuild=true
6567
springBoot=false
66-
nativeBuild=false
68+
nativeBuild=true
69+
nativeWinTarget=false
6770
debug=false

gradle/build-logic/src/main/kotlin/common/Multiplatform.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ fun KotlinNativeCompilerOptions.configureKotlinNative() {
264264
// freeCompilerArgs.addAll("-Xverbose-phases=Linker", "-Xruntime-logs=gc=info")
265265
}
266266

267-
fun KotlinMultiplatformExtension.allNativeTargets(configure: KotlinNativeTarget.() -> Unit = {}) {
267+
fun KotlinMultiplatformExtension.allNativeTargets(winTarget: Boolean = false, configure: KotlinNativeTarget.() -> Unit = {}) {
268268
fun KotlinNativeTarget.configureAll() {
269269
// KotlinNativeTargetWithHostTests
270270
compilerOptions { configureKotlinNative() }
@@ -282,7 +282,9 @@ fun KotlinMultiplatformExtension.allNativeTargets(configure: KotlinNativeTarget.
282282
macosArm64 { configureAll() }
283283
linuxX64 { configureAll() }
284284
linuxArm64 { configureAll() }
285-
mingwX64 { configureAll() }
285+
if(winTarget) {
286+
mingwX64 { configureAll() }
287+
}
286288
}
287289

288290
fun KotlinMultiplatformExtension.addKspDependencyForAllTargets(

gradle/build-logic/src/main/kotlin/dev.suresh.plugin.graalvm.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ configurations {
162162

163163
tasks {
164164
val archiveTgz by
165-
creating(Tar::class) {
165+
registering(Tar::class) {
166166
archiveFileName = niArchiveName
167167
compression = Compression.GZIP
168168
destinationDirectory = project.layout.buildDirectory

gradle/build-logic/src/main/kotlin/dev.suresh.plugin.kotlin.docs.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ dokka {
5454

5555
documentedVisibilities = setOf(VisibilityModifier.Public)
5656

57-
samples.from("src/test/kotlin")
58-
5957
externalDocumentationLinks {
6058
register("kotlinx.coroutines") { url("https://kotlinlang.org/api/kotlinx.coroutines/") }
6159
register("kotlinx.serialization") { url("https://kotlinlang.org/api/kotlinx.serialization/") }
@@ -66,6 +64,9 @@ dokka {
6664
register("ktor") { url("https://api.ktor.io/") }
6765
}
6866

67+
// https://github.com/Kotlin/dokka/issues/3373
68+
// samples.from("src/test/kotlin")
69+
6970
// dokkaPublicationDirectory = rootProject.layout.buildDirectory.dir("dokkaDir")
7071
}
7172

@@ -86,7 +87,6 @@ spotless {
8687
// googleJavaFormat(libs.versions.google.javaformat.get())
8788
palantirJavaFormat(libs.versions.palantir.javaformat.get()).formatJavadoc(true)
8889
target("**/*.java_disabled")
89-
targetExclude("**/build/**")
9090
}
9191
// if(plugins.hasPlugin(JavaPlugin::class.java)){ }
9292

gradle/build-logic/src/main/kotlin/dev.suresh.plugin.kotlin.jvm.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,21 @@ tasks {
113113
}
114114

115115
processResources {
116-
inputs.property("version", project.version.toString())
116+
val version = project.version.toString()
117+
val rootProjectName = rootProject.name
118+
val moduleName = project.name
119+
120+
inputs.property("version", version)
117121
filesMatching("**/*-res.txt") {
118122
expand(
119-
"name" to rootProject.name,
120-
"module" to project.name,
121-
"version" to project.version,
123+
"name" to rootProjectName,
124+
"module" to moduleName,
125+
"version" to version,
122126
)
123127
}
124128
filesMatching("**/*.yaml") {
125129
filter { line ->
126-
line
127-
.replace("{project.name}", rootProject.name)
128-
.replace("{project.version}", project.version.toString())
130+
line.replace("{project.name}", rootProjectName).replace("{project.version}", version)
129131
}
130132
}
131133
}

gradle/build-logic/src/main/kotlin/dev.suresh.plugin.kotlin.mpp.gradle.kts

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
1313
import org.jetbrains.kotlin.gradle.targets.js.nodejs.*
1414
import org.jetbrains.kotlin.gradle.targets.js.npm.*
1515
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask
16-
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
1716
import tasks.*
1817

1918
plugins {
@@ -35,6 +34,7 @@ plugins {
3534
}
3635

3736
val nativeBuild: String? by project
37+
val nativeWinTarget: String? by project
3838

3939
kotlin {
4040
commonTarget(project)
@@ -44,7 +44,7 @@ kotlin {
4444
jsTarget(project)
4545
wasmJsTarget(project)
4646
if (nativeBuild.toBoolean()) {
47-
allNativeTargets {}
47+
allNativeTargets(winTarget = nativeWinTarget.toBoolean()) {}
4848
}
4949
}
5050

@@ -55,23 +55,23 @@ kotlin {
5555
}
5656
}
5757

58-
applyDefaultHierarchyTemplate {
59-
common {
60-
group("posix") {
61-
// Using group will add the intermediate source sets
62-
group("linux")
63-
group("apple")
64-
}
65-
66-
group("jsCommon") {
67-
withJs()
68-
withWasmJs()
69-
}
70-
}
71-
}
72-
73-
// To configure specific targets
74-
targets.withType<KotlinJvmTarget>().configureEach { compilerOptions {} }
58+
// applyDefaultHierarchyTemplate {
59+
// common {
60+
// group("posix") {
61+
// // Using group will add the intermediate source sets
62+
// group("linux")
63+
// group("apple")
64+
// }
65+
//
66+
// group("jsCommon") {
67+
// withJs()
68+
// withWasmJs()
69+
// }
70+
// }
71+
// }
72+
73+
// ==== To configure specific targets ====
74+
// targets.withType<KotlinJvmTarget>().configureEach { compilerOptions {} }
7575
// targets.matching { it.platformType == js }.configureEach { apply(plugin = ...) }
7676

7777
// kotlinDaemonJvmArgs = jvmArguments
@@ -134,19 +134,21 @@ tasks {
134134
}
135135

136136
withType<ProcessResources>().configureEach {
137-
inputs.property("version", project.version.toString())
137+
val version = project.version.toString()
138+
val rootProjectName = rootProject.name
139+
val moduleName = project.name
140+
141+
inputs.property("version", version)
138142
filesMatching("**/*-res.txt") {
139143
expand(
140-
"name" to rootProject.name,
141-
"module" to project.name,
142-
"version" to project.version,
144+
"name" to rootProjectName,
145+
"module" to moduleName,
146+
"version" to version,
143147
)
144148
}
145149
filesMatching("**/*.yaml") {
146150
filter { line ->
147-
line
148-
.replace("{project.name}", rootProject.name)
149-
.replace("{project.version}", project.version.toString())
151+
line.replace("{project.name}", rootProjectName).replace("{project.version}", version)
150152
}
151153
}
152154
}

0 commit comments

Comments
 (0)