Doni Winata
01/31/2023, 7:42 AMLukas Anda
02/02/2023, 9:40 AMTower Guidev2
02/03/2023, 10:04 AMConfiguration 'kspProductionDebugKotlinProcessorClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See <https://github.com/gradle/gradle/issues/2298>
Yang
02/04/2023, 9:06 AMkotlin.incremental=false
so please let me know if I should report on YouTrack instead.Big Chungus
02/06/2023, 2:22 PMAhmed na
02/06/2023, 11:30 PMKSClassDeclaration
for type ClassKind.ENUM_CLASS
is it possible to get the names of the enums ?josel
02/07/2023, 5:08 AMjean
02/08/2023, 9:04 AMgeneratedByKspCommonMainKotlinMetadata
? When I use the automatic import from IntelliJ, it adds implementation(project(mapOf("path" to ":")))
which doesn’t worktrevjones
02/10/2023, 6:30 PMelye
02/13/2023, 12:46 PMZac Sweers
02/14/2023, 6:27 AMSlackbot
02/20/2023, 6:01 PMJerv Norsk
02/21/2023, 10:28 AMTristan
02/21/2023, 5:15 PMdata class
, compiler will generate some standard code. With suspend
it will perform some transformation as well. Same with inline
.
That’s for keywords, but there are also @Compose
for Jetpack Compose and @Serializable
for Kotlinx.serialization.
The last one is really cool. It will generate all of what is needed for de/serialization, and methods such as Json.decodeFromString<Person>(string)
are showing errors right away in the IDE if Person is not annotated with Serializable
. This does not use KSP (I think), but a compiler plugin.
Would KSP be able to reproduce the same experience before execution?
import com.me.WithMyFeature
import com.me.useFeature
@WithMyFeature
class Dog
class Person
val dog = Dog()
val person = Person()
dog.useFeature() // No issue
person.useFeature() // Issue
I saw this kind of solution, but that would only work at runtime :/
@Suppress("UNUSED_PARAMETER")
fun Any.useFeature() {
throw NotImplementedError("missing implementation")
}
Vladimir Tagakov
02/22/2023, 2:44 AMprocess
function and should be freed after exiting. So it is highly unlikely that there is a memory leak on our side 😞
We are comparing Kotlin + javac annotation processing with Kotlin + KSP annotation processing and the difference in peak memory consumption for the whole build is:
• For Kotlin+Javac: 39.5 Gb
• For Kotlin+KSP: 62.5 Gb
Both setups are using Bazel
workers, to verify that it is a memory leak we changed strategy to local
(which is basically starts new instance of kotlinc for every module instead of using long running daemons) and the memory usage felt back to normal values (still slightly more with KSP but tolerable)
Can someone help me with triaging this issue and give me a clue how to run some diagnostics so I’ll be able to create a proper bug report?
Was fixed by: https://github.com/google/ksp/pull/1067agrosner
02/23/2023, 1:49 PMVladimir Tagakov
02/24/2023, 1:38 AMCollectAnnotatedSymbolsVisitor
appropriately.
But maybe you think it is a good idea to introduce an annotations()
fun like javac processors have and infer what exactly should be visited with given set of KSP processors and all annotations they aim to use?trevjones
02/24/2023, 5:26 PMUli Bubenheimer
02/25/2023, 8:41 PM@MyIntThing(1) // correct
@MyIntThing(1,2) // no
@MyIntThing("nope")
@MyIntThing(1) @MyIntThing(2) //no, it's not repeatable
@MyIntThing(1L) // no, really
Ahmed na
02/28/2023, 12:12 AM@MyAnnotatoin
data class A(){
fun b(): MyAnnotatoinGeneratedClass {
return MyAnnotatoinGeneratedClass()
}
}
where MyAnnotatoinGeneratedClass
is a class that was generated by @MyAnnotation
Ofc i'm getting not resolved right nowelye
03/01/2023, 9:23 AM--verbose
mode through IntelliJ or Android Studio?
I post the question in https://stackoverflow.com/questions/75601653/how-to-set-verbose-in-intellij-android-studio-for-ksp-debugging-purposes too. Thanks 🙏Richard Glen
03/02/2023, 5:54 AMjean
03/03/2023, 10:33 AM@MyAnnotation
class MyConfig : Config {
override val configField1: String = "a"
override val configField2: String = "b"
}
Is it possible to get “a” out of ksClassDeclaration?Derek Ellis
03/03/2023, 9:18 PMCharlie Tapping
03/06/2023, 5:27 PMGaurav Dhingra
03/07/2023, 10:26 AMmyProject
- api
- engine
- methods
- build.gradle.kts
dependencies {
implementation(project(":engine"))
implementation(project(":methodsProcessor"))
testImplementation(kotlin("test"))
testImplementation(testFixtures(project(":engine")))
testImplementation("org.junit.jupiter:junit-jupiter-params:5.8.2")
ksp(project(":methodsProcessor"))
}
- build
- generated
- ksp
- main
- kotlin
- methods
- PublicMethods.kt
- test ## I don't want this directory to be created at all
- kotlin
- methods
- PublicMethods.kt
- methodsProcessor
- build.gradle.kts (contents below)
dependencies {
implementation(libs.ksp.api)
}
- src.main.kotlin.processor.MethodsProcessor
## this file has a SymbolProcessor which creates a new file (PublicMethods.kt) in
## `methods/build/generated/ksp/main/kotlin/methods` &
## `methods/build/generated/ksp/test/kotlin/methods` (THIS I would like not to be created)
- build.gradle.kts
- settings.gradle.kts
rootProject.name = "myProject"
include("engine")
include("methods")
include("api")
include("methodsProcessor")
val kotlinVersion: String by settings
val kspVersion: String by settings
pluginManagement {
plugins {
// For some reason the global variables are not accessible here
val kotlinVersion: String by settings
val kspVersion: String by settings
kotlin("jvm") version kotlinVersion
kotlin("plugin.jpa") version kotlinVersion
kotlin("plugin.spring") version kotlinVersion
id("com.google.devtools.ksp") version kspVersion
}
}
dependencyResolutionManagement {
repositories {
mavenCentral()
}
versionCatalogs {
create("libs") {
library("ksp-api", "com.google.devtools.ksp😒ymbol-processing-api:$kspVersion")
}
}
}
```
When I run `./gradlew build` for my project, the output on the terminal looks like:
```> Task :api:openApiGenerate
################################################################################
# Thanks for using OpenAPI Generator. #
# Please consider donation to help us maintain this project :pray: #
# <https://opencollective.com/openapi_generator/donate> #
################################################################################
Successfully generated code to /Users/gxyd/projects/solver-engine/api/build/generated-src/openapi
> Task :methods:kspKotlin
w: [ksp] hello world
Daemon will be stopped at the end of the build after running out of JVM memory
> Task :methods:kspTestKotlin
w: [ksp] hello world
So, the second task that you see, i.e. :methods:kspTestKotlin
is something I don't to it to run.
I've already tried having the below configuration in `methods.build.gradle.kts`:
ksp {
tasks.named("kspTestKotlin") {
enabled = false
}
}
which raises the error saying, there is no task named "kspTestKotlin", while building my project.Zac Sweers
03/08/2023, 12:19 AMCharlie Tapping
03/08/2023, 12:31 PMRohan Maity
03/08/2023, 4:35 PMleandro
03/09/2023, 11:12 AMsourceSets {
debug.java.srcDirs += 'build/generated/ksp/debug/kotlin'
release.java.srcDirs += 'build/generated/ksp/release/kotlin'
testDebug.java.srcDirs += 'build/generated/ksp/debugUnitTest/kotlin'
androidTestDebug.java.srcDirs += 'build/generated/ksp/debugAndroidTest/kotlin'
}
This was added while we were using Kotlin 1.7.x... on our tests using Kotlin 1.8.10, this doesnt seem to be necessary anymore, and I am trying to confirm if this was fixed? Thanksleandro
03/09/2023, 11:12 AMsourceSets {
debug.java.srcDirs += 'build/generated/ksp/debug/kotlin'
release.java.srcDirs += 'build/generated/ksp/release/kotlin'
testDebug.java.srcDirs += 'build/generated/ksp/debugUnitTest/kotlin'
androidTestDebug.java.srcDirs += 'build/generated/ksp/debugAndroidTest/kotlin'
}
This was added while we were using Kotlin 1.7.x... on our tests using Kotlin 1.8.10, this doesnt seem to be necessary anymore, and I am trying to confirm if this was fixed? Thanksglureau
03/09/2023, 11:26 AMleandro
03/09/2023, 11:43 AMJiaxiang
03/09/2023, 6:49 PMleandro
03/09/2023, 9:17 PM