-
Notifications
You must be signed in to change notification settings - Fork 1
/
Package.swift
111 lines (98 loc) · 3.33 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
// WARNING:
// This file is automatically generated.
// Do not edit it by hand because the contents will be replaced.
import PackageDescription
let version = "1.1.4"
let packageLibraryName = "ParticleEffects"
// Products define the executables and libraries a package produces, making them visible to other packages.
var products = [
Product.library(
name: "\(packageLibraryName) Library", // has to be named different from the iOSApplication or Swift Playgrounds won't open correctly
targets: [packageLibraryName]
),
]
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
var targets = [
Target.target(
name: packageLibraryName,
dependencies: [
.product(name: "Compatibility Library", package: "compatibility"), // apparently needs to be lowercase. Also note this is "Device Library" not "Device"
// .product(name: "Collections", package: "swift-collections"),
// .product(name: "OrderedCollections", package: "swift-collections"),
// .product(name: "CustomType", package: "customtype"), // apparently needs to be lowercase. Also note this is "Device Library" not "Device"
],
path: "Sources"
),
]
var platforms: [SupportedPlatform] = [ // minimums for Date.now
.macOS("12"),
.tvOS("15"),
.watchOS("8"),
]
#if canImport(PlaygroundSupport)
platforms += [
.iOS("15.2"), // minimum for Swift Playgrounds support
]
#else
platforms += [
.iOS("15"),
]
#endif
#if os(visionOS)
platforms += [
.visionOS("1.0"), // unavailable in Swift Playgrounds
]
#endif
#if canImport(AppleProductTypes) // swift package dump-package fails because of this
import AppleProductTypes
products += [
.iOSApplication(
name: packageLibraryName, // needs to match package name to open properly in Swift Playgrounds
targets: ["\(packageLibraryName)TestAppModule"],
teamIdentifier: "3QPV894C33",
displayVersion: version,
bundleVersion: "1",
appIcon: .asset("AppIcon"),
accentColor: .presetColor(.yellow),
supportedDeviceFamilies: [
.pad,
.phone
],
supportedInterfaceOrientations: [
.portrait,
.landscapeRight,
.landscapeLeft,
.portraitUpsideDown(.when(deviceFamilies: [.pad]))
],
appCategory: .developerTools
),
]
targets += [
.executableTarget(
name: "\(packageLibraryName)TestAppModule",
dependencies: [
.init(stringLiteral: packageLibraryName), // have to use init since normally would be assignable by string literal but we're not using a string literal
],
path: "Development",
resources: [
.process("Resources")
]
),
]
#endif // for Swift Package compiling for https://swiftpackageindex.com/add-a-package
let package = Package(
name: packageLibraryName,
platforms: platforms,
products: products,
// include dependencies
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/kudit/Compatibility", "1.0.18"..<"2.0.0")
// .package(url: "https://github.com/apple/swift-collections", "1.1.1"..<"2.0.0")
// .package(url: "https://github.com/kudit/CustomType", "1.0.0"..<"2.0.0"),
],
targets: targets
)