Skip to content

Commit

Permalink
Create Google Cast universal packaging script
Browse files Browse the repository at this point in the history
  • Loading branch information
waliid committed Jan 28, 2025
0 parents commit 3aeee24
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://developers.google.com/terms/
28 changes: 28 additions & 0 deletions Package.swift
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
)
]
)
21 changes: 21 additions & 0 deletions README.md
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.

0 comments on commit 3aeee24

Please sign in to comment.