import org.jetbrains.compose.desktop.application.dsl.TargetFormat import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.androidApplication) alias(libs.plugins.composeMultiplatform) alias(libs.plugins.composeCompiler) } kotlin { androidTarget { @OptIn(ExperimentalKotlinGradlePluginApi::class) compilerOptions { jvmTarget.set(JvmTarget.JVM_11) } } jvm("desktop") sourceSets { val exposedVersion = "0.61.0" val desktopMain by getting { dependencies { implementation(compose.desktop.currentOs) implementation(libs.kotlinx.coroutines.swing) implementation("io.ktor:ktor-client-okhttp:2.3.2") // Exposed + PostgreSQL // implementation("org.jetbrains.exposed:exposed-core:$exposedVersion") // implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion") // implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion") implementation("org.postgresql:postgresql:42.7.1") implementation("org.jetbrains.exposed:exposed-core:$exposedVersion") implementation("org.jetbrains.exposed:exposed-crypt:$exposedVersion") implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion") implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion") implementation("org.jetbrains.exposed:exposed-jodatime:$exposedVersion") // or implementation("org.jetbrains.exposed:exposed-java-time:$exposedVersion") // or implementation("org.jetbrains.exposed:exposed-kotlin-datetime:$exposedVersion") implementation("org.jetbrains.exposed:exposed-json:$exposedVersion") implementation("org.jetbrains.exposed:exposed-money:$exposedVersion") implementation("org.jetbrains.exposed:exposed-spring-boot-starter:$exposedVersion") } } val commonMain by getting { resources.srcDir("src/commonMain/composeResources") } androidMain.dependencies { implementation(compose.preview) implementation(libs.androidx.activity.compose) implementation(libs.androidx.lifecycle.viewmodel) implementation("io.ktor:ktor-client-okhttp:2.3.2") implementation("org.postgresql:postgresql:42.7.1") implementation("org.jetbrains.exposed:exposed-core:$exposedVersion") implementation("org.jetbrains.exposed:exposed-crypt:$exposedVersion") implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion") implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion") implementation("org.jetbrains.exposed:exposed-jodatime:$exposedVersion") // or implementation("org.jetbrains.exposed:exposed-java-time:$exposedVersion") // or implementation("org.jetbrains.exposed:exposed-kotlin-datetime:$exposedVersion") implementation("org.jetbrains.exposed:exposed-json:$exposedVersion") implementation("org.jetbrains.exposed:exposed-money:$exposedVersion") implementation("org.jetbrains.exposed:exposed-spring-boot-starter:$exposedVersion") } commonMain.dependencies { val voyagerVersion = "1.1.0-beta02" implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) implementation(compose.ui) implementation(compose.components.resources) implementation(compose.components.uiToolingPreview) implementation("cafe.adriel.voyager:voyager-navigator:$voyagerVersion") implementation("cafe.adriel.voyager:voyager-screenmodel:$voyagerVersion") implementation(compose.preview) implementation(libs.androidx.lifecycle.viewmodel) implementation("media.kamel:kamel-image:0.7.0") implementation("io.ktor:ktor-client-core:2.3.2") implementation("io.ktor:ktor-client-cio:2.3.2") implementation("io.ktor:ktor-client-okhttp:2.3.2") implementation ("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2") repositories { google() mavenCentral() } } // desktopMain.dependencies { // implementation(compose.desktop.currentOs) // implementation(libs.kotlinx.coroutines.swing) // implementation("io.ktor:ktor-client-okhttp:2.3.2") // implementation("org.jetbrains.exposed:exposed-core:$exposedVersion") // implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion") // implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion") // implementation("org.postgresql:postgresql:42.7.3") // } } } android { namespace = "org.example.project" compileSdk = libs.versions.android.compileSdk.get().toInt() defaultConfig { applicationId = "org.example.project" minSdk = libs.versions.android.minSdk.get().toInt() targetSdk = libs.versions.android.targetSdk.get().toInt() versionCode = 1 versionName = "1.0" } packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } buildTypes { getByName("release") { isMinifyEnabled = false } } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 } } dependencies { implementation(project(":composeApp")) } compose.desktop { application { mainClass = "org.example.project.MainKt" nativeDistributions { targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) packageName = "org.example.project" packageVersion = "1.0.0" } } }