-
Notifications
You must be signed in to change notification settings - Fork 3
/
createZipFramework.sh
executable file
·41 lines (37 loc) · 1.04 KB
/
createZipFramework.sh
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
#!/bin/sh -xe
############################################################
# Help #
############################################################
Help()
{
# Display Help
echo "create zip framework."
echo "usage: createZipFramework.sh [-h]"
echo "options:"
echo "h : Optional, Print this Help."
echo
}
touch Package.swift
# Define the target directory
directory="Framework"
# Check if the target is not a directory
if [ ! -d "$directory" ]; then
exit 1
fi
cd $directory
# Loop through files in the target directory
for xcframework in *; do
zip -qr $xcframework.zip $xcframework
library=$(echo "$xcframework" | cut -d . -f 1)
checksum=$(swift package compute-checksum $xcframework.zip)
cat << EndOfMessage
.binaryTarget(
name: "$library",
url: "https://github.com/karelrooted/libmpv/releases/download/v0.37.0-alpha/$xcframework.zip",
checksum: "$checksum"
),
EndOfMessage
rm -fr $xcframework
done
cd -
tar -czf Framework.tgz Framework