Skip to content

update: ksp-multiplatform.md#5584

Open
Caro Silva Rode (budindepunk) wants to merge 16 commits into
masterfrom
ksp-multiplatform-docs
Open

update: ksp-multiplatform.md#5584
Caro Silva Rode (budindepunk) wants to merge 16 commits into
masterfrom
ksp-multiplatform-docs

Conversation

@budindepunk

@budindepunk Caro Silva Rode (budindepunk) commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

@budindepunk Caro Silva Rode (budindepunk) changed the title update: ksp for multiplatform docs update: ksp-multiplatform.md Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hfmehmed, any comments on this? :)

Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated

@hfmehmed hfmehmed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the 2 comments i left, all good. 🟢

@budindepunk Caro Silva Rode (budindepunk) marked this pull request as ready for review June 16, 2026 06:57
@budindepunk Caro Silva Rode (budindepunk) requested a review from a team as a code owner June 16, 2026 06:57
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated

@zamulla Aleksey Zamulla (zamulla) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! There's a couple of questions I had that may need answering in the doc.

Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated

@zamulla Aleksey Zamulla (zamulla) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM, added a couple of polishing suggestions.

Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated
Comment thread docs/topics/ksp/ksp-multiplatform.md Outdated

@zamulla Aleksey Zamulla (zamulla) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a client module? 🤔

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that we use this term anywhere, maybe I'm wrong?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is eligible Kotlin compilation task?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just omit it?

and 3 symbol processing tasks: common/metadata, JVM main, Linux x64 test.
* JVM
* JS
* Linux X64

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 jvmMain and jvmTest
  • ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants