Skip to content

Commit 6644b1f

Browse files
Installed dependencies;
1 parent b6840be commit 6644b1f

File tree

3 files changed

+73
-51
lines changed

3 files changed

+73
-51
lines changed

build.gradle.kts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
plugins {
2-
// this is necessary to avoid the plugins to be loaded multiple times
3-
// in each subproject's classloader
4-
alias(libs.plugins.androidApplication) apply false
5-
alias(libs.plugins.androidLibrary) apply false
6-
alias(libs.plugins.jetbrainsCompose) apply false
2+
alias(libs.plugins.kotlin) apply false
3+
alias(libs.plugins.android) apply false
4+
alias(libs.plugins.compose) apply false
75
alias(libs.plugins.compose.compiler) apply false
8-
alias(libs.plugins.kotlinMultiplatform) apply false
96
}

composeApp/build.gradle.kts

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
1+
@file:OptIn(ExperimentalKotlinGradlePluginApi::class)
2+
23
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
34
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
45

56
plugins {
6-
alias(libs.plugins.kotlinMultiplatform)
7-
alias(libs.plugins.androidApplication)
8-
alias(libs.plugins.jetbrainsCompose)
7+
alias(libs.plugins.kotlin)
8+
alias(libs.plugins.android)
9+
alias(libs.plugins.compose)
910
alias(libs.plugins.compose.compiler)
1011
}
1112

1213
kotlin {
1314
androidTarget {
14-
@OptIn(ExperimentalKotlinGradlePluginApi::class)
1515
compilerOptions {
1616
jvmTarget.set(JvmTarget.JVM_11)
1717
}
1818
}
19-
19+
2020
listOf(
2121
iosX64(),
2222
iosArm64(),
@@ -27,57 +27,84 @@ kotlin {
2727
isStatic = true
2828
}
2929
}
30-
30+
3131
sourceSets {
32-
3332
androidMain.dependencies {
33+
34+
// compose preview
3435
implementation(compose.preview)
35-
implementation(libs.androidx.activity.compose)
36+
37+
// compose activity
38+
implementation(libs.compose.activity)
39+
40+
// koin
41+
implementation(libs.koin.android)
42+
implementation(libs.koin.android.compose)
3643
}
44+
3745
commonMain.dependencies {
46+
47+
// compose
3848
implementation(compose.runtime)
3949
implementation(compose.foundation)
4050
implementation(compose.material)
4151
implementation(compose.ui)
4252
implementation(compose.components.resources)
4353
implementation(compose.components.uiToolingPreview)
54+
55+
// compose navigation
56+
implementation(libs.compose.navigation)
57+
58+
// viewmodel
59+
implementation(libs.viewmodel)
60+
61+
// koin
62+
api(libs.koin)
63+
implementation(libs.koin.compose)
4464
}
4565
}
4666
}
4767

4868
android {
4969
namespace = "xyz.teamgravity.viewmodelcomposemultiplatform"
50-
compileSdk = libs.versions.android.compileSdk.get().toInt()
70+
compileSdk = libs.versions.sdk.compile.get().toInt()
5171

5272
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
5373
sourceSets["main"].res.srcDirs("src/androidMain/res")
5474
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
5575

5676
defaultConfig {
5777
applicationId = "xyz.teamgravity.viewmodelcomposemultiplatform"
58-
minSdk = libs.versions.android.minSdk.get().toInt()
59-
targetSdk = libs.versions.android.targetSdk.get().toInt()
78+
minSdk = libs.versions.sdk.min.get().toInt()
79+
targetSdk = libs.versions.sdk.target.get().toInt()
6080
versionCode = 1
6181
versionName = "1.0"
6282
}
63-
packaging {
64-
resources {
65-
excludes += "/META-INF/{AL2.0,LGPL2.1}"
66-
}
67-
}
83+
6884
buildTypes {
6985
getByName("release") {
7086
isMinifyEnabled = false
7187
}
7288
}
89+
7390
compileOptions {
7491
sourceCompatibility = JavaVersion.VERSION_11
7592
targetCompatibility = JavaVersion.VERSION_11
7693
}
94+
7795
buildFeatures {
7896
compose = true
7997
}
98+
99+
packaging {
100+
resources {
101+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
102+
}
103+
}
104+
80105
dependencies {
106+
107+
// compose tooling
81108
debugImplementation(compose.uiTooling)
82109
}
83110
}

gradle/libs.versions.toml

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
11
[versions]
2-
agp = "8.2.0"
3-
android-compileSdk = "34"
4-
android-minSdk = "24"
5-
android-targetSdk = "34"
6-
androidx-activityCompose = "1.9.0"
7-
androidx-appcompat = "1.6.1"
8-
androidx-constraintlayout = "2.1.4"
9-
androidx-core-ktx = "1.13.1"
10-
androidx-espresso-core = "3.5.1"
11-
androidx-material = "1.12.0"
12-
androidx-test-junit = "1.1.5"
13-
compose-plugin = "1.6.10"
14-
junit = "4.13.2"
2+
3+
compose-activity = "1.9.0"
4+
compose-navigation = "2.7.0-alpha03"
5+
viewmodel = "2.8.0-rc01"
6+
koin = "3.6.0-alpha3"
7+
koin-compose = "1.2.0-alpha3"
8+
159
kotlin = "2.0.0"
10+
android = "8.4.1"
11+
12+
sdk-min = "24"
13+
sdk-compile = "34"
14+
sdk-target = "34"
15+
compose = "1.6.10"
1616

1717
[libraries]
18-
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
19-
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
20-
junit = { group = "junit", name = "junit", version.ref = "junit" }
21-
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidx-core-ktx" }
22-
androidx-test-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-junit" }
23-
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "androidx-espresso-core" }
24-
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidx-appcompat" }
25-
androidx-material = { group = "com.google.android.material", name = "material", version.ref = "androidx-material" }
26-
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "androidx-constraintlayout" }
27-
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
18+
19+
compose-activity = { group = "androidx.activity", name = "activity-compose", version.ref = "compose-activity" }
20+
compose-navigation = { group = "org.jetbrains.androidx.navigation", name = "navigation-compose", version.ref = "compose-navigation" }
21+
viewmodel = { group = "androidx.lifecycle", name = "lifecycle-viewmodel", version.ref = "viewmodel" }
22+
koin = { group = "io.insert-koin", name = "koin-core", version.ref = "koin" }
23+
koin-android = { group = "io.insert-koin", name = "koin-android", version.ref = "koin" }
24+
koin-android-compose = { group = "io.insert-koin", name = "koin-androidx-compose", version.ref = "koin" }
25+
koin-compose = { group = "io.insert-koin", name = "koin-compose", version.ref = "koin-compose" }
2826

2927
[plugins]
30-
androidApplication = { id = "com.android.application", version.ref = "agp" }
31-
androidLibrary = { id = "com.android.library", version.ref = "agp" }
32-
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
33-
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
34-
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
28+
29+
kotlin = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
30+
android = { id = "com.android.application", version.ref = "android" }
31+
compose = { id = "org.jetbrains.compose", version.ref = "compose" }
32+
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

0 commit comments

Comments
 (0)