Created
September 29, 2025 15:38
-
-
Save FromAtom/be727e4588fc8bb4f982aedbc4696f26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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