Skip to content

Commit 81a3c2b

Browse files
committed
Moved skip test to the outer scope of a project.
1 parent f050896 commit 81a3c2b

File tree

6 files changed

+55
-41
lines changed

6 files changed

+55
-41
lines changed

firebase-app/build.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ kotlin {
5858
}
5959

6060
val supportIosTarget = project.property("skipIosTarget") != "true"
61-
val runIosTests = project.property("firebase-app.skipIosTests") != "true"
62-
6361
if (supportIosTarget) {
6462

6563
fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = {
@@ -144,17 +142,21 @@ kotlin {
144142
val iosSimulatorArm64Main by getting
145143
iosSimulatorArm64Main.dependsOn(iosMain)
146144

147-
if (runIosTests) {
148-
val iosTest by sourceSets.getting
149-
val iosSimulatorArm64Test by sourceSets.getting
150-
iosSimulatorArm64Test.dependsOn(iosTest)
151-
}
145+
val iosTest by sourceSets.getting
146+
val iosSimulatorArm64Test by sourceSets.getting
147+
iosSimulatorArm64Test.dependsOn(iosTest)
152148
}
153149

154150
val jsMain by getting
155151
}
156152
}
157153

154+
if (project.property("firebase-app.skipIosTests") == "true") {
155+
tasks.forEach {
156+
if (it.name.contains("ios") && it.name.contains("test")) { it.enabled = false }
157+
}
158+
}
159+
158160
signing {
159161
val signingKey: String? by project
160162
val signingPassword: String? by project

firebase-common/build.gradle.kts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ kotlin {
4747
}
4848

4949
val supportIosTarget = project.property("skipIosTarget") != "true"
50-
val runIosTests = project.property("firebase-common.skipIosTests") != "true"
5150

5251
if (supportIosTarget) {
5352
ios()
@@ -102,11 +101,9 @@ kotlin {
102101
val iosSimulatorArm64Main by getting
103102
iosSimulatorArm64Main.dependsOn(iosMain)
104103

105-
if (runIosTests) {
106-
val iosTest by sourceSets.getting
107-
val iosSimulatorArm64Test by sourceSets.getting
108-
iosSimulatorArm64Test.dependsOn(iosTest)
109-
}
104+
val iosTest by sourceSets.getting
105+
val iosSimulatorArm64Test by sourceSets.getting
106+
iosSimulatorArm64Test.dependsOn(iosTest)
110107
}
111108

112109
val jsMain by getting {
@@ -117,6 +114,12 @@ kotlin {
117114
}
118115
}
119116

117+
if (project.property("firebase-common.skipIosTests") == "true") {
118+
tasks.forEach {
119+
if (it.name.contains("ios") && it.name.contains("test")) { it.enabled = false }
120+
}
121+
}
122+
120123
signing {
121124
val signingKey: String? by project
122125
val signingPassword: String? by project

firebase-config/build.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ kotlin {
7070
}
7171

7272
val supportIosTarget = project.property("skipIosTarget") != "true"
73-
val runIosTests = project.property("firebase-config.skipIosTests") != "true"
74-
7573
if (supportIosTarget) {
7674
fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = {
7775
val nativeFrameworkPaths = listOf(
@@ -153,17 +151,21 @@ kotlin {
153151
val iosSimulatorArm64Main by getting
154152
iosSimulatorArm64Main.dependsOn(iosMain)
155153

156-
if (runIosTests) {
157-
val iosTest by sourceSets.getting
158-
val iosSimulatorArm64Test by sourceSets.getting
159-
iosSimulatorArm64Test.dependsOn(iosTest)
160-
}
154+
val iosTest by sourceSets.getting
155+
val iosSimulatorArm64Test by sourceSets.getting
156+
iosSimulatorArm64Test.dependsOn(iosTest)
161157
}
162158

163159
val jsMain by getting
164160
}
165161
}
166162

163+
if (project.property("firebase-config.skipIosTests") == "true") {
164+
tasks.forEach {
165+
if (it.name.contains("ios") && it.name.contains("test")) { it.enabled = false }
166+
}
167+
}
168+
167169
signing {
168170
val signingKey: String? by project
169171
val signingPassword: String? by project

firebase-database/build.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ kotlin {
5757
}
5858

5959
val supportIosTarget = project.property("skipIosTarget") != "true"
60-
val runIosTests = project.property("firebase-database.skipIosTests") != "true"
61-
6260
if (supportIosTarget) {
6361
fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = {
6462
val nativeFrameworkPaths = listOf(
@@ -153,17 +151,21 @@ kotlin {
153151
val iosSimulatorArm64Main by getting
154152
iosSimulatorArm64Main.dependsOn(iosMain)
155153

156-
if (runIosTests) {
157-
val iosTest by sourceSets.getting
158-
val iosSimulatorArm64Test by sourceSets.getting
159-
iosSimulatorArm64Test.dependsOn(iosTest)
160-
}
154+
val iosTest by sourceSets.getting
155+
val iosSimulatorArm64Test by sourceSets.getting
156+
iosSimulatorArm64Test.dependsOn(iosTest)
161157
}
162158

163159
val jsMain by getting
164160
}
165161
}
166162

163+
if (project.property("firebase-skipIosTests.skipIosTests") == "true") {
164+
tasks.forEach {
165+
if (it.name.contains("ios") && it.name.contains("test")) { it.enabled = false }
166+
}
167+
}
168+
167169
signing {
168170
val signingKey: String? by project
169171
val signingPassword: String? by project

firebase-firestore/build.gradle.kts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ kotlin {
6060
}
6161

6262
val supportIosTarget = project.property("skipIosTarget") != "true"
63-
val runIosTests = project.property("firebase-firestore.skipIosTests") != "true"
64-
6563
if (supportIosTarget) {
6664
fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = {
6765
val nativeFrameworkPaths = listOf(
@@ -159,16 +157,21 @@ kotlin {
159157
val iosSimulatorArm64Main by getting
160158
iosSimulatorArm64Main.dependsOn(iosMain)
161159

162-
if (runIosTests) {
163-
val iosTest by sourceSets.getting
164-
val iosSimulatorArm64Test by sourceSets.getting
165-
iosSimulatorArm64Test.dependsOn(iosTest)
166-
}
160+
val iosTest by sourceSets.getting
161+
val iosSimulatorArm64Test by sourceSets.getting
162+
iosSimulatorArm64Test.dependsOn(iosTest)
167163
}
168164

169165
val jsMain by getting
170166
}
171167
}
168+
169+
if (project.property("firebase-firestore.skipIosTests") == "true") {
170+
tasks.forEach {
171+
if (it.name.contains("ios") && it.name.contains("test")) { it.enabled = false }
172+
}
173+
}
174+
172175
signing {
173176
val signingKey: String? by project
174177
val signingPassword: String? by project

firebase-functions/build.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ kotlin {
5252
}
5353

5454
val supportIosTarget = project.property("skipIosTarget") != "true"
55-
val runIosTests = project.property("firebase-functions.skipIosTests") != "true"
56-
5755
if (supportIosTarget) {
5856
fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = {
5957
val nativeFrameworkPaths = listOf(
@@ -147,17 +145,21 @@ kotlin {
147145
val iosSimulatorArm64Main by getting
148146
iosSimulatorArm64Main.dependsOn(iosMain)
149147

150-
if (runIosTests) {
151-
val iosTest by sourceSets.getting
152-
val iosSimulatorArm64Test by sourceSets.getting
153-
iosSimulatorArm64Test.dependsOn(iosTest)
154-
}
148+
val iosTest by sourceSets.getting
149+
val iosSimulatorArm64Test by sourceSets.getting
150+
iosSimulatorArm64Test.dependsOn(iosTest)
155151
}
156152

157153
val jsMain by getting
158154
}
159155
}
160156

157+
if (project.property("firebase-functions.skipIosTests") == "true") {
158+
tasks.forEach {
159+
if (it.name.contains("ios") && it.name.contains("test")) { it.enabled = false }
160+
}
161+
}
162+
161163
signing {
162164
val signingKey: String? by project
163165
val signingPassword: String? by project

0 commit comments

Comments
 (0)