From 0aa94782c83d915d8fd35cc225ec691efcd90c2a Mon Sep 17 00:00:00 2001 From: Nino Date: Mon, 30 Dec 2024 14:16:07 +0100 Subject: [PATCH] Update opt-in-requirements documentation with new optIn ListProperty --- docs/topics/opt-in-requirements.md | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/topics/opt-in-requirements.md b/docs/topics/opt-in-requirements.md index d11e6320381..17944fdb043 100644 --- a/docs/topics/opt-in-requirements.md +++ b/docs/topics/opt-in-requirements.md @@ -216,6 +216,37 @@ tasks.named('compileKotlin', KotlinCompilationTask) { +or like this: + + + + +```kotlin +import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask +// ... + +tasks.named>("compileKotlin").configure { + compilerOptions.optIn.add("org.mylibrary.OptInAnnotation") +} +``` + + + + +```groovy +import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask +// ... + +tasks.named('compileKotlin', KotlinCompilationTask) { + compilerOptions { + optIn.add('org.mylibrary.OptInAnnotation') + } +} +``` + + + + If your Gradle module is a multiplatform module, use the `optIn` method: