Releases: google/ksp
1.5.21-1.0.0-beta06
Highlights
- Supported finer-grained tracking of changes in classpath / different modules for incremental processing. Previously, whenever there was a change in the classpath, a full reprocessing would be triggered. Now only dirty classes that are reachable will invalidate sources. This is disabled by default, however. Please enable it by setting the Gradle property
ksp.incremental.intermodule=true
. - Supported default values in annotations.
- Supported checked exceptions in compiled classes.
- Supported processing without Kotlin sources.
Issues Resolved
#53 Annotation values that are default are not visible in KSP
#233 Incremental processing for classpath changes
#493 Code does not get generated if project has only Java source files
#496 Execution failed for task ':foo:kspKotlin'. > Extension of type 'KspExtension' does not exist.
#507 getJvmCheckedException does not work for already compiled files
#511 About incremental aggregating processor
#531 The AbstractCompile.destinationDir property has been deprecated. This is scheduled to be removed in Gradle 8.0.
1.5.21-1.0.0-beta05
Highlights
- updated kotlin version to 1.5.21
- fixed a bug in findDeclaration() for Java Enum entry value
- added Resolver.getJvmCheckedException for property accessors
1.5.20-1.0.0-beta04
1.5.20-1.0.0-beta03
1.5.10-1.0.0-beta02
Highlights
- fixed an issue with
asMemberOf
when calling with a Java property accessor. - Added back fun interface for SymbolProcessorProvider.
1.5.10-1.0.0-beta01
Highlights
- Updated to Kotlin 1.5.10
- Introduced KSPropertyDeclaration.hasBackingField
API and Behavior Changes
- Parameters of
SymbolProcessorProvider.create()
are refactored intoSymbolProcessorEnvironment
- Name of default package (i.e., w.o. package declaration) is changed to an empty string.
- The deprecated
SymbolProcessor.init()
is removed.
1.5.0-1.0.0-alpha10
Highlights
- switch to
Sequence
for a bunch of APIs- Some of the API return type has been changed from
Collection
orList
toSequence
, which will allow performance improvement if you use case involved early termination. - Note that because
Sequence
is lazily evaluated, it requires a terminal operation to make actual compute happen. Please check you uses around the impacted APIs to see if they have a terminal operation. Most common use case isCollection.map{}
which will iterate through the collection by itself, but is non-terminal forSequence
and should be companied withtoList()
or replaced withforEach
- For the whole list of APIs impacted by this change, please refer to this commit.
- Some of the API return type has been changed from
- Added
KSDeclaration.getDocString()
API for getting the document comment. Note that it returns as is and you might need to process the string. - Origin for KS symbols from binaries is now split into
KOTLIN_LIB
andJAVA_LIB
. - Added name mapping helper for mapping names from Kotlin to Java and Java to Kotlin.
asMemberOf()
is now a member function ofKSPropertyDeclaration
andKSFunctionDeclaration
, instead ofResolver
- Add KSType.outerType and KSType.innerArguments
- Introduce KSType.isFunctionType and KSType.isSuspendFunctionType
1.5.0-1.0.0-alpha09
Highlights
- Upgraded to Kotlin 1.5.0!
Resolved Issues
#7 Feature request: Logging APIs
#112 Accessing properties, functions and typealiases by their fully qualified name
#323 getSealedSubclasses() doesn't work with incremental processing in Kotlin-1.5
#396 Synthetic classes for top level kotlin files
#403 Kotlin 1.5.0 support
Merged PRs
#400 Add missing space in docs
#402 Add support for getting owner class binary name for members
#404 Incremental processing: support getSealedSubclasses from multiple files
#405 Make SymbolProcessorProvider a fun interface
#407 Upgrade to Kotlin 1.5.0
1.4.32-1.0.0-alpha08
Hightlights
New Entry Point
A new interface, SymbolProcessorProvider
is introduced to replace SymbolProcessor.init()
.
Previously, processors implements SymbolProcessor
and register themselves
- in
META-INF/services/com.google.devtools.ksp.processing.SymbolProcessor
, and - need to save the environment / utils passed to
SymbolProcessor.init()
.
Now, processors should implement and register the new provider interface SymbolProcessorProvider
,
- in
META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider
, and - create an instance of the old
SymbolProcessor
, where the utils / environment can be passed in the constructor.
So that processors can get rid of lateinit var
s for those environments and utils.
The old service SymbolProcessor
is still loaded from its service file. However, if the processor register both SymbolProcessor
and SymbolProcessorProvider
, and the provider returns exactly the processor registered, then the processor's init()
will be called twice.
We recommend migrating to the new interface and are planning the deprecate the old service and SymbolProcessor.init()
.
Thanks @edrd-f for this new interface!
New API
#387 Add getFunctionDeclarationByName, getPropertyDeclarationByName
Issues Fixed
#385 Generated sources not considered when calculating dirty set
#388 Error running on incremental build
IOException in incremental build
Resolution failure from some deferred element
1.4.32-1.0.0-alpha07
Highlights
- Updated Kotlin version to 1.4.32
- Added
Resolver.getDeclarationsFromPackage()
API, this API is to retrieve declarations with a given package name from both classpath and sources. Note that this API can be expensive. - Bug fixes around generic type arguments and jvm_static detection.