Comments (12)
Interesting, I wonder if this is because of incremental compilation. Does it happen on a clean build too?
$ ./gradlew --rerun-tasks --no-build-cache <assemble-task>
from kotshi.
I suppose it could be - we haven't seen it on our build servers, and I have just run the build a couple of times using the above command and was all good. Will keep monitoring it and report back if it doesn't work (although obvs the incremental compilation is v useful :)
BTW, we're on:
MacOS
Java 11/17
Gradle 7.6
Kotlin 1.8.0
Kotshi 2.9.1
from kotshi.
Must be something at play with Kotlin 1.8.0, seems when we switch to Kotlin 1.7.22 it works as expected.
from kotshi.
I'm not sure if this is related, but we also had some problems when there were multiple "source" kotlin classes in a single Kotlin file, causing the actual adapter to not get generated ... moving these out into their own files seemed to fix that problem. (same environment as above 😄 )
from kotshi.
Interesting, I wonder if this is because of incremental compilation. Does it happen on a clean build too?
$ ./gradlew --rerun-tasks --no-build-cache <assemble-task>
More on this - it was a workaround that worked on the command line, but IntelliJ was still a problem.
from kotshi.
IntelliJ version for completeness
IntelliJ IDEA 2022.3 (Ultimate Edition)
Build #IU-223.7571.182, built on November 29, 2022
Runtime version: 17.0.5+1-b653.14 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.6
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Kotlin: 223-1.7.20-release-201-IJ7571.182
from kotshi.
I added a test for incremental kompilation with KSP in #198 though it's unclear if the test library actually supports it.
I'll see if I can actually test incremental for real later this week.
from kotshi.
Just released 2.10.0 with Kotlin 1.8 support, let me know if that one still has the issues.
from kotshi.
Thanks so much for the quick turnaround..
Well the good news is that we get further in the process and the adapters generate (and the factories as well). The slightly less great news is that I've uncovered a really subtle bug in the KSP generator. If you have a class where:
- the field name is the same as its class
AND - the field is nullable
AND - the field has a default value
... the KSP generated class does not compile. Try this and you can see:
@JsonSerializable
data class MyClazz(
val Int: Int? = null
)
I can raise another issue if you would like to track that differently @ansman ? 😄
(and yes - that wasn't easy to track down!)
from kotshi.
Nice catch, I'll see if I can fix that one tonight. Should be easy since we have a repro.
And yes, if you could open a separate issue so we can keep this for the factory issues that would be great. Otherwise I can open one tonight
from kotshi.
Here you go (#199).
We can probably close this one since it seems to be fixed.
from kotshi.
This is fixed now! :)
from kotshi.
Related Issues (20)
- invalid code in xxxJsonAdapter generated with @JsonSerializable HOT 1
- Unable to build project with Jetifier enabled (2.0.2) HOT 1
- Investigate support for inline classes HOT 1
- all of the objects have one companion object in ram ?!!?! HOT 3
- Migrate to KSP
- Implementation documentation or sample app? HOT 5
- Kotlin 1.5 borked HOT 3
- Generated annotation not found when compiling against Java 11 HOT 10
- Alternative annotation for custom names HOT 9
- v2.9.0: Excess code generated in adapters (Kapt) HOT 4
- 2.10.0 KSP generates non-compilable classes when nullable field with same name as class and default value HOT 4
- 2.10.1 KSP generated adapters have trouble with generic typealiases when there is a default value HOT 3
- Serialisation issue is sallowed HOT 2
- Unresolved reference: KotshiAppJsonAdapterFactory HOT 2
- KotshiApplicationJsonAdapterFactory does not have a companion object HOT 6
- Usage with JVM 11 HOT 3
- Backend Internal error HOT 5
- [Intermittent] No JsonAdapter is getting created for random response classes after migrating to ksp from kapt HOT 4
- KSP: Failed to analyze class HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kotshi.