Skip to content

Instantly share code, notes, and snippets.

@FromAtom
Created September 29, 2025 15:38
Show Gist options
  • Save FromAtom/be727e4588fc8bb4f982aedbc4696f26 to your computer and use it in GitHub Desktop.
Save FromAtom/be727e4588fc8bb4f982aedbc4696f26 to your computer and use it in GitHub Desktop.
private enum Targets: CaseIterable {
case ios
case search
case setting
case welcome
private var definition: PackageDescription.Target {
switch self {
case .ios: .target(
name: "iOS",
dependencies: [
.product(.firebaseCrashlytics),
.product(.firebaseAnalytics),
.product(.firebaseRemoteConfig),
.target(.search),
.target(.setting),
.target(.welcome)
]
)
case .search: .target(
name: "Search",
dependencies: [
.product(.rswift),
.product(.firebaseCrashlytics),
.product(.firebaseAnalytics)
],
plugins: [
.plugin(name: "RswiftGenerateInternalResources", package: "R.swift")
]
)
case .setting: .target(
name: "Setting",
dependencies: [
.product(.rswift),
.product(.firebaseCrashlytics),
.product(.firebaseAnalytics)
],
plugins: [
.plugin(name: "RswiftGenerateInternalResources", package: "R.swift")
]
)
case .welcome: .target(
name: "Welcome",
dependencies: [
.product(.rswift),
.product(.firebaseCrashlytics),
.product(.firebaseAnalytics)
],
plugins: [
.plugin(name: "RswiftGenerateInternalResources", package: "R.swift")
]
)
}
}
var name: String { definition.name }
var target: PackageDescription.Target { definition }
}
extension PackageDescription.Target.Dependency {
fileprivate static func target(_ target: Targets) -> Self {
.target(name: target.name)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment