Skip to content

Commit

Permalink
Test spm.
Browse files Browse the repository at this point in the history
  • Loading branch information
BB9z committed Jul 6, 2024
1 parent 19d110e commit 9c64973
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ jobs:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: XCFramework Make
- name: Package XCFramework
run: |
cd macosx
./make-xcframework.sh
./make-package.command
env:
# Seems unable build visionOS at the moment
B9_BUILD_VISION_OS: false
19 changes: 4 additions & 15 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,14 @@ let package = Package(
.visionOS(.v1),
],
products: [
// Things get complicated when we change the libaray type from static to dynamic.
// A wrapper is required. https://stackoverflow.com/a/65255303
.library(name: "LAME", type: .dynamic, targets: ["LAME-Target"])
.library(name: "LAME", targets: ["LAME"])
],
dependencies: [],
targets: [
.target(
name: "LAME-Target",
dependencies: ["LAME-Prebuild"],
path: "SwiftPM"
),
// .binaryTarget(
// name: "LAME-Prebuild",
// path: "macosx/LAME.xcframework"
// ),
.binaryTarget(
name: "LAME-Prebuild",
url: "https://github.com/BB9z/LAME-xcframework/releases/download/3.100.1/LAME.xcframework.zip",
checksum: "cc45eb59d17ec4c38f75bb054d01faca3aaefeeaee544ca0c7a07e6820898c0f"
name: "LAME",
url: "https://github.com/BB9z/LAME-xcframework/releases/download/3.100.0/Next-LAME.xcframework.zip",
checksum: "57596b57a3ac35263d6347109672dacb8596989ccfd64775fcee588c076b1d8f"
)
]
)
14 changes: 14 additions & 0 deletions make-package.command
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ sh ./make-xcframework.sh
cd "$ROOT_DIR"

mv "$ROOT_DIR/macosx/LAME.xcframework" "$ROOT_DIR"

readonly countDSYMs=$(find "$ROOT_DIR/LAME.xcframework" -name "*.dSYM" | wc -l)
readonly hasDSYMs=$((countDSYMs > 0))
# echo "hasDSYMs: $hasDSYMs"

if [ $hasDSYMs = 1 ]; then
echo "\nPackaging with dSYMs..."
zip -r -9 LAME.xcframework_with_dsyms.zip LAME.xcframework LICENSE LICENSE-LAME COPYING

echo "\nRemove dSYMs for package again..."
find "$ROOT_DIR/LAME.xcframework" -name "dSYMs" -type d -exec rm -rfv {} +
fi

echo "\nPackaging..."
zip -r -9 LAME.xcframework.zip LAME.xcframework LICENSE LICENSE-LAME COPYING

checksum=$(swift package compute-checksum LAME.xcframework.zip)
Expand Down

0 comments on commit 9c64973

Please sign in to comment.