-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded and new project structure (#15)
* Upgraded libraries versions and gradle wrapper * moved to new standard module * added missing desktop dependencies * removed unneeded files * corrected versioning for android and desktop * added run config for desktop * updated README.md * missing new line * ktlint issues * ktlint issues
- Loading branch information
1 parent
3cd6e38
commit 496ca35
Showing
91 changed files
with
623 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,5 @@ google-services.json | |
xcuserdata | ||
|
||
*.klib | ||
.kotlin/metadata | ||
.kotlin/metadata | ||
.kotlin/sessions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Adoptme [desktopRun]" type="GradleRunConfiguration" factoryName="Gradle" nameIsGenerated="true"> | ||
<ExternalSystemSettings> | ||
<option name="executionName" /> | ||
<option name="externalProjectPath" value="$PROJECT_DIR$" /> | ||
<option name="externalSystemIdString" value="GRADLE" /> | ||
<option name="scriptParameters" value="-DmainClass=MainKt --quiet" /> | ||
<option name="taskDescriptions"> | ||
<list /> | ||
</option> | ||
<option name="taskNames"> | ||
<list> | ||
<option value="desktopRun" /> | ||
</list> | ||
</option> | ||
<option name="vmOptions" /> | ||
</ExternalSystemSettings> | ||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess> | ||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess> | ||
<DebugAllEnabled>false</DebugAllEnabled> | ||
<RunAsTest>false</RunAsTest> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,252 @@ | ||
|
||
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.android.application) | ||
alias(libs.plugins.compose.multiplatform) | ||
alias(libs.plugins.compose.compiler) | ||
} | ||
|
||
val versionNum: String? by project | ||
val versionMajor = properties["multiplatformkickstarter.version.major"].toString().toInt() | ||
val versionMinor = properties["multiplatformkickstarter.version.minor"].toString().toInt() | ||
val versionPatch = properties["multiplatformkickstarter.version.patch"].toString().toInt() | ||
|
||
fun versionCode(): Int { | ||
versionNum?.let { | ||
return (versionMajor * 1000000) + (versionMinor * 1000) + it.toInt() | ||
} ?: return 1 | ||
} | ||
|
||
kotlin { | ||
/*@OptIn(ExperimentalWasmDsl::class) | ||
wasmJs { | ||
moduleName = "composeApp" | ||
browser { | ||
commonWebpackConfig { | ||
outputFileName = "composeApp.js" | ||
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply { | ||
static = (static ?: mutableListOf()).apply { | ||
// Serve sources to debug inside browser | ||
add(project.projectDir.path) | ||
} | ||
} | ||
} | ||
} | ||
binaries.executable() | ||
}*/ | ||
androidTarget { | ||
@OptIn(ExperimentalKotlinGradlePluginApi::class) | ||
compilerOptions { | ||
jvmTarget.set(JvmTarget.JVM_17) | ||
} | ||
} | ||
jvm("desktop") | ||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { iosTarget -> | ||
iosTarget.binaries.framework { | ||
baseName = "ComposeApp" | ||
isStatic = true | ||
} | ||
} | ||
sourceSets { | ||
val desktopMain by getting | ||
androidMain.dependencies { | ||
implementation(compose.preview) | ||
implementation(libs.androidx.activity.compose) | ||
implementation(libs.ktor.client.android) | ||
} | ||
commonMain.dependencies { | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
implementation(compose.material) | ||
implementation(compose.ui) | ||
implementation(compose.components.resources) | ||
implementation(compose.components.uiToolingPreview) | ||
implementation(project(":shared")) | ||
|
||
// Dependency Injection | ||
implementation(libs.koin.core) | ||
implementation(libs.koin.test) | ||
implementation(libs.koin.compose) | ||
} | ||
desktopMain.dependencies { | ||
implementation(compose.desktop.currentOs) | ||
implementation(libs.skiko) | ||
implementation(compose.ui) | ||
implementation(compose.foundation) | ||
implementation(compose.material) | ||
implementation(compose.material3) | ||
implementation(compose.animation) | ||
implementation(compose.materialIconsExtended) | ||
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) | ||
implementation(compose.components.resources) | ||
implementation(libs.skiko.macos.arm64) | ||
|
||
implementation(libs.androidx.compose.ui.util) | ||
|
||
implementation(libs.kotlinx.serialization.json) | ||
implementation(libs.kotlinx.datetime) | ||
implementation(libs.kotlinx.coroutines.core) | ||
implementation(libs.kotlinx.coroutines.swingui) | ||
implementation(libs.ktor.client) | ||
implementation(libs.ktor.client.java) | ||
implementation(libs.ktor.client.content.negotiation) | ||
implementation(libs.ktor.server.serialization.kotlinx.json) | ||
|
||
// Kamel for image loading | ||
implementation(libs.kamel) | ||
|
||
// Voyager for Navigation | ||
implementation(libs.voyager.navigator) | ||
implementation(libs.voyager.bottom.sheet.navigator) | ||
implementation(libs.voyager.tab.navigator) | ||
implementation(libs.voyager.transitions) | ||
implementation(libs.voyager.koin) | ||
|
||
// Multiplatform Settings to encrypted key-value data | ||
implementation(libs.multiplatform.settings.no.arg) | ||
implementation(libs.multiplatform.settings.serialization) | ||
|
||
// Dependency Injection | ||
implementation(libs.koin.core) | ||
implementation(libs.koin.test) | ||
implementation(libs.koin.compose) | ||
|
||
// Logging | ||
implementation(libs.kermit) | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "com.multiplatformkickstarter.app.android" | ||
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 = "com.multiplatformkickstarter.app.android" | ||
minSdk = libs.versions.android.minSdk.get().toInt() | ||
targetSdk = libs.versions.android.targetSdk.get().toInt() | ||
versionCode = versionCode() | ||
versionName = "$versionMajor.$versionMinor.$versionPatch" | ||
} | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
} | ||
buildTypes { | ||
getByName("release") { | ||
isMinifyEnabled = false | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
buildFeatures { | ||
compose = true | ||
} | ||
dependencies { | ||
implementation(project(":shared")) | ||
|
||
implementation(platform(libs.compose.bom)) | ||
|
||
implementation(libs.androidx.core.ktx) | ||
implementation(libs.androidx.core.splashscreen) | ||
implementation(libs.androidx.tracing.ktx) | ||
|
||
implementation(libs.androidx.ui) | ||
implementation(libs.androidx.material) | ||
implementation(libs.androidx.material3) | ||
implementation(libs.androidx.material3.window.size) | ||
implementation(libs.androidx.ui.tooling.preview) | ||
|
||
implementation(libs.androidx.activity.compose) | ||
implementation(libs.accompanist.systemuicontroller) | ||
|
||
implementation(libs.koin.core) | ||
implementation(libs.koin.android) | ||
|
||
implementation(platform(libs.firebase.bom)) | ||
implementation(libs.firebase.analytics.ktx) | ||
|
||
testImplementation(libs.junit) | ||
testImplementation(libs.koin.test) | ||
androidTestImplementation(libs.androidx.junit) | ||
androidTestImplementation(libs.androidx.espresso.core) | ||
|
||
// androidTestImplementation("androidx.compose.ui:ui-test-junit4") | ||
debugImplementation(libs.androidx.ui.tooling) | ||
} | ||
} | ||
|
||
compose.desktop { | ||
application { | ||
mainClass = "MainKt" | ||
|
||
nativeDistributions { | ||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) | ||
packageName = "com.multiplatformkickstarter.app" | ||
packageVersion = "$versionMajor.$versionMinor.$versionPatch" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(compose.desktop.currentOs) | ||
implementation(libs.skiko) | ||
implementation(compose.ui) | ||
implementation(compose.foundation) | ||
implementation(compose.material) | ||
implementation(compose.material3) | ||
implementation(compose.animation) | ||
implementation(compose.materialIconsExtended) | ||
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) | ||
implementation(compose.components.resources) | ||
implementation(libs.skiko.macos.arm64) | ||
implementation(project(":shared")) | ||
|
||
implementation(libs.androidx.compose.ui.util) | ||
|
||
implementation(libs.kotlinx.serialization.json) | ||
implementation(libs.kotlinx.datetime) | ||
implementation(libs.kotlinx.coroutines.core) | ||
implementation(libs.kotlinx.coroutines.swingui) | ||
implementation(libs.ktor.client) | ||
implementation(libs.ktor.client.java) | ||
implementation(libs.ktor.client.content.negotiation) | ||
implementation(libs.ktor.server.serialization.kotlinx.json) | ||
|
||
// Kamel for image loading | ||
implementation(libs.kamel) | ||
|
||
// Voyager for Navigation | ||
implementation(libs.voyager.navigator) | ||
implementation(libs.voyager.bottom.sheet.navigator) | ||
implementation(libs.voyager.tab.navigator) | ||
implementation(libs.voyager.transitions) | ||
implementation(libs.voyager.koin) | ||
|
||
// Multiplatform Settings to encrypted key-value data | ||
implementation(libs.multiplatform.settings.no.arg) | ||
implementation(libs.multiplatform.settings.serialization) | ||
|
||
// Dependency Injection | ||
implementation(libs.koin.core) | ||
implementation(libs.koin.test) | ||
implementation(libs.koin.compose) | ||
|
||
// Logging | ||
implementation(libs.kermit) | ||
} | ||
} |
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.