-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
redo download-payload script to create XCFramework
- Loading branch information
1 parent
0c6a4f6
commit 98a18c9
Showing
6 changed files
with
147 additions
and
14 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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
skiasharp* | ||
.build | ||
DerivedData | ||
xcuserdata | ||
.DS_Store | ||
|
||
skiasharp* | ||
build | ||
SkiaSharpMacFramework/libSkiaSharp.dylib | ||
SkiaSharpMacFramework/SkiaSharpMacFramework.framework* |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
8 changes: 8 additions & 0 deletions
8
.swiftpm/xcode/package.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key> | ||
<true/> | ||
</dict> | ||
</plist> |
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,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>BuildMachineOSBuild</key> | ||
<string>19F101</string> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleExecutable</key> | ||
<string>libSkiaSharp</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>xamarin.libskia-macos</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>libSkiaSharp</string> | ||
<key>CFBundlePackageType</key> | ||
<string>FMWK</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0</string> | ||
<key>DTCompiler</key> | ||
<string>com.apple.compilers.llvm.clang.1_0</string> | ||
<key>DTSDKBuild</key> | ||
<string>10.15</string> | ||
<key>DTSDKName</key> | ||
<string>macosx10.15</string> | ||
<key>DTXcode</key> | ||
<string>1160</string> | ||
<key>DTXcodeBuild</key> | ||
<string>11E708</string> | ||
<key>NSPrincipalClass</key> | ||
<string></string> | ||
</dict> | ||
</plist> |
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 |
---|---|---|
@@ -1,25 +1,93 @@ | ||
#!/bin/sh | ||
V=2.80.0-preview.3 | ||
#!/bin/bash | ||
|
||
# Must be ran on macOS due to use of xcodebuild and lipo. | ||
|
||
# Cleanup from last time. | ||
rm -rf SkiaSharp.xcframework | ||
|
||
V=2.80.3-preview.40 | ||
DIR=skiasharp-$V | ||
FILE=skiasharp-$V.zip | ||
URL=https://www.nuget.org/api/v2/package/SkiaSharp/$V | ||
if test ! -e $FILE; then | ||
curl -L -o skiasharp-$V.zip https://www.nuget.org/api/v2/package/SkiaSharp/$V | ||
fi | ||
unzip -d skiasharp-$V $FILE | ||
|
||
download_nuget() { | ||
if test ! -e $FILE; then | ||
curl -L -o skiasharp-$V.zip https://www.nuget.org/api/v2/package/SkiaSharp/$V | ||
fi | ||
unzip -d skiasharp-$V $FILE | ||
} | ||
download_nuget | ||
|
||
# used below in build methods | ||
lipo_skiasharp() { | ||
local folder_name="$1" | ||
local arch="$2" | ||
local path=$folder_name/libSkiaSharp.framework/libSkiaSharp | ||
|
||
lipo -extract $arch $path -output $path | ||
} | ||
|
||
mkdir build | ||
|
||
# iOS | ||
monodis --output=dummy $DIR/lib/xamarinios1.0/SkiaSharp.dll | ||
unzip -d SkiaKit/iOS/libSkiaSharp.framework libSkiaSharp.framework | ||
rm libSkiaSharp.framework | ||
build_ios() { | ||
mkdir build/iOS | ||
cp -a $DIR/build/xamarinios1.0/libSkiaSharp.framework build/iOS/libSkiaSharp.framework | ||
|
||
# Painfully separate all architectures. | ||
cp -a build/iOS build/iOS-x86_64 | ||
cp -a build/iOS build/iOS-arm64 | ||
rm -rf build/iOS | ||
|
||
# Remove other architectures. | ||
lipo_skiasharp build/iOS-x86_64 x86_64 | ||
lipo_skiasharp build/iOS-arm64 arm64 | ||
} | ||
build_ios | ||
|
||
# tvOS | ||
monodis --output=dummy $DIR/lib/xamarintvos1.0/SkiaSharp.dll | ||
unzip -d SkiaKit/tvOS/libSkiaSharp.framework libSkiaSharp.framework | ||
rm libSkiaSharp.framework | ||
build_tvos() { | ||
mkdir build/tvOS | ||
cp -a $DIR/build/xamarintvos1.0/libSkiaSharp.framework build/tvOS/libSkiaSharp.framework | ||
|
||
# Painfully separate all architectures. | ||
cp -a build/tvOS build/tvOS-x86_64 | ||
cp -a build/tvOS build/tvOS-arm64 | ||
rm -rf build/tvOS | ||
|
||
# Remove other architectures. | ||
lipo_skiasharp build/tvOS-x86_64 x86_64 | ||
lipo_skiasharp build/tvOS-arm64 arm64 | ||
} | ||
build_tvos | ||
|
||
# macOS | ||
cp $DIR/runtimes/osx/native/libSkiaSharp.dylib SkiaKit/macOS | ||
build_macos() { | ||
mkdir -p build/macOS-x86_64/libSkiaSharp.framework | ||
|
||
cp $DIR/runtimes/osx/native/libSkiaSharp.dylib . | ||
# https://stackoverflow.com/questions/57755276/create-ios-framework-with-dylib | ||
lipo libSkiaSharp.dylib -output libSkiaSharp -create | ||
install_name_tool -id @rpath/libSkiaSharp.framework/libSkiaSharp libSkiaSharp | ||
|
||
mv libSkiaSharp build/macOS-x86_64/libSkiaSharp.framework/ | ||
rm libSkiaSharp.dylib | ||
|
||
cp MacOSFramework/Info.plist build/macOS-x86_64/libSkiaSharp.framework/Info.plist | ||
} | ||
build_macos | ||
|
||
create_xcframework() { | ||
# Create XCFramework. | ||
xcodebuild -create-xcframework \ | ||
-framework build/iOS-x86_64/libSkiaSharp.framework \ | ||
-framework build/iOS-arm64/libSkiaSharp.framework \ | ||
-framework build/tvOS-x86_64/libSkiaSharp.framework \ | ||
-framework build/tvOS-arm64/libSkiaSharp.framework \ | ||
-framework build/macOS-x86_64/libSkiaSharp.framework \ | ||
-output SkiaSharp.xcframework | ||
} | ||
create_xcframework | ||
|
||
# Cleanup | ||
rm -rf skiasharp-* build |