From 8709e7cf8a15162729b34b5aad42f028f4116630 Mon Sep 17 00:00:00 2001 From: Nebojsa Vuksic Date: Wed, 27 Aug 2025 14:25:04 +0200 Subject: [PATCH] Configure opt-in androidx.compose.foundation.ExperimentalFoundationApi compiler option on a module level --- build.gradle.kts | 9 +++++++++ .../plugins/template/components/ContextPopupMenu.kt | 2 -- .../weatherApp/ui/components/WeatherDetailsCard.kt | 2 -- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b9e3bf8..f8e5550 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,7 @@ import org.jetbrains.changelog.Changelog import org.jetbrains.changelog.markdownToHTML import org.jetbrains.intellij.platform.gradle.TestFrameworkType +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("java") // Java support @@ -15,6 +16,14 @@ version = providers.gradleProperty("pluginVersion").get() kotlin { jvmToolchain(21) + + compilerOptions { + freeCompilerArgs.addAll( + listOf( + "-opt-in=androidx.compose.foundation.ExperimentalFoundationApi" + ) + ) + } } repositories { diff --git a/src/main/kotlin/org/jetbrains/plugins/template/components/ContextPopupMenu.kt b/src/main/kotlin/org/jetbrains/plugins/template/components/ContextPopupMenu.kt index 0bf0bf6..ab92237 100644 --- a/src/main/kotlin/org/jetbrains/plugins/template/components/ContextPopupMenu.kt +++ b/src/main/kotlin/org/jetbrains/plugins/template/components/ContextPopupMenu.kt @@ -1,6 +1,5 @@ package org.jetbrains.plugins.template.components -import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.layout.* import androidx.compose.foundation.onClick import androidx.compose.runtime.Composable @@ -30,7 +29,6 @@ fun ContextPopupMenu( } } -@OptIn(ExperimentalFoundationApi::class) @Composable fun ContextPopupMenuItem( actionText: String, diff --git a/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/components/WeatherDetailsCard.kt b/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/components/WeatherDetailsCard.kt index e790892..88b9272 100644 --- a/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/components/WeatherDetailsCard.kt +++ b/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/components/WeatherDetailsCard.kt @@ -1,7 +1,6 @@ package org.jetbrains.plugins.template.weatherApp.ui.components import androidx.compose.animation.core.* -import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.layout.* @@ -47,7 +46,6 @@ import java.util.* * @param onReloadWeatherData Callback invoked to reload weather data when the refresh action is triggered. It * provides the location for which the weather data should be fetched. */ -@OptIn(ExperimentalFoundationApi::class) @Composable fun WeatherDetailsCard( modifier: Modifier = Modifier,