Skip to content

Commit a2e529b

Browse files
committed
chore: new kopy plugin update
1 parent f8fe1c9 commit a2e529b

File tree

5 files changed

+19
-32
lines changed

5 files changed

+19
-32
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import com.github.ajalt.mordant.rendering.TextColors
22
import com.google.cloud.tools.jib.gradle.BuildDockerTask
33
import com.google.devtools.ksp.gradle.KspAATask
4-
import com.javiersc.kotlin.kopy.args.KopyFunctions
54
import common.*
65
import java.io.PrintWriter
76
import java.io.StringWriter
@@ -19,7 +18,6 @@ plugins {
1918
com.google.devtools.ksp
2019
dev.zacsweers.redacted
2120
com.javiersc.kotlin.kopy
22-
org.jetbrains.kotlinx.atomicfu
2321
id("dev.suresh.plugin.common")
2422
id("dev.suresh.plugin.kotlin.docs")
2523
// kotlin("plugin.atomicfu")
@@ -64,11 +62,6 @@ testing {
6462
}
6563
}
6664

67-
atomicfu {
68-
transformJvm = true
69-
jvmVariant = "VH"
70-
}
71-
7265
ksp {
7366
arg("autoserviceKsp.verify", "true")
7467
arg("autoserviceKsp.verbose", "true")
@@ -82,7 +75,11 @@ redacted {
8275
replacementString = ""
8376
}
8477

85-
kopy { functions = KopyFunctions.Copy }
78+
kopy {
79+
copyFunctions = listOf(KopyCopyFunctions.Copy)
80+
// debug = false
81+
// reportPath = layout.buildDirectory.dir("reports/kopy")
82+
}
8683

8784
// Java agent configuration for jib
8885
val javaAgent by configurations.registering { isTransitive = false }

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
55
import com.google.devtools.ksp.gradle.KspAATask
6-
import com.javiersc.kotlin.kopy.args.KopyFunctions
76
import common.*
87
import kotlinx.validation.*
98
import org.gradle.internal.os.OperatingSystem
@@ -23,7 +22,6 @@ plugins {
2322
com.google.devtools.ksp
2423
dev.zacsweers.redacted
2524
com.javiersc.kotlin.kopy
26-
org.jetbrains.kotlinx.atomicfu
2725
// kotlin("plugin.atomicfu")
2826
// kotlin("plugin.compose")
2927
// io.github.terrakok.`kmp-hierarchy`
@@ -74,11 +72,6 @@ kotlin {
7472
// explicitApiWarning()
7573
}
7674

77-
atomicfu {
78-
transformJvm = true
79-
jvmVariant = "VH"
80-
}
81-
8275
ksp {
8376
arg("autoserviceKsp.verify", "true")
8477
arg("autoserviceKsp.verbose", "true")
@@ -93,7 +86,11 @@ redacted {
9386
replacementString = ""
9487
}
9588

96-
kopy { functions = KopyFunctions.Copy }
89+
kopy {
90+
copyFunctions = listOf(KopyCopyFunctions.Copy)
91+
// debug = false
92+
// reportPath = layout.buildDirectory.dir("reports/kopy")
93+
}
9794

9895
tasks {
9996
val buildConfigExtn = extensions.create<BuildConfigExtension>("buildConfig")

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ kotlinx-dataframe = "0.16.0-dev-6361"
4747
kotlinx-kandy = "0.8.0"
4848
kotlin-statistics = "0.4.0-RC1"
4949
evas = "1.2.0"
50-
kopy = "0.14.0+2.1.10"
50+
kopy = "0.15.0+2.1.20"
5151
poko = "0.18.2"
5252
mappie = "1.1.1"
5353
akkurate = "0.11.0"
5454
kaml = "0.73.0"
5555
snakeyaml-engine-kmp = "3.1.1"
5656
konsist = "0.17.3"
57-
spring-boot = "3.4.3"
57+
spring-boot = "3.4.4"
5858
spring-depmgmt = "1.1.7"
5959
ktor = "3.1.1"
6060
ktor-cohort = "2.6.1"
@@ -194,7 +194,7 @@ jetbrains-compose-adaptive = "1.1.0-beta01"
194194
kobweb = "0.20.4"
195195
detekt = "1.23.8"
196196
detekt-compose-rules = "0.4.22"
197-
compose-hotreload = "1.0.0-alpha02"
197+
compose-hotreload = "1.0.0-alpha03"
198198
compose-icons = "1.1.1"
199199
compose-routing = "0.4.0"
200200
kottie = "2.0.1"

shared/src/commonMain/kotlin/dev/suresh/Greeting.kt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import dev.suresh.serde.toJsonElement
66
import kotlin.concurrent.atomics.*
77
import kotlin.time.Duration.Companion.seconds
88
import kotlin.uuid.Uuid
9-
import kotlinx.atomicfu.locks.*
109
import kotlinx.serialization.json.Json
1110

1211
class Greeting {
@@ -26,7 +25,7 @@ class Greeting {
2625
Address(
2726
street = "123 Main St", city = "San Francisco", state = "CA", zip = "95000"),
2827
privateInfo = PrivateInfo(ssn = "123-45-6789", dob = "01/01/2000"))
29-
val modPerson = person.copy() // { address.city = "San Jose" }
28+
val modPerson = person.copy { address.city = "San Jose" }
3029
appendLine("Person: $person")
3130
appendLine("Modified Person: $modPerson")
3231
}
@@ -38,8 +37,6 @@ class Greeting {
3837
a.doWork(1234)
3938
appendLine("Final value: ${a.x}")
4039
check(a.x == 1234)
41-
check(a.synchronizedFoo(42) == 42)
42-
appendLine("Synchronized foo: ${a.synchronizedFoo(42)}")
4340
}
4441

4542
private fun kotlinxTests(): String {
@@ -89,9 +86,6 @@ class Greeting {
8986
}
9087

9188
class AtomicSample {
92-
93-
private val lock = reentrantLock()
94-
9589
private val _x = AtomicInt(0)
9690

9791
val x
@@ -103,8 +97,6 @@ class AtomicSample {
10397
check(x == 3)
10498
check(_x.compareAndSet(3, finalValue))
10599
}
106-
107-
fun synchronizedFoo(value: Int) = lock.withLock { value }
108100
}
109101

110102
enum class YesNo {
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package dev.suresh.lang
22

3+
import com.javiersc.kotlin.kopy.Kopy
34
import dev.zacsweers.redacted.annotations.Redacted
45

5-
data class Person(val name: Name, val address: Address, val privateInfo: PrivateInfo)
6+
@Kopy data class Person(val name: Name, val address: Address, val privateInfo: PrivateInfo)
67

7-
data class Name(val first: String, val last: String)
8+
@Kopy data class Name(val first: String, val last: String)
89

9-
data class Address(val street: String, val city: String, val state: String, val zip: String)
10+
@Kopy data class Address(val street: String, val city: String, val state: String, val zip: String)
1011

11-
data class PrivateInfo(@Redacted val ssn: String, @Redacted val dob: String)
12+
@Kopy data class PrivateInfo(@Redacted val ssn: String, @Redacted val dob: String)

0 commit comments

Comments
 (0)