Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
kotlin-compile-testing
A library for testing Kotlin and Java annotation processors, compiler plugins and code generation
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
google/ksp is one of the lightweight compiler plugin. We can easy to create compiler plugin with simple syntax. It's set as stable last year.
I've prepared the demo project(Spider) for this article. The project is really simple ksp project. Spider is a AGSL wrapper library for compose function.We can avoid to write template AGSL loading code.
In the demo project, I used junit and mockito. One thing we need to pre-learn do the unit test, that is ksp class diagram.
Strictly, it's not android integration test. In this section I defined integration test as ksp processing result confirmation. Unfortunately, there're no official support that for testing SymbolProcessorProvider. But we can apply similar test by using kotlin-compile-testing. This library supports ksp so we can easily do integration test. This library is used by multiple ksp project such as room, moshi and etc...
This approach is also used by square/moshi. You can also refer this.