import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) alias(libs.plugins.composeMultiplatform) alias(libs.plugins.composeCompiler) alias(libs.plugins.kotlin.serialization) alias(libs.plugins.kotlinx.atomicfu) } android { namespace = "coredevices.pebble" compileSdk = libs.versions.android.compileSdk.get().toInt() buildFeatures { buildConfig = true compose = true } defaultConfig { consumerProguardFiles("consumer-rules.pro") minSdk = libs.versions.android.minSdk.get().toInt() targetSdk = libs.versions.android.targetSdk.get().toInt() } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } } kotlin { androidTarget { publishLibraryVariants("release", "debug") @OptIn(ExperimentalKotlinGradlePluginApi::class) compilerOptions { jvmTarget.set(JvmTarget.JVM_17) } } // Target declarations - add or remove as needed below. These define // which platforms this KMP module supports. // See: https://kotlinlang.org/docs/multiplatform-discover-project.html#targets // For iOS targets, this is also where you should // configure native binary output. For more information, see: // https://kotlinlang.org/docs/multiplatform-build-native-binaries.html#build-xcframeworks // A step-by-step guide on how to include this library in an XCode // project can be found here: // https://developer.android.com/kotlin/multiplatform/migrate val xcfName = "pebbleKit" iosArm64 { binaries.framework { baseName = xcfName } } iosSimulatorArm64 { binaries.framework { baseName = xcfName } } // Source set declarations. // Declaring a target automatically creates a source set with the same name. By default, the // Kotlin Gradle Plugin creates additional source sets that depend on each other, since it is // common to share sources between related targets. // See: https://kotlinlang.org/docs/multiplatform-hierarchy.html sourceSets { all { languageSettings { optIn("kotlin.uuid.ExperimentalUuidApi") optIn("androidx.compose.material3.ExperimentalMaterial3Api") optIn("androidx.compose.foundation.layout.ExperimentalLayoutApi") optIn("kotlin.time.ExperimentalTime") optIn("androidx.compose.material3.ExperimentalMaterial3ExpressiveApi") } } commonMain { dependencies { implementation(project(":libpebble3")) implementation(libs.health.kmp) implementation(compose.runtime) implementation(compose.foundation) implementation(libs.compose.material3) implementation(compose.materialIconsExtended) implementation(libs.koin.core) implementation(libs.koin.compose) implementation(libs.koin.compose.viewmodel) implementation(compose.components.resources) implementation(libs.androidx.navigation.compose) implementation(libs.paging.compose) implementation(compose.components.uiToolingPreview) implementation(libs.kotlinx.io.core) implementation(libs.kermit) implementation(project(":util")) implementation(libs.serialization) implementation(libs.kotlinx.datetime) implementation(libs.settings) implementation(libs.settings.test) implementation(libs.settings.serialization) implementation(libs.ktor.client.core) implementation(libs.ktor.client.contentNegotiation) implementation(libs.ktor.client.serialization.json) implementation(libs.coil) implementation(libs.coil.ktor) implementation(libs.webview) implementation(libs.backhandler) api(libs.uri) implementation(libs.firebase.crashlytics) implementation(libs.firebase.auth) implementation(libs.firebase.firestore) implementation(libs.coredevices.speex) api(project(":cactus")) api(libs.algolia) implementation(libs.reorderable) implementation(libs.compass.geocoder) implementation(libs.compass.geocoder.mobile) implementation(libs.compass.autocomplete) implementation(libs.compass.autocomplete.mobile) implementation(project(":libindex")) } } commonTest { dependencies { implementation(libs.kotlin.test) } } androidMain { dependencies { // Add Android-specific dependencies here. Note that this source set depends on // commonMain by default and will correctly pull the Android artifacts of any KMP // dependencies declared in commonMain. implementation(compose.uiTooling) } } iosMain { dependencies { // Add iOS-specific dependencies here. This a source set created by Kotlin Gradle // Plugin (KGP) that each specific iOS target (e.g., iosX64) depends on as // part of KMP’s default source set hierarchy. Note that this source set depends // on common by default and will correctly pull the iOS artifacts of any // KMP dependencies declared in commonMain. } } } } compose.resources { packageOfResClass = "coreapp.pebble.generated.resources" } tasks.withType().configureEach { compilerOptions { freeCompilerArgs.addAll(listOf( "-P", "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + project.buildDir.absolutePath + "/compose_metrics", "-P", "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + project.buildDir.absolutePath + "/compose_metrics" )) } }