update: ksp-multiplatform.md#5584
Conversation
Jakob Schneider (jaschdoc)
left a comment
There was a problem hiding this comment.
hfmehmed, any comments on this? :)
hfmehmed
left a comment
There was a problem hiding this comment.
Apart from the 2 comments i left, all good. 🟢
Aleksey Zamulla (zamulla)
left a comment
There was a problem hiding this comment.
Thanks! There's a couple of questions I had that may need answering in the doc.
Aleksey Zamulla (zamulla)
left a comment
There was a problem hiding this comment.
Generally LGTM, added a couple of polishing suggestions.
Aleksey Zamulla (zamulla)
left a comment
There was a problem hiding this comment.
Awesome, thanks! One final nit but it's done 👌
|
|
||
| For a quick start, see a [sample Kotlin Multiplatform project](https://github.com/google/ksp/tree/main/examples/multiplatform) | ||
| defining a KSP processor. | ||
| Here you can learn how to use Kotlin Symbol Processing (KSP) in a Kotlin Multiplatform project. For a quick start, see |
There was a problem hiding this comment.
| Here you can learn how to use Kotlin Symbol Processing (KSP) in a Kotlin Multiplatform project. For a quick start, see | |
| Here you'll learn how to use Kotlin Symbol Processing (KSP) in a Kotlin Multiplatform project. For a quick start, see |
| is used to specify which compilation targets need symbol processing, before compilation. | ||
| ## Add KSP to a multiplatform project | ||
|
|
||
| In the client module's `build.gradle.kts` file, assign a processor to each target that needs symbol processing in the |
There was a problem hiding this comment.
What is a client module? 🤔
There was a problem hiding this comment.
I'm not sure that we use this term anywhere, maybe I'm wrong?
There was a problem hiding this comment.
Why do we use "assign" as a word here? Isn't it just adding a dependency?
Have we ever used "assign" to explain something in the KSP?
| add("ksp<Target>", <processor>) | ||
| ``` | ||
|
|
||
| `<Target>` is one of the targets used in your multiplatform project. For a full list of targets, see |
There was a problem hiding this comment.
For a full list of target — could be a tip, no?
It is not that important rn since we expect that person knows about targets already
| add("ksp<Target>", <processor>) | ||
| ``` | ||
|
|
||
| `<Target>` is one of the targets used in your multiplatform project. For a full list of targets, see |
There was a problem hiding this comment.
You can place both Target and Processor in a list, so the info about them would be structured.
| add("kspJvm", "androidx.room:room-compiler:2.6.1") | ||
| ``` | ||
|
|
||
| A single target can have multiple processors: |
There was a problem hiding this comment.
Don't you want to put these different build set ups into separte subsections?
|
|
||
| ## Find KSP configuration names | ||
|
|
||
| KSP configuration names depend on the source set names generated by the Kotlin plugin. To view the complete |
There was a problem hiding this comment.
What is the Kotlin plugin? Is it KGP (Kotlin Gradle Plugin)? Or Kotlin IntelliJ Plugin? Or Kotlin Multiplatfrom Plugin?
|
|
||
| Look for the configuration names that correspond to your target source sets. | ||
|
|
||
| > Since KSP 2, the catch-all `ksp(...)` configuration is deprecated. Configure each target explicitly to avoid running |
There was a problem hiding this comment.
WDYT about making this one a warning instead of note? Will it work?
| So is symbol processing. A symbol processing task is created whenever there is a Kotlin compilation task and a | ||
| corresponding `ksp<Target>` or `ksp<SourceSet>` configuration is specified. | ||
| In a multiplatform project, Kotlin creates a separate [compilation](https://kotlinlang.org/docs/multiplatform/multiplatform-advanced-project-structure.html#compilations) | ||
| for each target and source set, such as `main` and`test`. For every eligible Kotlin compilation task, KSP creates a |
There was a problem hiding this comment.
What is eligible Kotlin compilation task?
There was a problem hiding this comment.
Can we just omit it?
| and 3 symbol processing tasks: common/metadata, JVM main, Linux x64 test. | ||
| * JVM | ||
| * JS | ||
| * Linux X64 |
There was a problem hiding this comment.
Shouldn't we write the target names as one word?
|
|
||
| For example, in the above `build.gradle.kts`, there are 4 compilation tasks: common/metadata, JVM main, Linux x64 main, Linux x64 test, | ||
| and 3 symbol processing tasks: common/metadata, JVM main, Linux x64 test. | ||
| * JVM |
There was a problem hiding this comment.
What do you think to move the info about main and test before this list, maybe rephrase, and in the list mention it in the way:
- For the JVM target
jvmMainandjvmTest - ...
KEDOC-134