Zac Sweers
09/22/2021, 4:48 PMkotlin scripting plugin: applied in the non-supported environment (error received: Cannot query the value of task ':libraries:foundation:feature-flag:compiler:kspKotlin' property 'sourceSetName$kotlin_gradle_plugin' because it has no value available.)
kotlin scripting plugin: applied in the non-supported environment (error received: Cannot query the value of task ':libraries:foundation:carbonite:carbonite-compiler:kspKotlin' property 'sourceSetName$kotlin_gradle_plugin' because it has no value available.)
Jiaxiang
09/22/2021, 10:55 PMstar_zero
09/24/2021, 6:06 AMaggregating
of Dependencies
is set to true
, will even file changes that are not related to a particular annotation be reprocessed?
val symbols = resolver.getSymbolsWithAnnotation("Factory")
symbols.forEach { symbol ->
val ksClass = symbol as KSClassDeclaration
val packageName = ksClass.packageName.asString()
val className = ksClass.simpleName.asString()
val file = codeGenerator.createNewFile(
Dependencies(true, ksClass.containingFile!!), // <--
packageName,
"${className}Factory"
)
// generate code ...
}
Zac Sweers
09/25/2021, 7:59 PMCaused by: java.lang.NoSuchMethodError: 'org.gradle.api.provider.Property com.google.devtools.ksp.gradle.KspTaskJvm.getUseClasspathSnapshot()'
at com.google.devtools.ksp.gradle.KspTaskJvm.configureCompilation(KspSubplugin.kt:511)
at com.google.devtools.ksp.gradle.KspGradleSubplugin$applyToCompilation$kspTaskProvider$1.execute(KspSubplugin.kt:335)
at com.google.devtools.ksp.gradle.KspGradleSubplugin$applyToCompilation$kspTaskProvider$1.execute(KspSubplugin.kt:330)
at org.gradle.api.internal.DefaultMutationGuard$2.execute(DefaultMutationGuard.java:44)
at org.gradle.api.internal.DefaultMutationGuard$2.execute(DefaultMutationGuard.java:44)
Zac Sweers
09/25/2021, 8:00 PMWilliam Reed
09/28/2021, 6:36 PMksp
in a project that uses kapt
for all other annotation processors? or is it that i just won’t see the speed improvements from using ksp
?William Reed
09/29/2021, 1:50 PMparameter.annotations.firstOrNull { annot ->
annot.annotationType.resolve().isAssignableFrom(annotationType)
}?.arguments?.firstOrNull()?.let { annotation ->
foo = (annotation.value as? String)
}
i’m not used to casting like this, so just checking i’m not going down the wrong pathMatthew Laser
09/29/2021, 2:47 PMcom.android.library
plugin into the KSP Quickstart's test-processor
module without much luckGrégory Lureau
09/30/2021, 2:51 PMelihart
09/30/2021, 9:42 PMGrégory Lureau
10/01/2021, 3:28 PMResolver.getSymbolsWithAnnotation
only returns annotations available in the same compilation/gradle module for KMP. When I move the annotation to another module (dedicated to annotations) it's not returned anymore. Have you already experienced something similar ?William Reed
10/01/2021, 6:45 PMkotlin-compile-testing
library, but I’m interested in testing the functionality. Is the best option to create a new module which depends on the annotation processor and run tests there?Zac Sweers
10/02/2021, 1:16 AMGrégory Lureau
10/03/2021, 9:00 PMRafael Costa
10/04/2021, 12:06 AMresolver.getDeclarationsFromPackage("com.some.package").iterator().hasNext()
, but I was wondering if there is a better/more performant way.Vaios Tsitsonis
10/04/2021, 6:49 AMWilliam Reed
10/04/2021, 3:03 PMresolver.getSymbolsWithAnnotation
class Foo {
fun bar() {
@SomeKspAnnotation
class Hello()
}
}
I’m only doing this for a unit test, so i can work around it in my real code. just wondering if it’s a known issuerkeazor
10/05/2021, 3:27 PMmiqbaldc
10/06/2021, 6:23 AMkapt
with ksp
? 🙏eygraber
10/06/2021, 6:17 PMBig Chungus
10/10/2021, 9:07 PMGrégory Lureau
10/11/2021, 10:41 AMfunc.returnType.toString()
but resolve()
only returns empty/null/"<Error>". Is it something already known or covered by pull/609?Zac Sweers
10/12/2021, 12:30 AMGrégory Lureau
10/12/2021, 8:07 AMlen
10/12/2021, 7:40 PMprocessManifest
task? KSP adds a dependency on the processResources
task (which also depends on processManifest
). I've tried to remove it from dependsOn
but somehow it's never removed and I end up with cyclic dependencies. I want to generate a class with KSP and add a reference to it in AndroidManifest.xml
for dynamic loadingLilly
10/12/2021, 10:48 PMstar_zero
10/13/2021, 9:03 AMWilliam Reed
10/13/2021, 1:48 PMKSType
, how can I tell if it is an enum? i’m looking into obtaining a KSClassDeclaration
for Enum<*>
rocketraman
10/13/2021, 2:22 PMjameskleeh
10/13/2021, 4:32 PMresolver.getClassDeclarationByName
is not finding already compiled Java classes in a jar that is on the classpath. Is that expected? Using 1.5.30-1.0.0jameskleeh
10/13/2021, 4:32 PMresolver.getClassDeclarationByName
is not finding already compiled Java classes in a jar that is on the classpath. Is that expected? Using 1.5.30-1.0.0yigit
10/13/2021, 4:39 PMjameskleeh
10/13/2021, 4:46 PMinheritClasspath
is set to false by default