forked from airbnb/lottie-spm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
46 lines (40 loc) · 1.99 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
// swift-tools-version:5.6
import PackageDescription
#if compiler(>=5.9)
/// A precompiled XCFramework of the lottie-ios repo that was compiled with Xcode 15.2 / Swift 5.9.
/// This XCFramework can be used by Xcode 15.0 and later.
let lottieXCFramework = Target.binaryTarget(
name: "Lottie",
url: "https://github.com/airbnb/lottie-ios/releases/download/4.4.3/Lottie-Xcode-15.2.xcframework.zip",
checksum: "546b7e718ed806646b84645ecfb1e1d6a65ac0387ff3f8ecb92dbaf2116cd62c")
#else
/// A precompiled XCFramework of the lottie-ios repo that was compiled with Xcode 14.1 / Swift 5.7.
/// This XCFramework bundle doesn't support visionOS, but does support Xcode 14.
let lottieXCFramework = Target.binaryTarget(
name: "Lottie",
url: "https://github.com/airbnb/lottie-ios/releases/download/4.4.3/Lottie-Xcode-14.1.xcframework.zip",
checksum: "f068488b56880e95964172797df57358a3354c1540158a5f00988fbe76a41dba")
#endif
let package = Package(
name: "Lottie",
platforms: [.iOS("13.0"), .macOS("10.15"), .tvOS("13.0"), .custom("visionOS", versionString: "1.0")],
products: [.library(name: "Lottie", targets: ["Lottie", "_LottieStub"])],
targets: [
lottieXCFramework,
// Without at least one regular (non-binary) target, this package doesn't show up
// in Xcode under "Frameworks, Libraries, and Embedded Content". That prevents
// Lottie from being embedded in the app product, causing the app to crash when
// ran on a physical device. As a workaround, we can include a stub target
// with at least one source file.
// https://github.com/apple/swift-package-manager/issues/6069
.target(name: "_LottieStub"),
.testTarget(
name: "LottieTests",
dependencies: ["Lottie"],
path: "Tests")
])
// Emit an error on Linux, so Swift Package Manager's platform support detection doesn't say this package supports Linux
// https://github.com/airbnb/swift/discussions/197#discussioncomment-4055303
// #if os(Linux)
// #error("Linux is currently not supported")
// #endif