-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.swift
More file actions
155 lines (147 loc) · 7.1 KB
/
Copy pathPackage.swift
File metadata and controls
155 lines (147 loc) · 7.1 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// swift-tools-version:6.0
//
// RTCAdapter — closed-source release manifest.
// Shipped alongside RTCAdapter-<VERSION>.zip to a standalone release repo.
//
// Consumer usage:
// .package(url: "<release repo git URL>", from: "<VERSION>")
// main app target: .product(name: "RTCAdapter", package: "<repo name>")
// import RTCAdapter
// extension target: .product(name: "RTCAdapterScreenShareExt", package: "<repo name>")
// import RTCAdapterScreenShareExt
//
// Publishing (scripts/release-adapter.sh automates the placeholder filling):
// 1. Fill in the placeholders below:
// - <TODO_RTCADAPTER_URL> remote URL of the RTCAdapter zip
// - <TODO_RTCADAPTER_CHECKSUM> its checksum
// - <TODO_RTCADAPTERSCREENSHAREEXT_URL> remote URL of the RTCAdapterScreenShareExt zip
// - <TODO_RTCADAPTERSCREENSHAREEXT_CHECKSUM> its checksum
// 2. Push this Package.swift + Sources/RTCAdapterTRTCLink/ to the release repo.
// 3. git tag <VERSION>.
//
// This manifest is fully self-contained: AmazonIVSBroadcast and the TRTC
// frameworks are declared as binaryTargets, with no external SwiftPM package
// dependency. That is required — a package consumed by a version tag cannot
// depend on a revision/branch-pinned package, so we reference the vendor
// xcframework zips directly instead of the Professional_SwiftPM package.
import PackageDescription
// AmazonIVSBroadcast — AWS official xcframework zip.
// Keep in sync with iOS/AWSAdapter/Vendor/AmazonIVSBroadcast/Package.swift.
let amazonIVSBroadcastURL = "https://broadcast.live-video.net/1.42.0/AmazonIVSBroadcast-Stages.xcframework.zip"
let amazonIVSBroadcastChecksum = "3399b53b60871bce070ac598d89ed77f7181f05ee9dd6faabd3fffdf19051250"
let package = Package(
name: "RTCAdapter",
platforms: [.iOS("14.0")],
products: [
// Consumers depend on this single product; SPM links every listed
// target into the app.
.library(
name: "RTCAdapter",
targets: [
"RTCAdapter",
"AmazonIVSBroadcast",
"TXLiteAVSDK_Professional",
"TXFFmpeg",
"TXSoundTouch",
"RTCAdapterTRTCLink",
]
),
// For the Broadcast Upload Extension. Kept separate from the main
// product because the extension has a 50MB memory limit: it can only
// link the trimmed TXLiteAVSDK_ReplayKitExt, not the full TRTC
// (TXLiteAVSDK_Professional). Each framework inlines its own copy of
// the shared RTCAdapterIVS layer; the main app and the extension run
// in separate processes, so duplicate symbols do not conflict.
.library(
name: "RTCAdapterScreenShareExt",
targets: [
"RTCAdapterScreenShareExt",
"AmazonIVSBroadcast",
"TXLiteAVSDK_ReplayKitExt",
]
),
],
targets: [
// Closed-source RTCAdapter framework (produced by devops/build.sh).
.binaryTarget(
name: "RTCAdapter",
url: "https://liteav.sdk.qcloud.com/customer/ivs_adapter/RTCAdapter-1.42.161.zip",
checksum: "ecdc8276b87506412c042364b1a18d1abab2d4a2f8d42a103118dabf3e79527b"
),
// Closed-source RTCAdapterScreenShareExt framework (also produced by
// devops/build.sh; internal RTCAdapterIVS layer is compiled in).
.binaryTarget(
name: "RTCAdapterScreenShareExt",
url: "https://liteav.sdk.qcloud.com/customer/ivs_adapter/RTCAdapterScreenShareExt-1.42.161.zip",
checksum: "18439daf9d58f574422d4332a298dcf29cc8cb341b2944a8d2b810248d1588ec"
),
// AmazonIVSBroadcast remote binary (AWS official zip).
.binaryTarget(
name: "AmazonIVSBroadcast",
url: amazonIVSBroadcastURL,
checksum: amazonIVSBroadcastChecksum
),
// TRTC frameworks — Tencent's official 13.4.0.21062 xcframework zips
// (the same CDN artifacts Professional_SwiftPM ships). Keep the version
// in sync with iOS/AWSAdapter/Package.swift.
.binaryTarget(
name: "TXLiteAVSDK_Professional",
url: "https://liteav.sdk.qcloud.com/download/spm/13.4/professional/13.4.0.21062/TXLiteAVSDK_Professional.xcframework.zip",
checksum: "5c19c94b98b832a426bc5c6cdad390f737b82a8a25c39183c5dc1fb65f117ba6"
),
.binaryTarget(
name: "TXFFmpeg",
url: "https://liteav.sdk.qcloud.com/download/spm/13.4/professional/13.4.0.21062/TXFFmpeg.xcframework.zip",
checksum: "441fbe0ca05f367cf110e6673c318edd91bcba6612576983027c7b8f8e301131"
),
.binaryTarget(
name: "TXSoundTouch",
url: "https://liteav.sdk.qcloud.com/download/spm/13.4/professional/13.4.0.21062/TXSoundTouch.xcframework.zip",
checksum: "4ad4811816ef28dfa25549a928d8b34ac5d6e442457105be03cff1a7e6ecfb7d"
),
// TRTC ReplayKit extension SDK — Tencent's official 13.4.0.21062 zip
// (the same CDN artifact Professional_SwiftPM ships). Extension-only
// trimmed SDK; the official package declares no extra linkerSettings
// for it, so no link-shim target is needed here.
.binaryTarget(
name: "TXLiteAVSDK_ReplayKitExt",
url: "https://liteav.sdk.qcloud.com/download/spm/13.4/professional/13.4.0.21062/TXLiteAVSDK_ReplayKitExt.xcframework.zip",
checksum: "0e73db0f2d590901502ece303c17792e420044c4454d40611158c2d07c3ab5e7"
),
// TRTC link-shim: empty Swift target. The prebuilt RTCAdapter binaryTarget
// references TXLiteAVSDK_Professional symbols, but a binaryTarget cannot
// declare dependencies or linker settings. This target pulls in the TRTC
// frameworks and links their required system frameworks/libraries into the
// app. Consumers do not import it.
.target(
name: "RTCAdapterTRTCLink",
dependencies: [
"TXLiteAVSDK_Professional",
"TXFFmpeg",
"TXSoundTouch",
],
path: "Sources/RTCAdapterTRTCLink",
linkerSettings: [
.linkedFramework("ReplayKit"),
.linkedFramework("VideoToolbox"),
.linkedFramework("AVKit"),
.linkedFramework("GLKit"),
.linkedFramework("AssetsLibrary"),
.linkedFramework("SystemConfiguration"),
.linkedFramework("CoreTelephony"),
.linkedFramework("AVFoundation"),
.linkedFramework("CoreMotion"),
.linkedFramework("OpenGLES"),
.linkedFramework("Accelerate"),
.linkedFramework("MetalKit"),
.linkedFramework("MobileCoreServices"),
.linkedFramework("CoreMedia"),
.linkedFramework("MetalPerformanceShaders"),
.linkedLibrary("sqlite3.0"),
.linkedLibrary("c++"),
.linkedLibrary("resolv"),
]
),
],
swiftLanguageModes: [.v5]
)