|
| 1 | +import ProjectDescription |
| 2 | + |
| 3 | +let macDestinations: Destinations = [.mac] |
| 4 | +let macDeployment: DeploymentTargets = .macOS("26.0") |
| 5 | + |
| 6 | +func framework( |
| 7 | + _ name: String, |
| 8 | + bundleIdSuffix: String, |
| 9 | + dependencies: [TargetDependency] = [] |
| 10 | +) -> [Target] { |
| 11 | + [ |
| 12 | + .target( |
| 13 | + name: name, |
| 14 | + destinations: macDestinations, |
| 15 | + product: .framework, |
| 16 | + bundleId: "com.stuff.\(bundleIdSuffix)", |
| 17 | + deploymentTargets: macDeployment, |
| 18 | + sources: ["\(name)/Sources/**"], |
| 19 | + dependencies: dependencies |
| 20 | + ), |
| 21 | + .target( |
| 22 | + name: "\(name)Tests", |
| 23 | + destinations: macDestinations, |
| 24 | + product: .unitTests, |
| 25 | + bundleId: "com.stuff.\(bundleIdSuffix).tests", |
| 26 | + deploymentTargets: macDeployment, |
| 27 | + sources: ["\(name)/Tests/**"], |
| 28 | + dependencies: [.target(name: name)] |
| 29 | + ), |
| 30 | + ] |
| 31 | +} |
| 32 | + |
| 33 | +func macApp( |
| 34 | + _ name: String, |
| 35 | + bundleIdSuffix: String, |
| 36 | + infoPlist: [String: Plist.Value] = [:], |
| 37 | + dependencies: [TargetDependency] = [] |
| 38 | +) -> [Target] { |
| 39 | + [ |
| 40 | + .target( |
| 41 | + name: name, |
| 42 | + destinations: macDestinations, |
| 43 | + product: .app, |
| 44 | + bundleId: "com.stuff.\(bundleIdSuffix)", |
| 45 | + deploymentTargets: macDeployment, |
| 46 | + infoPlist: .extendingDefault(with: infoPlist), |
| 47 | + sources: ["\(name)/Sources/**"], |
| 48 | + resources: ["\(name)/Resources/**"], |
| 49 | + dependencies: dependencies |
| 50 | + ), |
| 51 | + .target( |
| 52 | + name: "\(name)Tests", |
| 53 | + destinations: macDestinations, |
| 54 | + product: .unitTests, |
| 55 | + bundleId: "com.stuff.\(bundleIdSuffix).tests", |
| 56 | + deploymentTargets: macDeployment, |
| 57 | + sources: ["\(name)/Tests/**"], |
| 58 | + dependencies: [.target(name: name)] |
| 59 | + ), |
| 60 | + ] |
| 61 | +} |
| 62 | + |
| 63 | +let project = Project( |
| 64 | + name: "Stuff", |
| 65 | + options: .options( |
| 66 | + defaultKnownRegions: ["en"], |
| 67 | + developmentRegion: "en" |
| 68 | + ), |
| 69 | + targets: [] |
| 70 | +) |
0 commit comments