Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable bridging on SkipFirebaseCore and SkipFirebaseFirestore #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,12 @@ let package = Package(
], resources: [.process("Resources")], plugins: skipstone),
]
)

if ProcessInfo.processInfo.environment["SKIP_BRIDGE"] ?? "0" != "0" {
package.dependencies += [.package(url: "https://source.skip.tools/skip-bridge.git", "0.0.0"..<"2.0.0")]
for target in package.targets {
if target.name == "SkipFirebaseCore" || target.name == "SkipFirebaseFirestore" {
target.dependencies += [.product(name: "SkipBridge", package: "skip-bridge")]
}
}
}
3 changes: 3 additions & 0 deletions Sources/SkipFirebaseCore/Skip/skip.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Configuration file for https://skip.tools project
#
# Kotlin dependencies and Gradle build options for this module can be configured here
skip:
bridging: true

settings:
contents:
- block: 'dependencyResolutionManagement'
Expand Down
8 changes: 7 additions & 1 deletion Sources/SkipFirebaseCore/SkipFirebaseCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// under the terms of the GNU Lesser General Public License 3.0
// as published by the Free Software Foundation https://fsf.org

#if !SKIP_BRIDGE
#if SKIP
import Foundation
import OSLog
Expand All @@ -10,12 +11,15 @@ import OSLog
// https://firebase.google.com/docs/reference/android/com/google/firebase/FirebaseApp

public final class FirebaseApp: KotlinConverting<com.google.firebase.FirebaseApp> {
// SKIP @nobridge
public let app: com.google.firebase.FirebaseApp

// SKIP @nobridge
public init(app: com.google.firebase.FirebaseApp) {
self.app = app
}

// SKIP @nobridge
public override func kotlin(nocopy: Bool = false) -> com.google.firebase.FirebaseApp {
app
}
Expand Down Expand Up @@ -97,7 +101,7 @@ public final class FirebaseApp: KotlinConverting<com.google.firebase.FirebaseApp

public final class FirebaseOptions {
public var googleAppID: String
public var gcmSenderID: String!
public var gcmSenderID: String
public var projectID: String?
public var storageBucket: String?
public var apiKey: String?
Expand All @@ -108,6 +112,7 @@ public final class FirebaseOptions {
self.gcmSenderID = gcmSenderID
}

// SKIP @nobridge
public init(options: com.google.firebase.FirebaseOptions) {
self.googleAppID = options.applicationId
self.gcmSenderID = options.gcmSenderId ?? ""
Expand Down Expand Up @@ -142,3 +147,4 @@ public final class FirebaseOptions {
}

#endif
#endif
3 changes: 3 additions & 0 deletions Sources/SkipFirebaseFirestore/Skip/skip.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Configuration file for https://skip.tools project
#
# Kotlin dependencies and Gradle build options for this module can be configured here
skip:
bridging: true

build:
contents:
- block: 'dependencies'
Expand Down
Loading
Loading