Complete the MyIceK rename by updating the Kotlin package from ch.parano.myice to ch.parano.myicek across all source sets (androidMain, commonMain, desktopMain, iosMain, commonTest), the build.gradle.kts (namespace, applicationId, mainClass, desktop packageName) and the iOS Info.plist bundle URL name. The myice:// OAuth scheme is kept unchanged as it depends on the backend. Also add pull-to-refresh to ScheduleScreen using Material 3 PullToRefreshBox, replacing the manual loading overlay.
129 lines
4.0 KiB
Kotlin
129 lines
4.0 KiB
Kotlin
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
import java.util.Properties
|
|
import java.io.FileInputStream
|
|
|
|
plugins {
|
|
alias(libs.plugins.kotlin.multiplatform)
|
|
alias(libs.plugins.kotlin.compose)
|
|
alias(libs.plugins.compose.multiplatform)
|
|
alias(libs.plugins.kotlin.serialization)
|
|
alias(libs.plugins.android.application)
|
|
}
|
|
|
|
val keystorePropertiesFile = rootProject.file("keystore.properties")
|
|
val keystoreProperties = Properties()
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
|
}
|
|
|
|
kotlin {
|
|
androidTarget {
|
|
compilations.all {
|
|
compileTaskProvider.configure {
|
|
compilerOptions.jvmTarget.set(JvmTarget.JVM_11)
|
|
}
|
|
}
|
|
}
|
|
|
|
iosArm64()
|
|
iosSimulatorArm64()
|
|
|
|
jvm("desktop")
|
|
|
|
sourceSets {
|
|
val commonMain by getting {
|
|
dependencies {
|
|
implementation(compose.runtime)
|
|
implementation(compose.foundation)
|
|
implementation(compose.material3)
|
|
implementation(compose.components.uiToolingPreview)
|
|
implementation(libs.ktor.client.core)
|
|
implementation(libs.ktor.client.content.negotiation)
|
|
implementation(libs.ktor.serialization.kotlinx.json)
|
|
implementation(libs.kotlinx.serialization.json)
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
implementation(libs.kotlinx.datetime)
|
|
implementation(libs.multiplatform.settings)
|
|
implementation(libs.multiplatform.settings.no.arg)
|
|
implementation(libs.lifecycle.viewmodel.compose)
|
|
}
|
|
}
|
|
val commonTest by getting {
|
|
dependencies {
|
|
implementation(kotlin("test"))
|
|
implementation(libs.ktor.client.mock)
|
|
implementation(libs.kotlinx.coroutines.test)
|
|
implementation(libs.multiplatform.settings.test)
|
|
}
|
|
}
|
|
val androidMain by getting {
|
|
dependencies {
|
|
implementation(libs.ktor.client.cio)
|
|
implementation(libs.androidx.activity.compose)
|
|
}
|
|
}
|
|
val desktopMain by getting {
|
|
dependencies {
|
|
implementation(libs.ktor.client.cio)
|
|
implementation(libs.kotlinx.coroutines.swing)
|
|
implementation(compose.desktop.currentOs)
|
|
}
|
|
}
|
|
}
|
|
|
|
// Darwin engine for all iOS targets
|
|
targets.filterIsInstance<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget>()
|
|
.filter { it.konanTarget.family == org.jetbrains.kotlin.konan.target.Family.IOS }
|
|
.forEach { target ->
|
|
target.compilations.getByName("main").dependencies {
|
|
implementation(libs.ktor.client.darwin)
|
|
}
|
|
}
|
|
}
|
|
|
|
android {
|
|
namespace = "ch.parano.myicek"
|
|
compileSdk = 36
|
|
|
|
defaultConfig {
|
|
applicationId = "ch.parano.myicek"
|
|
minSdk = 24
|
|
targetSdk = 35
|
|
versionCode = 1
|
|
versionName = "1.0"
|
|
}
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
keystoreProperties["storeFile"]?.let { storeFile = rootProject.file(it) }
|
|
storePassword = keystoreProperties["storePassword"] as String?
|
|
keyAlias = keystoreProperties["keyAlias"] as String?
|
|
keyPassword = keystoreProperties["keyPassword"] as String?
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
signingConfig = signingConfigs.getByName("release")
|
|
isMinifyEnabled = false
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
}
|
|
}
|
|
|
|
compose.desktop {
|
|
application {
|
|
mainClass = "ch.parano.myicek.MainKt"
|
|
nativeDistributions {
|
|
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
|
packageName = "myicek"
|
|
packageVersion = "1.0.0"
|
|
}
|
|
}
|
|
}
|