Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/topics/compiler-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,25 @@ Allows using the `returnsNotNull()` function in contracts to assume a non-null r

Allows using the `holdsIn` keyword in contracts to assume that a boolean condition is `true` inside a lambda.

### -Xcompiler-plugin-order={plugin.before>plugin.after}

Configure the running order of compiler plugins. Place the compiler plugin you want to run first on the left side of the
Copy link
Collaborator

Choose a reason for hiding this comment

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

While the sentence is clear and well-written, WDYT if we make it more straightforward?

It is just a random thought:
Configure the running order of compiler plugins. Compiler runs plugin.before first, and then plugin.after.

You can define multiplae ordering rules for three or more plugins. For example:

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or something similar.
WDYT?

It's OK not to take my version :)

`>`, and the compiler plugin you want to run second on the right. You can configure the following plugins by their IDs:

| Compiler plugin | Plugin ID |
|--------------------|--------------------------------------------|
| `all-open` | `org.jetbrains.kotlin.allopen` |
| Compose | `androidx.compose.compiler.plugins.kotlin` |
| `js-plain-objects` | `org.jetbrains.kotlinx.jspo` |
| Lombok | `org.jetbrains.kotlin.lombok` |
| `no-arg` | `org.jetbrains.kotlin.noarg` |
| Parcelize | `org.jetbrains.kotlin.parcelize` |
| Power-assert | `org.jetbrains.kotlin.powerassert` |
| SAM with receiver | `org.jetbrains.kotlin.samWithReceiver` |
| Serialization | `org.jetbrains.kotlinx.serialization` |

This running order controls only the backend of compiler plugins and not the frontend.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have any links that helps to define the diffrence backend and frontend? 🤔


## Kotlin/JVM compiler options

The Kotlin compiler for JVM compiles Kotlin source files into Java class files.
Expand Down