Skip to content

Releases: google/ksp

1.4.32-1.0.0-alpha08

22 Apr 00:44
Compare
Choose a tag to compare

Hightlights

New Entry Point

A new interface, SymbolProcessorProvider is introduced to replace SymbolProcessor.init().
Previously, processors implements SymbolProcessor and register themselves

  1. in META-INF/services/com.google.devtools.ksp.processing.SymbolProcessor, and
  2. need to save the environment / utils passed to SymbolProcessor.init().

Now, processors should implement and register the new provider interface SymbolProcessorProvider,

  1. in META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider, and
  2. 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 vars 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

07 Apr 22:08
Compare
Choose a tag to compare

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.

1.4.31-1.0.0-alpha06

24 Mar 20:59
Compare
Choose a tag to compare

Highlights

  • Multiplatform is back working again for JVM platform.
  • Corresponding Kotlin version is bumped to 1.4.31. This release still works with 1.4.30. To mute the version mismatch warning when using with Kotlin-1.4.30, use -Pksp.version.check=false.
  • Supported Gradle 7.0-rc-1.

API / behavior changes

  • Use-site annotations are now attached to use-sites consistently. Previously, they are attached to where they were declared if the source is available, and the use-sites if the source isn't available.

Issues fixed

#131 cannot read annotatations in classes that are coming from dependencies
#317 Possible regression: Configuration with name 'ksp' not found in multiplatform
#325 KSType for inner types misses arguments from outer types
#355 annotation target for setter property does not work
#360 Resolving a same type multiple times as type argument cause the first resolution to override all following resolution
#364 Annotate properties for KspTask

1.4.30-1.0.0-alpha05

10 Mar 23:58
Compare
Choose a tag to compare

Highlights

  • synthetic property accessors now can be correctly created for abstract classes, align with compiler behavior.
  • Removed findAnnotationFromUseSiteTarget() function, consolidate its functionality into KSP internal logic.

Behavior change

  • KSP now handles annotation use site targets internally for property accessors (namely @get:Anno, @set:Anno).
    • property accessors will have corresponding targeted annotations from their receiver properties
    • annotations with @get: and @set: targets will not appear in property's annotation list.

1.4.30-1.0.0-alpha04

26 Feb 20:07
Compare
Choose a tag to compare

This is a hot-fix to a bug in incremental processing (#332), where KSP didn't work correctly if multiple files were changed or deleted at a time. If your processor haven't supported incremental processing yet, you may safely ignore this release.

1.4.30-1.0.0-alpha03

25 Feb 00:07
Compare
Choose a tag to compare

Highlights

  • Added KSClassDeclaration. getSealedSubclasses() API (credit to @ZacSweers)
  • KSP now handles exceptions instead of throwing them. For KSP internal exceptions, KSP will return an InternalError to compiler, for processors thrown exceptions, KSP will return CompilationError to compiler. Please files bugs for InternalErrors

API and behavior changes

  • SymbolProcessor.finish() now has a default implementation of no op.
  • If KSP has been executing for more than 100 rounds, a warning will be printed to indicate potential infinite loop caused by inappropriate multiple round processors.

1.4.30-1.0.0-alpha02

09 Feb 23:46
Compare
Choose a tag to compare

Highlights

  • Updated to Kotlin 1.4.30
  • Supported multiple round processing
  • Better support of incremental processing
  • Better support of Android build variants

API and behavior changes
Multiple round processing is introduced in the is release. The most notable changes are

  • SymbolProcessor.process() will be called multiple times until there is no newly generated file.
  • SymbolProcessor.process() now returns a List<KSAnnotated>, which will be processed again in the next round.

The detailed behavior of multiple round processing can be found here.

1.4.20-dev-experimental-20210203

04 Feb 01:11
Compare
Choose a tag to compare

Highlights

  • This is the last 1.4.20 release. KSP will hopefully move to 1.4.30 in the next release.
  • KSP now has a better support of Android build variants! (thanks to @yigit !)

API Runtime Behavior Changes

  • Constructor names are unified to <init>. Previously, in Kotlin source they are the same as class name.
  • KSClassDeclaration.declarations and KSClassDeclaration.getAllFunctions() include constructors now.

Issues Resolved
#113 Add a way to check if a KSFunctionDeclaration is a constructor
#114 Constructors returnType is null
#198 KSP resolves classes that are not available to the app
#202 [Gradle Plugin] Support different configurations
#207 Compatibility with Anvil
#265 wrapping method psi to JavaMethodImpl causes exception
#273 explicit constructor is missing in compiled java dependencies
#279 ksp returns empty constructor for data classes

1.4.20-dev-experimental-20210120

20 Jan 23:58
Compare
Choose a tag to compare

Major change:

  • Incremental is now enabled by default, if you do not wish to use incremental in your project, please set ksp.incremental=false in gradle.properties

Resolved Issues:
KSPLogger.error does not fail compilation #122
property accessors without body fails resoltuion #230
KSProperty.findOverridee fails for non overridable local variables #228
Merge Gradle tests #225

Merged PRs:
Enable incremental processing by default #257
Enable integration tests in CI #256
integration tests #253
Expose logger statistics #165
fix KSPropertyDeclarationParameterImpl for override checking when there is no overridden symbols #249

1.4.20-dev-experimental-20210111

12 Jan 02:24
Compare
Choose a tag to compare

This is release for bug fixes and contains no major update.

Issues resolved
#234 enum constants in java sources are reported as properties
#244 JavaCompile task fails with no sources

PRs merged
#238 Model Java enum entries as KSClassDeclaration
#241 Fine tuning contents of symbol-processing.jar
#242 Mute an "idea home not valid" error in tests
#245 Do not register resources as Java sources
#243 Fix NullPointerException on adding plugin to KMP project
#246 Remove resources from Kotlin sources