Swift 包的 Firebase 产品项名称
Firebase productItem names for Swift Package
我正在考虑编写一个 Swift 包来帮助我处理我的 Firebase 项目和 iOS 的注册/身份验证等过程。构建包时,部分 PackageDescription
要求您列出 productItems
依赖项。文档中的这个示例显示 FirebaseAuth
,我想包括 Storage
、Firestore
和 Swift-Beta
项。我在哪里可以找到这些 productItem
个名字的正确拼写?
.target(
name: "MyTargetName",
dependencies: [
.product(name: "FirebaseAuth", package: "Firebase"),
// ...
]
),
您可以在 Firebase 的 Package.swift
中找到产品标识符
这是一个示例 Package.swift
,其中包含所有产品的完整列表:
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "FirebaseSPMTest2",
platforms: [.iOS(.v11), .macOS(.v10_12), .tvOS(.v10), .watchOS(.v7)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "FirebaseSPMTest2",
targets: ["FirebaseSPMTest2"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(name: "Firebase", url: "https://github.com/firebase/firebase-ios-sdk.git", from: .init("8.0.0"))
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "FirebaseSPMTest2",
dependencies: [
.product(name: "FirebaseAnalytics", package: "Firebase"),
.product(name: "FirebaseAnalyticsWithoutAdIdSupport", package: "Firebase"),
.product(name: "FirebaseAnalyticsSwift-Beta", package: "Firebase"),
.product(name: "FirebaseAnalyticsSwift-Beta", package: "Firebase"),
.product(name: "FirebaseAuth", package: "Firebase"),
.product(name: "FirebaseAppCheck", package: "Firebase"),
.product(name: "FirebaseAppDistribution-Beta", package: "Firebase"),
.product(name: "FirebaseCrashlytics", package: "Firebase"),
.product(name: "FirebaseDatabase", package: "Firebase"),
.product(name: "FirebaseDatabaseSwift-Beta", package: "Firebase"),
.product(name: "FirebaseDynamicLinks", package: "Firebase"),
.product(name: "FirebaseFirestore", package: "Firebase"),
.product(name: "FirebaseFirestoreSwift-Beta", package: "Firebase"),
.product(name: "FirebaseFunctions", package: "Firebase"),
.product(name: "FirebaseInAppMessaging-Beta", package: "Firebase"),
.product(name: "FirebaseInAppMessagingSwift-Beta", package: "Firebase"),
.product(name: "FirebaseInstallations", package: "Firebase"),
.product(name: "FirebaseMessaging", package: "Firebase"),
.product(name: "FirebaseMLModelDownloader", package: "Firebase"),
.product(name: "FirebasePerformance", package: "Firebase"),
.product(name: "FirebaseRemoteConfig", package: "Firebase"),
.product(name: "FirebaseStorage", package: "Firebase"),
.product(name: "FirebaseStorageSwift-Beta", package: "Firebase"),
]),
.testTarget(
name: "FirebaseSPMTest2Tests",
dependencies: ["FirebaseSPMTest2"]),
]
)
我正在考虑编写一个 Swift 包来帮助我处理我的 Firebase 项目和 iOS 的注册/身份验证等过程。构建包时,部分 PackageDescription
要求您列出 productItems
依赖项。文档中的这个示例显示 FirebaseAuth
,我想包括 Storage
、Firestore
和 Swift-Beta
项。我在哪里可以找到这些 productItem
个名字的正确拼写?
.target(
name: "MyTargetName",
dependencies: [
.product(name: "FirebaseAuth", package: "Firebase"),
// ...
]
),
您可以在 Firebase 的 Package.swift
这是一个示例 Package.swift
,其中包含所有产品的完整列表:
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "FirebaseSPMTest2",
platforms: [.iOS(.v11), .macOS(.v10_12), .tvOS(.v10), .watchOS(.v7)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "FirebaseSPMTest2",
targets: ["FirebaseSPMTest2"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(name: "Firebase", url: "https://github.com/firebase/firebase-ios-sdk.git", from: .init("8.0.0"))
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "FirebaseSPMTest2",
dependencies: [
.product(name: "FirebaseAnalytics", package: "Firebase"),
.product(name: "FirebaseAnalyticsWithoutAdIdSupport", package: "Firebase"),
.product(name: "FirebaseAnalyticsSwift-Beta", package: "Firebase"),
.product(name: "FirebaseAnalyticsSwift-Beta", package: "Firebase"),
.product(name: "FirebaseAuth", package: "Firebase"),
.product(name: "FirebaseAppCheck", package: "Firebase"),
.product(name: "FirebaseAppDistribution-Beta", package: "Firebase"),
.product(name: "FirebaseCrashlytics", package: "Firebase"),
.product(name: "FirebaseDatabase", package: "Firebase"),
.product(name: "FirebaseDatabaseSwift-Beta", package: "Firebase"),
.product(name: "FirebaseDynamicLinks", package: "Firebase"),
.product(name: "FirebaseFirestore", package: "Firebase"),
.product(name: "FirebaseFirestoreSwift-Beta", package: "Firebase"),
.product(name: "FirebaseFunctions", package: "Firebase"),
.product(name: "FirebaseInAppMessaging-Beta", package: "Firebase"),
.product(name: "FirebaseInAppMessagingSwift-Beta", package: "Firebase"),
.product(name: "FirebaseInstallations", package: "Firebase"),
.product(name: "FirebaseMessaging", package: "Firebase"),
.product(name: "FirebaseMLModelDownloader", package: "Firebase"),
.product(name: "FirebasePerformance", package: "Firebase"),
.product(name: "FirebaseRemoteConfig", package: "Firebase"),
.product(name: "FirebaseStorage", package: "Firebase"),
.product(name: "FirebaseStorageSwift-Beta", package: "Firebase"),
]),
.testTarget(
name: "FirebaseSPMTest2Tests",
dependencies: ["FirebaseSPMTest2"]),
]
)