Skip to content

Commit ec9b5c5

Browse files
alibagherifamsarahhaggarty
authored andcommitted
Use compilerOptions DSL in Kotlin Multiplatform opt-in example
`LanguageSettingsBuilder` interface will be deprecated in the future. Instead, it is better to use the existing `compilerOptions` DSL.
1 parent a5ecb51 commit ec9b5c5

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

docs/topics/opt-in-requirements.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ If your Gradle module is a multiplatform module, use the `optIn` method:
222222
<tab title="Kotlin" group-key="kotlin">
223223

224224
```kotlin
225-
sourceSets {
226-
all {
227-
languageSettings.optIn("org.mylibrary.OptInAnnotation")
225+
kotlin {
226+
compilerOptions {
227+
optIn.add("org.mylibrary.OptInAnnotation")
228228
}
229229
}
230230
```
@@ -233,11 +233,9 @@ sourceSets {
233233
<tab title="Groovy" group-key="groovy">
234234

235235
```groovy
236-
sourceSets {
237-
all {
238-
languageSettings {
239-
optIn('org.mylibrary.OptInAnnotation')
240-
}
236+
kotlin {
237+
compilerOptions {
238+
optIn.add('org.mylibrary.OptInAnnotation')
241239
}
242240
}
243241
```

0 commit comments

Comments
 (0)