Skip to content

Commit 262cdae

Browse files
Installed dependencies;
1 parent 12d3e72 commit 262cdae

File tree

3 files changed

+49
-56
lines changed

3 files changed

+49
-56
lines changed

build.gradle.kts

Lines changed: 4 additions & 7 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.composeMultiplatform) apply false
7-
alias(libs.plugins.composeCompiler) apply false
8-
alias(libs.plugins.kotlinMultiplatform) apply false
2+
alias(libs.plugins.kotlin) apply false
3+
alias(libs.plugins.android) apply false
4+
alias(libs.plugins.compose) apply false
5+
alias(libs.plugins.compose.compiler) apply false
96
}

composeApp/build.gradle.kts

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
21
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
32
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
43

54
plugins {
6-
alias(libs.plugins.kotlinMultiplatform)
7-
alias(libs.plugins.androidApplication)
8-
alias(libs.plugins.composeMultiplatform)
9-
alias(libs.plugins.composeCompiler)
5+
alias(libs.plugins.kotlin)
6+
alias(libs.plugins.android)
7+
alias(libs.plugins.compose)
8+
alias(libs.plugins.compose.compiler)
109
}
1110

1211
kotlin {
@@ -16,7 +15,7 @@ kotlin {
1615
jvmTarget.set(JvmTarget.JVM_11)
1716
}
1817
}
19-
18+
2019
listOf(
2120
iosX64(),
2221
iosArm64(),
@@ -27,54 +26,66 @@ kotlin {
2726
isStatic = true
2827
}
2928
}
30-
29+
3130
sourceSets {
32-
3331
androidMain.dependencies {
32+
33+
// compose preview
3434
implementation(compose.preview)
35-
implementation(libs.androidx.activity.compose)
35+
36+
// compose activity
37+
implementation(libs.compose.activity)
3638
}
39+
3740
commonMain.dependencies {
41+
42+
// compose
3843
implementation(compose.runtime)
3944
implementation(compose.foundation)
4045
implementation(compose.material)
4146
implementation(compose.ui)
4247
implementation(compose.components.resources)
4348
implementation(compose.components.uiToolingPreview)
44-
implementation(libs.androidx.lifecycle.viewmodel)
45-
implementation(libs.androidx.lifecycle.runtime.compose)
4649
}
4750
}
4851
}
4952

5053
android {
5154
namespace = "xyz.teamgravity.kmpsharingnativeuicomponent"
52-
compileSdk = libs.versions.android.compileSdk.get().toInt()
55+
compileSdk = libs.versions.sdk.compile.get().toInt()
56+
57+
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
58+
sourceSets["main"].res.srcDirs("src/androidMain/res")
59+
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
5360

5461
defaultConfig {
5562
applicationId = "xyz.teamgravity.kmpsharingnativeuicomponent"
56-
minSdk = libs.versions.android.minSdk.get().toInt()
57-
targetSdk = libs.versions.android.targetSdk.get().toInt()
63+
minSdk = libs.versions.sdk.min.get().toInt()
64+
targetSdk = libs.versions.sdk.target.get().toInt()
5865
versionCode = 1
5966
versionName = "1.0"
6067
}
68+
6169
packaging {
6270
resources {
6371
excludes += "/META-INF/{AL2.0,LGPL2.1}"
6472
}
6573
}
74+
6675
buildTypes {
6776
getByName("release") {
6877
isMinifyEnabled = false
6978
}
7079
}
80+
7181
compileOptions {
7282
sourceCompatibility = JavaVersion.VERSION_11
7383
targetCompatibility = JavaVersion.VERSION_11
7484
}
75-
}
7685

77-
dependencies {
78-
debugImplementation(compose.uiTooling)
79-
}
86+
dependencies {
8087

88+
// compose ui tooling
89+
debugImplementation(compose.uiTooling)
90+
}
91+
}

gradle/libs.versions.toml

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,22 @@
11
[versions]
2-
agp = "8.5.2"
3-
android-compileSdk = "34"
4-
android-minSdk = "24"
5-
android-targetSdk = "34"
6-
androidx-activityCompose = "1.9.3"
7-
androidx-appcompat = "1.7.0"
8-
androidx-constraintlayout = "2.2.0"
9-
androidx-core-ktx = "1.15.0"
10-
androidx-espresso-core = "3.6.1"
11-
androidx-lifecycle = "2.8.4"
12-
androidx-material = "1.12.0"
13-
androidx-test-junit = "1.2.1"
14-
compose-multiplatform = "1.7.0"
15-
junit = "4.13.2"
2+
3+
compose-activity = "1.10.1"
4+
165
kotlin = "2.1.0"
6+
android = "8.6.1"
7+
compose = "1.7.0"
8+
9+
sdk-min = "26"
10+
sdk-compile = "35"
11+
sdk-target = "35"
1712

1813
[libraries]
19-
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
20-
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
21-
junit = { group = "junit", name = "junit", version.ref = "junit" }
22-
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidx-core-ktx" }
23-
androidx-test-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-junit" }
24-
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "androidx-espresso-core" }
25-
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidx-appcompat" }
26-
androidx-material = { group = "com.google.android.material", name = "material", version.ref = "androidx-material" }
27-
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "androidx-constraintlayout" }
28-
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
29-
androidx-lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-viewmodel", version.ref = "androidx-lifecycle" }
30-
androidx-lifecycle-runtime-compose = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
14+
15+
compose-activity = { group = "androidx.activity", name = "activity-compose", version.ref = "compose-activity" }
3116

3217
[plugins]
33-
androidApplication = { id = "com.android.application", version.ref = "agp" }
34-
androidLibrary = { id = "com.android.library", version.ref = "agp" }
35-
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" }
36-
composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
37-
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
18+
19+
kotlin = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
20+
android = { id = "com.android.application", version.ref = "android" }
21+
compose = { id = "org.jetbrains.compose", version.ref = "compose" }
22+
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

0 commit comments

Comments
 (0)