You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/topics/whatsnew/whatsnew2220.md
+61Lines changed: 61 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1238,6 +1238,67 @@ the previous version of the lambda, which could cause unexpected behavior.
1238
1238
1239
1239
InKotlin2.2.20, the compiler now detects changes in lambdas of inline functions and automatically recompiles their call sites.
1240
1240
1241
+
### Improvementsfor library publication
1242
+
1243
+
Kotlin2.2.20 adds new Gradle tasks that make library publication easier. These tasks help you generate key pairs, upload
1244
+
public keys, and run local checks to ensure the verification process succeeds before uploading to the MavenCentral repository.
1245
+
1246
+
For more information about how to use these tasks as part of the publication process, see [Publish your library to MavenCentral](https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-publish-libraries.html).
1247
+
1248
+
#### NewGradle tasks for generating and uploading PGP keys
1249
+
1250
+
BeforeKotlin2.2.20, if you wanted to publish a multiplatform library to the MavenCentral repository, you had to install
1251
+
a third-party program like `gpg` to generate a key pair for signing your publications. Now, the KotlinGradle plugin comes
1252
+
with Gradle tasks that let you generate a key pair and upload the public key so you don't have to install another program.
1253
+
1254
+
##### Generate a key pair
1255
+
1256
+
The `generatePgpKeys` task generates a key pair. When you run it, you must provide a password for the private keystore
1257
+
and your name in the following format:
1258
+
1259
+
```bash
1260
+
./gradlew -Psigning.password=example-password generatePgpKeys --name "John Smith <[email protected]>"
1261
+
```
1262
+
1263
+
The task stores the key pair in the `build/pgp` directory.
1264
+
1265
+
> Move your key pair to a secure location to prevent accidental deletion or unauthorized access.
1266
+
>
1267
+
{style="warning"}
1268
+
1269
+
##### Upload the public key
1270
+
1271
+
The `uploadPublicPgpKey` task uploads the public key to Ubuntu's key server: `keyserver.ubuntu.com`. When you run it,
1272
+
provide the path to the public key in `.asc` format:
Kotlin2.2.20 also adds Gradle tasks for testing verification locally before uploading your library to the MavenCentral repository.
1281
+
1282
+
If you're using the Kotlin Gradle plugin along with Gradle's [SigningPlugin](https://docs.gradle.org/current/userguide/signing_plugin.html) and [Maven Publish Plugin](https://docs.gradle.org/current/userguide/publishing_maven.html), you can run the `checkSigningConfiguration` and `checkPomFileFor<PUBLICATION_NAME>Publication` tasks to verify that your setup meets Maven Central’s requirements. Replace `<PUBLICATION_NAME>` with the name of your publication.
1283
+
1284
+
These tasks aren't automatically run as part of the `build` or `check` Gradle tasks, so you need to run them manually.
1285
+
For example, if you have a `KotlinMultiplatform` publication:
0 commit comments