Migrate to AGP KMP
This commit is contained in:
1 parent
ea9ed2dc67
commit
4ac4d3da01
8 files changed
+15
-38
No files matched your search
@@ -17,14 +17,13 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidExtension
|
||||
class AndroidApplicationConventionPlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) = with(target) {
|
||||
apply(plugin = libs.plugins.android.application.get().pluginId)
|
||||
apply(plugin = libs.plugins.android.builtInKotlin.get().pluginId)
|
||||
apply(plugin = libs.plugins.compose.compiler.get().pluginId)
|
||||
apply(plugin = libs.plugins.composeCompilerReportGenerator.get().pluginId)
|
||||
|
||||
configure<KotlinAndroidExtension> {
|
||||
jvmToolchain(21)
|
||||
compilerOptions {
|
||||
configureKotlin()
|
||||
configureKotlin(includeKotlinX = true)
|
||||
configureKotlinCompose()
|
||||
jvmDefault = JvmDefaultMode.NO_COMPATIBILITY
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class MultiplatformLibraryConventionPlugin : Plugin<Project> {
|
||||
configure<KotlinMultiplatformExtension> {
|
||||
jvmToolchain(21)
|
||||
compilerOptions {
|
||||
configureKotlin()
|
||||
configureKotlin(includeKotlinX = path != ":core:i18n")
|
||||
}
|
||||
|
||||
applyHierarchyTemplate {
|
||||
@@ -44,10 +44,6 @@ class MultiplatformLibraryConventionPlugin : Plugin<Project> {
|
||||
|
||||
configure<KotlinMultiplatformAndroidLibraryTarget> {
|
||||
namespace = "com.ehviewer${path.replace(':', '.')}"
|
||||
|
||||
withHostTestBuilder {
|
||||
}
|
||||
|
||||
enableCoreLibraryDesugaring = true
|
||||
|
||||
compilerOptions {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.gradle.kotlin.dsl.assign
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions
|
||||
|
||||
// https://kotlinlang.org/docs/gradle-compiler-options.html#all-compiler-options
|
||||
internal fun KotlinCommonCompilerOptions.configureKotlin() {
|
||||
internal fun KotlinCommonCompilerOptions.configureKotlin(includeKotlinX: Boolean) {
|
||||
progressiveMode = true
|
||||
allWarningsAsErrors = true
|
||||
optIn.addAll(
|
||||
@@ -12,10 +12,14 @@ internal fun KotlinCommonCompilerOptions.configureKotlin() {
|
||||
"kotlin.concurrent.atomics.ExperimentalAtomicApi",
|
||||
"kotlin.contracts.ExperimentalContracts",
|
||||
"kotlin.time.ExperimentalTime",
|
||||
"kotlinx.coroutines.ExperimentalCoroutinesApi",
|
||||
"kotlinx.coroutines.FlowPreview",
|
||||
"kotlinx.serialization.ExperimentalSerializationApi",
|
||||
)
|
||||
if (includeKotlinX) {
|
||||
optIn.addAll(
|
||||
"kotlinx.coroutines.ExperimentalCoroutinesApi",
|
||||
"kotlinx.coroutines.FlowPreview",
|
||||
"kotlinx.serialization.ExperimentalSerializationApi",
|
||||
)
|
||||
}
|
||||
freeCompilerArgs.addAll(
|
||||
"-Xcontext-parameters",
|
||||
"-Xwhen-expressions=indy",
|
||||
|
||||
Reference in new issue
Block a user