Skip to content

Commit 672bbb7

Browse files
authored
Merge pull request #32 from skiptools/skip-bridge
Add support for SkipBridge
2 parents 98118de + ca79891 commit 672bbb7

File tree

13 files changed

+44
-12
lines changed

13 files changed

+44
-12
lines changed

Package.swift

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let package = Package(
3939
.product(name: "SkipModel", package: "skip-model"),
4040
// we would like to use "FirebaseCore", but it is not exposed as a product;
4141
// "FirebaseInstallations" is the next best thing, since it has few depencencies
42-
.product(name: "FirebaseInstallations", package: "firebase-ios-sdk"),
42+
.product(name: "FirebaseInstallations", package: "firebase-ios-sdk", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
4343
], resources: [.process("Resources")], plugins: skipstone),
4444
.testTarget(name: "SkipFirebaseCoreTests", dependencies: [
4545
"SkipFirebaseCore",
@@ -48,7 +48,7 @@ let package = Package(
4848

4949
.target(name: "SkipFirebaseFirestore", dependencies: [
5050
"SkipFirebaseCore",
51-
.product(name: "FirebaseFirestore", package: "firebase-ios-sdk"),
51+
.product(name: "FirebaseFirestore", package: "firebase-ios-sdk", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
5252
], resources: [.process("Resources")], plugins: skipstone),
5353
.testTarget(name: "SkipFirebaseFirestoreTests", dependencies: [
5454
"SkipFirebaseFirestore",
@@ -57,7 +57,7 @@ let package = Package(
5757

5858
.target(name: "SkipFirebaseAuth", dependencies: [
5959
"SkipFirebaseCore",
60-
.product(name: "FirebaseAuth", package: "firebase-ios-sdk"),
60+
.product(name: "FirebaseAuth", package: "firebase-ios-sdk", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
6161
], resources: [.process("Resources")], plugins: skipstone),
6262
.testTarget(name: "SkipFirebaseAuthTests", dependencies: [
6363
"SkipFirebaseAuth",
@@ -66,7 +66,7 @@ let package = Package(
6666

6767
.target(name: "SkipFirebaseAppCheck", dependencies: [
6868
"SkipFirebaseCore",
69-
.product(name: "FirebaseAppCheck", package: "firebase-ios-sdk"),
69+
.product(name: "FirebaseAppCheck", package: "firebase-ios-sdk", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
7070
], resources: [.process("Resources")], plugins: skipstone),
7171
.testTarget(name: "SkipFirebaseAppCheckTests", dependencies: [
7272
"SkipFirebaseAppCheck",
@@ -76,7 +76,7 @@ let package = Package(
7676
.target(name: "SkipFirebaseMessaging", dependencies: [
7777
"SkipFirebaseCore",
7878
.product(name: "SkipUI", package: "skip-ui"),
79-
.product(name: "FirebaseMessaging", package: "firebase-ios-sdk"),
79+
.product(name: "FirebaseMessaging", package: "firebase-ios-sdk", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
8080
], resources: [.process("Resources")], plugins: skipstone),
8181
.testTarget(name: "SkipFirebaseMessagingTests", dependencies: [
8282
"SkipFirebaseMessaging",
@@ -85,7 +85,7 @@ let package = Package(
8585

8686
.target(name: "SkipFirebaseCrashlytics", dependencies: [
8787
"SkipFirebaseCore",
88-
.product(name: "FirebaseCrashlytics", package: "firebase-ios-sdk"),
88+
.product(name: "FirebaseCrashlytics", package: "firebase-ios-sdk", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
8989
], resources: [.process("Resources")], plugins: skipstone),
9090
.testTarget(name: "SkipFirebaseCrashlyticsTests", dependencies: [
9191
"SkipFirebaseCrashlytics",
@@ -94,7 +94,7 @@ let package = Package(
9494

9595
.target(name: "SkipFirebaseAnalytics", dependencies: [
9696
"SkipFirebaseCore",
97-
.product(name: "FirebaseAnalytics", package: "firebase-ios-sdk"),
97+
.product(name: "FirebaseAnalytics", package: "firebase-ios-sdk", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
9898
], resources: [.process("Resources")], plugins: skipstone),
9999
.testTarget(name: "SkipFirebaseAnalyticsTests", dependencies: [
100100
"SkipFirebaseAnalytics",
@@ -103,7 +103,7 @@ let package = Package(
103103

104104
.target(name: "SkipFirebaseRemoteConfig", dependencies: [
105105
"SkipFirebaseCore",
106-
.product(name: "FirebaseRemoteConfig", package: "firebase-ios-sdk"),
106+
.product(name: "FirebaseRemoteConfig", package: "firebase-ios-sdk", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
107107
], resources: [.process("Resources")], plugins: skipstone),
108108
.testTarget(name: "SkipFirebaseRemoteConfigTests", dependencies: [
109109
"SkipFirebaseRemoteConfig",
@@ -112,7 +112,7 @@ let package = Package(
112112

113113
.target(name: "SkipFirebaseDatabase", dependencies: [
114114
"SkipFirebaseCore",
115-
.product(name: "FirebaseDatabase", package: "firebase-ios-sdk"),
115+
.product(name: "FirebaseDatabase", package: "firebase-ios-sdk", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
116116
], resources: [.process("Resources")], plugins: skipstone),
117117
.testTarget(name: "SkipFirebaseDatabaseTests", dependencies: [
118118
"SkipFirebaseDatabase",
@@ -121,7 +121,7 @@ let package = Package(
121121

122122
.target(name: "SkipFirebaseFunctions", dependencies: [
123123
"SkipFirebaseCore",
124-
.product(name: "FirebaseFunctions", package: "firebase-ios-sdk"),
124+
.product(name: "FirebaseFunctions", package: "firebase-ios-sdk", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
125125
], resources: [.process("Resources")], plugins: skipstone),
126126
.testTarget(name: "SkipFirebaseFunctionsTests", dependencies: [
127127
"SkipFirebaseFunctions",
@@ -130,7 +130,7 @@ let package = Package(
130130

131131
.target(name: "SkipFirebaseInstallations", dependencies: [
132132
"SkipFirebaseCore",
133-
.product(name: "FirebaseInstallations", package: "firebase-ios-sdk"),
133+
.product(name: "FirebaseInstallations", package: "firebase-ios-sdk", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
134134
], resources: [.process("Resources")], plugins: skipstone),
135135
.testTarget(name: "SkipFirebaseInstallationsTests", dependencies: [
136136
"SkipFirebaseInstallations",
@@ -139,11 +139,19 @@ let package = Package(
139139

140140
.target(name: "SkipFirebaseStorage", dependencies: [
141141
"SkipFirebaseCore",
142-
.product(name: "FirebaseStorage", package: "firebase-ios-sdk"),
142+
.product(name: "FirebaseStorage", package: "firebase-ios-sdk", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
143143
], resources: [.process("Resources")], plugins: skipstone),
144144
.testTarget(name: "SkipFirebaseStorageTests", dependencies: [
145145
"SkipFirebaseStorage",
146146
.product(name: "SkipTest", package: "skip")
147147
], resources: [.process("Resources")], plugins: skipstone),
148148
]
149149
)
150+
151+
if ProcessInfo.processInfo.environment["SKIP_BRIDGE"] ?? "0" != "0" {
152+
package.dependencies += [.package(url: "https://source.skip.tools/skip-bridge.git", "0.0.0"..<"2.0.0")]
153+
package.targets.forEach({ target in
154+
target.dependencies += [.product(name: "SkipBridge", package: "skip-bridge")]
155+
})
156+
}
157+

Sources/SkipFirebaseAnalytics/SkipFirebaseAnalytics.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// under the terms of the GNU Lesser General Public License 3.0
33
// as published by the Free Software Foundation https://fsf.org
44

5+
#if !SKIP_BRIDGE
56
#if SKIP
67
import SkipFirebaseCore
78
import kotlinx.coroutines.tasks.await
@@ -27,3 +28,4 @@ public final class Analytics {
2728
}
2829
}
2930
#endif
31+
#endif

Sources/SkipFirebaseAppCheck/SkipFirebaseAppCheck.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// under the terms of the GNU Lesser General Public License 3.0
33
// as published by the Free Software Foundation https://fsf.org
44

5+
#if !SKIP_BRIDGE
56
#if SKIP
67
import SkipFirebaseCore
78
import kotlinx.coroutines.tasks.await
@@ -25,3 +26,4 @@ public final class AppCheck {
2526
}
2627
}
2728
#endif
29+
#endif

Sources/SkipFirebaseAuth/SkipFirebaseAuth.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// under the terms of the GNU Lesser General Public License 3.0
33
// as published by the Free Software Foundation https://fsf.org
44

5+
#if !SKIP_BRIDGE
56
#if SKIP
67
import SkipFoundation
78
import SkipFirebaseCore
@@ -226,3 +227,4 @@ public class UserProfileChangeRequest/*: KotlinConverting<com.google.firebase.au
226227
}
227228

228229
#endif
230+
#endif

Sources/SkipFirebaseCore/SkipFirebaseCore.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// under the terms of the GNU Lesser General Public License 3.0
33
// as published by the Free Software Foundation https://fsf.org
44

5+
#if !SKIP_BRIDGE
56
#if SKIP
67
import Foundation
78
import OSLog
@@ -142,3 +143,4 @@ public final class FirebaseOptions {
142143
}
143144

144145
#endif
146+
#endif

Sources/SkipFirebaseCrashlytics/SkipFirebaseCrashlytics.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// under the terms of the GNU Lesser General Public License 3.0
33
// as published by the Free Software Foundation https://fsf.org
44

5+
#if !SKIP_BRIDGE
56
#if SKIP
67
import SkipFirebaseCore
78
import kotlinx.coroutines.tasks.await
@@ -25,3 +26,4 @@ public final class Crashlytics {
2526
// }
2627
}
2728
#endif
29+
#endif

Sources/SkipFirebaseDatabase/SkipFirebaseDatabase.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// under the terms of the GNU Lesser General Public License 3.0
33
// as published by the Free Software Foundation https://fsf.org
44

5+
#if !SKIP_BRIDGE
56
#if SKIP
67
import SkipFirebaseCore
78
import kotlinx.coroutines.tasks.await
@@ -25,3 +26,4 @@ public final class Database {
2526
}
2627
}
2728
#endif
29+
#endif

Sources/SkipFirebaseFirestore/SkipFirebaseFirestore.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// under the terms of the GNU Lesser General Public License 3.0
33
// as published by the Free Software Foundation https://fsf.org
44

5+
#if !SKIP_BRIDGE
56
#if SKIP
67
import Foundation
78
import SkipFirebaseCore
@@ -1117,3 +1118,4 @@ fileprivate func deepSwift(collection: kotlin.collections.Collection<Any>) -> Ar
11171118
}
11181119

11191120
#endif
1121+
#endif

Sources/SkipFirebaseFunctions/SkipFirebaseFunctions.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// under the terms of the GNU Lesser General Public License 3.0
33
// as published by the Free Software Foundation https://fsf.org
44

5+
#if !SKIP_BRIDGE
56
#if SKIP
67
import SkipFoundation
78
import SkipFirebaseCore
@@ -95,3 +96,4 @@ public class HTTPSCallableResult: KotlinConverting<com.google.firebase.functions
9596
}
9697

9798
#endif
99+
#endif

Sources/SkipFirebaseInstallations/SkipFirebaseInstallations.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// under the terms of the GNU Lesser General Public License 3.0
33
// as published by the Free Software Foundation https://fsf.org
44

5+
#if !SKIP_BRIDGE
56
#if SKIP
67
import SkipFirebaseCore
78
import kotlinx.coroutines.tasks.await
@@ -22,3 +23,4 @@ public final class Installations {
2223
}
2324
}
2425
#endif
26+
#endif

0 commit comments

Comments
 (0)