Skip to content

Commit 22b0de8

Browse files
committed
Clean up sourceset dependency deprecated api
1 parent 08f5fd8 commit 22b0de8

3 files changed

Lines changed: 56 additions & 88 deletions

File tree

‎app/build.gradle.kts‎

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -78,49 +78,39 @@ kotlin {
7878
}
7979

8080
sourceSets {
81-
val commonMain by getting {
82-
dependencies {
83-
// Only need to add this as api if you wish to add your own AppDelegate in swift
84-
api(project(":decompose-router"))
85-
86-
implementation(compose.runtime)
87-
implementation(compose.foundation)
88-
implementation(compose.material3)
89-
implementation(compose.materialIconsExtended)
90-
}
81+
commonMain.dependencies {
82+
// Only need to add this as api if you wish to add your own AppDelegate in swift
83+
api(project(":decompose-router"))
84+
85+
implementation(compose.runtime)
86+
implementation(compose.foundation)
87+
implementation(compose.material3)
88+
implementation(compose.materialIconsExtended)
9189
}
9290

93-
val commonTest by getting {
94-
dependencies {
95-
implementation(kotlin("test"))
96-
}
91+
commonTest.dependencies {
92+
implementation(kotlin("test"))
9793
}
9894

99-
val androidMain by getting {
100-
dependencies {
101-
implementation(libs.androidx.activity.ktx)
102-
implementation(libs.androidx.activity.compose)
103-
implementation(libs.androidx.fragment.ktx)
104-
}
95+
androidMain.dependencies {
96+
implementation(libs.androidx.activity.ktx)
97+
implementation(libs.androidx.activity.compose)
98+
implementation(libs.androidx.fragment.ktx)
10599
}
106100

107-
val androidDeviceTest by getting {
108-
dependencies {
109-
implementation(libs.compose.ui.junit4)
110-
implementation(libs.compose.ui.test.manifest)
111-
// compose-ui-test pulls in espresso-core 3.5.0 transitively, whose reflective
112-
// InputManager.getInstance() call throws NoSuchMethodException on newer Android
113-
// (API 35+). 3.7.0 switches to getSystemService and fixes instrumented tests.
114-
implementation(libs.espresso.core)
115-
}
101+
named("androidDeviceTest").dependencies {
102+
implementation(libs.compose.ui.junit4)
103+
implementation(libs.compose.ui.test.manifest)
104+
// compose-ui-test pulls in espresso-core 3.5.0 transitively, whose reflective
105+
// InputManager.getInstance() call throws NoSuchMethodException on newer Android
106+
// (API 35+). 3.7.0 switches to getSystemService and fixes instrumented tests.
107+
implementation(libs.espresso.core)
116108
}
117109

118-
val desktopMain by getting {
119-
dependencies {
120-
implementation(compose.desktop.currentOs)
121-
implementation(libs.decompose.compose)
122-
implementation(libs.kotlinx.coroutines.swing)
123-
}
110+
named("desktopMain").dependencies {
111+
implementation(compose.desktop.currentOs)
112+
implementation(libs.decompose.compose)
113+
implementation(libs.kotlinx.coroutines.swing)
124114
}
125115
}
126116
}

‎decompose-router-wear/build.gradle.kts‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,18 @@ kotlin {
2222
jvm()
2323

2424
sourceSets {
25-
val androidMain by getting {
26-
dependencies {
27-
api(project(":decompose-router"))
25+
androidMain.dependencies {
26+
api(project(":decompose-router"))
2827

29-
implementation(compose.uiTooling)
30-
implementation(compose.materialIconsExtended)
31-
implementation(libs.horologist.compose.layouts)
32-
implementation(libs.wear.compose.foundation)
33-
implementation(libs.wear.compose.material)
34-
implementation(libs.wear.compose.ui.tooling)
35-
implementation(libs.androidx.activity.compose)
36-
implementation(libs.decompose)
37-
implementation(libs.decompose.compose)
38-
}
28+
implementation(compose.uiTooling)
29+
implementation(compose.materialIconsExtended)
30+
implementation(libs.horologist.compose.layouts)
31+
implementation(libs.wear.compose.foundation)
32+
implementation(libs.wear.compose.material)
33+
implementation(libs.wear.compose.ui.tooling)
34+
implementation(libs.androidx.activity.compose)
35+
implementation(libs.decompose)
36+
implementation(libs.decompose.compose)
3937
}
4038
}
4139
}

‎decompose-router/build.gradle.kts‎

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -46,55 +46,35 @@ kotlin {
4646
}
4747

4848
sourceSets {
49-
val commonMain by getting {
50-
dependencies {
51-
api(libs.decompose)
52-
api(libs.decompose.compose)
49+
commonMain.dependencies {
50+
api(libs.decompose)
51+
api(libs.decompose.compose)
5352

54-
implementation(compose.runtime)
55-
implementation(compose.foundation)
56-
implementation(libs.kotlinx.serialization.core)
57-
}
53+
implementation(compose.runtime)
54+
implementation(compose.foundation)
55+
implementation(libs.kotlinx.serialization.core)
5856
}
5957

60-
val commonTest by getting {
61-
dependencies {
62-
implementation(kotlin("test"))
63-
}
58+
commonTest.dependencies {
59+
implementation(kotlin("test"))
6460
}
6561

66-
val iosArm64Main by getting
67-
val iosSimulatorArm64Main by getting
68-
val iosMain by creating {
69-
dependsOn(commonMain)
70-
iosArm64Main.dependsOn(this)
71-
iosSimulatorArm64Main.dependsOn(this)
72-
dependencies {
73-
}
62+
androidMain.dependencies {
63+
implementation(compose.material3)
64+
implementation(libs.decompose)
65+
implementation(libs.decompose.compose)
66+
implementation(libs.androidx.activity.ktx)
67+
implementation(libs.androidx.activity.compose)
68+
implementation(libs.androidx.fragment.ktx)
7469
}
7570

76-
val androidMain by getting {
77-
dependencies {
78-
implementation(compose.material3)
79-
implementation(libs.decompose)
80-
implementation(libs.decompose.compose)
81-
implementation(libs.androidx.activity.ktx)
82-
implementation(libs.androidx.activity.compose)
83-
implementation(libs.androidx.fragment.ktx)
84-
}
71+
named("androidDeviceTest").dependencies {
72+
implementation(libs.compose.ui.junit4)
73+
implementation(libs.compose.ui.test.manifest)
8574
}
8675

87-
val androidDeviceTest by getting {
88-
dependencies {
89-
implementation(libs.compose.ui.junit4)
90-
implementation(libs.compose.ui.test.manifest)
91-
}
92-
}
93-
94-
val jsMain by getting {
95-
dependencies {
96-
implementation("org.jetbrains.kotlin-wrappers:kotlin-browser:1.0.0-pre.752")
97-
}
76+
jsMain.dependencies {
77+
implementation("org.jetbrains.kotlin-wrappers:kotlin-browser:1.0.0-pre.752")
9878
}
9979
}
10080
}

0 commit comments

Comments
 (0)