diff --git a/build-logic/convention/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt index 49a19435b3..cfb9e005dc 100644 --- a/build-logic/convention/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt @@ -5,8 +5,10 @@ import com.quran.labs.androidquran.buildutil.applyKotlinCommon import com.quran.labs.androidquran.buildutil.withLibraries import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.plugins.ExtensionAware import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.dependencies +import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions class AndroidLibraryComposeConventionPlugin : Plugin { @@ -25,6 +27,15 @@ class AndroidLibraryComposeConventionPlugin : Plugin { withLibraries { libs -> composeOptions.kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + + (this as ExtensionAware).extensions.configure("kotlinOptions") { + freeCompilerArgs += listOf( + "-opt-in=androidx.compose.ui.ExperimentalComposeUiApi", + "-opt-in=androidx.compose.foundation.ExperimentalFoundationApi", + "-opt-in=androidx.compose.material.ExperimentalMaterialApi", + "-opt-in=androidx.compose.material3.ExperimentalMaterial3Api" + ) + } } applyKotlinCommon() diff --git a/feature/downloadmanager/build.gradle b/feature/downloadmanager/build.gradle index 407d9cf03b..aa2d815065 100644 --- a/feature/downloadmanager/build.gradle +++ b/feature/downloadmanager/build.gradle @@ -3,16 +3,7 @@ plugins { id 'com.squareup.anvil' } -android { - namespace 'com.quran.mobile.feature.downloadmanager' - kotlinOptions { - freeCompilerArgs += [ - "-Xopt-in=androidx.compose.ui.ExperimentalComposeUiApi", - "-Xopt-in=androidx.compose.foundation.ExperimentalFoundationApi", - "-Xopt-in=androidx.compose.material3.ExperimentalMaterial3Api" - ] - } -} +android.namespace 'com.quran.mobile.feature.downloadmanager' anvil { generateDaggerFactories = true } diff --git a/feature/downloadmanager/src/main/kotlin/com/quran/mobile/feature/downloadmanager/ui/SheikhDownloadSummary.kt b/feature/downloadmanager/src/main/kotlin/com/quran/mobile/feature/downloadmanager/ui/SheikhDownloadSummary.kt index 5b2ffae4a3..e29c9f5b92 100644 --- a/feature/downloadmanager/src/main/kotlin/com/quran/mobile/feature/downloadmanager/ui/SheikhDownloadSummary.kt +++ b/feature/downloadmanager/src/main/kotlin/com/quran/mobile/feature/downloadmanager/ui/SheikhDownloadSummary.kt @@ -9,7 +9,6 @@ import androidx.compose.material.Surface import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment -import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color @@ -26,7 +25,6 @@ import com.quran.mobile.feature.downloadmanager.R import com.quran.mobile.feature.downloadmanager.model.DownloadedSheikhUiModel import com.quran.mobile.feature.downloadmanager.ui.common.DownloadCommonRow -@OptIn(ExperimentalComposeUiApi::class) @Composable fun SheikhDownloadSummary( downloadedSheikhUiModel: DownloadedSheikhUiModel, diff --git a/feature/qarilist/build.gradle b/feature/qarilist/build.gradle index 1960c35131..f70d441e83 100644 --- a/feature/qarilist/build.gradle +++ b/feature/qarilist/build.gradle @@ -3,17 +3,7 @@ plugins { id 'com.squareup.anvil' } -android { - namespace 'com.quran.mobile.feature.qarilist' - - kotlinOptions { - freeCompilerArgs += [ - "-opt-in=androidx.compose.foundation.ExperimentalFoundationApi", - "-opt-in=androidx.compose.material.ExperimentalMaterialApi", - "-Xopt-in=androidx.compose.material3.ExperimentalMaterial3Api" - ] - } -} +android.namespace 'com.quran.mobile.feature.qarilist' anvil { generateDaggerFactories = true }