Bankmeister/composeApp/build.gradle.kts

205 lines
5.8 KiB
Plaintext
Raw Normal View History

2024-08-24 19:56:16 +00:00
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kotlinxSerialization)
2024-08-27 09:48:46 +00:00
alias(libs.plugins.sqldelight)
2024-08-24 19:56:16 +00:00
}
2024-08-24 19:56:16 +00:00
kotlin {
js {
2024-08-24 19:56:16 +00:00
moduleName = "composeApp"
browser {
val projectDirPath = project.projectDir.path
commonWebpackConfig {
outputFileName = "composeApp.js"
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
static = (static ?: mutableListOf()).apply {
// Serve sources to debug inside browser
add(projectDirPath)
}
}
}
}
binaries.executable()
2024-09-01 21:32:48 +00:00
useEsModules()
2024-08-24 19:56:16 +00:00
}
androidTarget {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
jvm("desktop")
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "ComposeApp"
isStatic = true
}
}
sourceSets {
val desktopMain by getting
2024-08-24 19:56:16 +00:00
commonMain.dependencies {
implementation(libs.banking.client.model)
implementation(libs.fints4k.banking.client)
implementation(libs.kcsv)
implementation(libs.klf)
implementation(libs.kotlinx.serializable)
2024-08-27 09:48:46 +00:00
implementation(libs.sqldelight.runtime)
implementation(libs.sqldelight.coroutines.extensions)
implementation(libs.sqldelight.paging.extensions)
// UI
2024-08-24 19:56:16 +00:00
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.materialIconsExtended)
2024-08-24 19:56:16 +00:00
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
2024-08-24 19:56:16 +00:00
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.lifecycle.runtime.compose)
}
2024-08-27 09:48:46 +00:00
commonTest.dependencies {
implementation(libs.kotlin.test)
implementation(libs.coroutines.test)
2024-08-27 09:48:46 +00:00
}
androidMain.dependencies {
implementation(compose.preview)
implementation(libs.androidx.activity.compose)
2024-08-27 09:48:46 +00:00
implementation(libs.sqldelight.android.driver)
}
nativeMain.dependencies {
implementation(libs.sqldelight.native.driver)
}
jvmTest.dependencies {
implementation(libs.kotlin.test.junit)
}
2024-08-24 19:56:16 +00:00
desktopMain.dependencies {
implementation(compose.desktop.currentOs)
implementation(libs.kotlinx.coroutines.swing)
2024-08-26 14:57:39 +00:00
2024-08-27 09:48:46 +00:00
implementation(libs.sqldelight.sqlite.driver)
2024-08-26 14:57:39 +00:00
implementation(libs.logback)
2024-08-24 19:56:16 +00:00
}
}
}
2024-08-27 09:48:46 +00:00
sqldelight {
databases {
create("BankmeisterDb") {
packageName.set("net.codinux.banking.dataaccess")
generateAsync = true
schemaOutputDirectory = file("src/commonMain/sqldelight/databases")
2024-08-27 09:48:46 +00:00
}
}
}
2024-08-24 19:56:16 +00:00
android {
namespace = "net.codinux.banking.ui"
compileSdk = libs.versions.android.compileSdk.get().toInt()
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res")
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
defaultConfig {
applicationId = "net.codinux.banking.android" // the appId of the old Bankmeister app to be able to use the old PlayStore entry
2024-08-24 19:56:16 +00:00
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
versionCode = 10
versionName = "1.0.0-Alpha-12"
2024-08-24 19:56:16 +00:00
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
2024-08-24 19:56:16 +00:00
buildTypes {
named("debug") {
applicationIdSuffix = ".develop"
}
named("release") {
2024-08-24 19:56:16 +00:00
isMinifyEnabled = false
}
}
2024-08-24 19:56:16 +00:00
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
2024-08-24 19:56:16 +00:00
buildFeatures {
compose = true
}
2024-08-24 19:56:16 +00:00
dependencies {
debugImplementation(compose.uiTooling)
}
signingConfigs {
named("debug") {
// so that all machines have the same signing key, no matter if app is installed from developer's machine or from Jenkins
storeFile = file("src/androidMain/debug-keystore.jks")
storePassword = "find_my_bugs_before_releasing_me"
keyAlias = "DebugKey"
keyPassword = "find_my_bugs_before_releasing_me"
}
}
2024-08-24 19:56:16 +00:00
}
compose.desktop {
application {
mainClass = "net.codinux.banking.ui.MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "net.codinux.banking.ui"
packageVersion = "1.0.0"
description = "Datenschutzfreundliche Multi-Banking App für die meisten deutschen Banken"
copyright = "© 2024 codinux GmbH & Co.KG. All rights reserved."
vendor = "codinux GmbH & Co.KG"
}
buildTypes.release.proguard {
isEnabled = false
version = "7.4.2"
2024-08-24 19:56:16 +00:00
}
}
}