-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Google Cast universal packaging script
- Loading branch information
0 parents
commit 3aeee24
Showing
4 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
https://developers.google.com/terms/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// swift-tools-version:5.3 | ||
|
||
import PackageDescription | ||
|
||
struct PackageMetadata { | ||
static let version: String = "4.8.3" | ||
static let checksum: String = "bc2c3c2434ef2895a0388ac3f16932242d3d3ac11805f810dbe7d7bce3bb27f6" | ||
} | ||
|
||
let package = Package( | ||
name: "GoogleCast", | ||
platforms: [ | ||
.iOS(.v14), | ||
], | ||
products: [ | ||
.library( | ||
name: "GoogleCast", | ||
targets: ["GoogleCast"] | ||
) | ||
], | ||
targets: [ | ||
.binaryTarget( | ||
name: "GoogleCast", | ||
url: "https://github.com/SRGSSR/google-cast-sdk/releases/download/\(PackageMetadata.version)/GoogleCast.xcframework.zip", | ||
checksum: PackageMetadata.checksum | ||
) | ||
] | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Google Cast SDK | ||
|
||
Until Google provides SPM support for its Google Cast SDK this repository delivers official XCFrameworks as Swift packages for easy integration into projects. | ||
|
||
## Integration | ||
|
||
Use [Swift Package Manager](https://swift.org/package-manager) directly [within Xcode](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app). You can also declare the library as a dependency of another one directly in the associated `Package.swift` manifest. | ||
|
||
### Make the XCFramework available | ||
|
||
To make the generated framework available: | ||
|
||
1. Download the _Dynamic_ framework from the [Google Cast SDK manual setup](https://developers.google.com/cast/docs/ios_sender#manual_setup). | ||
2. Rename the corresponding zip as `GoogleCast.xcframework.zip`. | ||
3. Calculate the zip checksum using `swift package compute-checksum /path/to/GoogleCast.xcframework.zip` | ||
3. Update the `Package.swift` in this repository with the framework version number and the checksum that you obtained. Also update the deployment target according to the official SDK documentation. | ||
4. Commit the changes on `main` and create a corresponding tag. | ||
5. Push the commit and the tag to GitHub. | ||
6. Attach the binary to the tag on GitHub. | ||
|
||
Do not commit the binaries in the repository, as this would slow down checkouts made by SPM as the repostory grows. |