Configure opt-in androidx.compose.foundation.ExperimentalFoundationApi compiler option on a module level

This commit is contained in:
Nebojsa Vuksic 2025-08-27 14:25:04 +02:00
parent ae6d343913
commit 8709e7cf8a
3 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,7 @@
import org.jetbrains.changelog.Changelog import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.intellij.platform.gradle.TestFrameworkType import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
id("java") // Java support id("java") // Java support
@ -15,6 +16,14 @@ version = providers.gradleProperty("pluginVersion").get()
kotlin { kotlin {
jvmToolchain(21) jvmToolchain(21)
compilerOptions {
freeCompilerArgs.addAll(
listOf(
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi"
)
)
}
} }
repositories { repositories {

View File

@ -1,6 +1,5 @@
package org.jetbrains.plugins.template.components package org.jetbrains.plugins.template.components
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.*
import androidx.compose.foundation.onClick import androidx.compose.foundation.onClick
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@ -30,7 +29,6 @@ fun ContextPopupMenu(
} }
} }
@OptIn(ExperimentalFoundationApi::class)
@Composable @Composable
fun ContextPopupMenuItem( fun ContextPopupMenuItem(
actionText: String, actionText: String,

View File

@ -1,7 +1,6 @@
package org.jetbrains.plugins.template.weatherApp.ui.components package org.jetbrains.plugins.template.weatherApp.ui.components
import androidx.compose.animation.core.* import androidx.compose.animation.core.*
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.border import androidx.compose.foundation.border
import androidx.compose.foundation.layout.* 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 * @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. * provides the location for which the weather data should be fetched.
*/ */
@OptIn(ExperimentalFoundationApi::class)
@Composable @Composable
fun WeatherDetailsCard( fun WeatherDetailsCard(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,