Skip to content

Add top-level dependencies block for Kotlin 2.2.20 #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2-2-20-docs
Choose a base branch
from

Conversation

sarahhaggarty
Copy link
Collaborator

This PR adds details about the experimental top-level dependencies block introduced in Kotlin 2.2.20.

@sarahhaggarty sarahhaggarty requested a review from a team as a code owner August 13, 2025 11:51
@danil-pavlov danil-pavlov self-requested a review August 14, 2025 12:51
@@ -40,6 +40,8 @@ kotlin {
</tab>
</tabs>

You can also configure common dependencies in a top-level `dependencies` block. See [Configure dependencies at the top level](multiplatform-dsl-reference.md#configure-dependencies-at-the-top-level).
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems that it should be in the "Library shared for all source sets" section
Also, it could be a tip/note

@@ -42,6 +42,7 @@ Inside `kotlin {}`, you can write the following blocks:
| `targets` | Lists all targets of the project. |
| `sourceSets` | Configures predefined and declares custom [source sets](#source-sets) of the project. |
| `compilerOptions` | Specifies common extension-level [compiler options](#compiler-options) that are used as defaults for all targets and shared source sets. |
| `dependencies` | EXPERIMENTAL. Configures [common dependencies](#configure-dependencies-at-the-top-level) for the project. |
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we use caps-lock, it could be

Configures common dependencies (Experimental)

### Configure dependencies at the top level
<secondary-label ref="Experimental"/>

Starting with Kotlin 2.2.20, you can configure common dependencies using a top-level `dependencies {}` block.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Starting with Kotlin 2.2.20, you can configure common dependencies using a top-level `dependencies {}` block.
You can configure common dependencies using a top-level `dependencies {}` block.

</tab>
</tabs>

Add platform-specific dependencies inside the appropriate source sets of the `sourceSets {}` block.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Add platform-specific dependencies inside the appropriate source sets of the `sourceSets {}` block.
Add platform-specific dependencies inside the `sourceSets {}` block of the corresponding target.

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.

3 participants