Skip to content

Commit

Permalink
iOSのApp Storeへの申請を通るようにした (#25)
Browse files Browse the repository at this point in the history
* python 3.10のインストール

* ライブラリをframeworkの中に入れる

* lnをハードリンクに戻した。

* dylibのファイル名からバージョン番号を除いた。

* read meの文言の削除

* 空白などを整理

* plistをbinary形式からXML形式へ

* 実機用のplistがsimulator用になっていたので修正。

---------

Co-authored-by: Hiroshiba <[email protected]>
  • Loading branch information
nekomimimi and Hiroshiba authored Jan 9, 2024
1 parent 8a198bc commit c3da5cb
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 3 deletions.
35 changes: 32 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ jobs:
echo "RELEASE_NAME=onnxruntime-ios-xcframework-${{ env.ONNXRUNTIME_VERSION }}" >> $GITHUB_ENV
echo "ONNXRUNTIME_BASENAME=libonnxruntime.${{ env.ONNXRUNTIME_VERSION }}.dylib" >> "$GITHUB_ENV"
- uses: actions/checkout@v3

- uses: actions/download-artifact@v2
with:
name: onnxruntime-ios-arm64
Expand All @@ -246,17 +248,44 @@ jobs:
rm -f artifact/onnxruntime-aarch64-apple-ios-sim/lib/*onnxruntime.dylib
rm -f artifact/onnxruntime-aarch64-apple-ios/lib/*onnxruntime.dylib
- name: Create aarch64 Framework
run: |
mkdir -p "Framework-aarch64"
cp -vr xcframework/Frameworks/aarch64/ Framework-aarch64/
lipo -create "artifact/onnxruntime-aarch64-apple-ios/lib/${{ env.ONNXRUNTIME_BASENAME }}" \
-output "Framework-aarch64/onnxruntime.framework/onnxruntime"
- name: Change aarch64 @rpath
run: |
install_name_tool -id "@rpath/onnxruntime.framework/onnxruntime" \
"Framework-aarch64/onnxruntime.framework/onnxruntime"
- name: Create fat binary
run: |
mkdir -p "artifact/onnxruntime-sim"
lipo -create "artifact/onnxruntime-x86_64-apple-ios/lib/${{ env.ONNXRUNTIME_BASENAME }}" "artifact/onnxruntime-aarch64-apple-ios-sim/lib/${{ env.ONNXRUNTIME_BASENAME }}" -output "artifact/onnxruntime-sim/${{ env.ONNXRUNTIME_BASENAME }}"
lipo -create "artifact/onnxruntime-x86_64-apple-ios/lib/${{ env.ONNXRUNTIME_BASENAME }}" \
"artifact/onnxruntime-aarch64-apple-ios-sim/lib/${{ env.ONNXRUNTIME_BASENAME }}" \
-output "artifact/onnxruntime-sim/onnxruntime"
- name: Create sim Framework
run: |
mkdir -p "Framework-sim"
cp -vr xcframework/Frameworks/sim/ Framework-sim/
cp -v "artifact/onnxruntime-sim/onnxruntime" \
"Framework-sim/onnxruntime.framework/onnxruntime"
- name: Change sim @rpath
run: |
install_name_tool -id "@rpath/onnxruntime.framework/onnxruntime" \
"Framework-sim/onnxruntime.framework/onnxruntime"
- name: Create XCFramework
run: |
mkdir -p "artifact/${{ env.ONNXRUNTIME_BASENAME }}"
xcodebuild -create-xcframework \
-library "artifact/onnxruntime-sim/${{ env.ONNXRUNTIME_BASENAME }}" \
-library "artifact/onnxruntime-aarch64-apple-ios/lib/${{ env.ONNXRUNTIME_BASENAME }}" \
-framework Framework-sim/onnxruntime.framework \
-framework Framework-aarch64/onnxruntime.framework \
-output "artifact/${{ env.ONNXRUNTIME_BASENAME }}/onnxruntime.xcframework"
- name: Archive artifact
Expand Down
55 changes: 55 additions & 0 deletions xcframework/Frameworks/aarch64/onnxruntime.framework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?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>23B81</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>onnxruntime</string>
<key>CFBundleIdentifier</key>
<string>jp.hiroshiba.voicevox.onnxruntime</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>onnxruntime</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>21C52</string>
<key>DTPlatformName</key>
<string>iphoneos</string>
<key>DTPlatformVersion</key>
<string>17.2</string>
<key>DTSDKBuild</key>
<string>21C52</string>
<key>DTSDKName</key>
<string>iphoneos17.2</string>
<key>DTXcode</key>
<string>1510</string>
<key>DTXcodeBuild</key>
<string>15C65</string>
<key>MinimumOSVersion</key>
<string>16.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
framework module onnxruntime {
export *

module * { export * }
}
51 changes: 51 additions & 0 deletions xcframework/Frameworks/sim/onnxruntime.framework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?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>23B81</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>onnxruntime</string>
<key>CFBundleIdentifier</key>
<string>jp.hiroshiba.voicevox.onnxruntime</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>onnxruntime</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneSimulator</string>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>21C52</string>
<key>DTPlatformName</key>
<string>iphonesimulator</string>
<key>DTPlatformVersion</key>
<string>17.2</string>
<key>DTSDKBuild</key>
<string>21C52</string>
<key>DTSDKName</key>
<string>iphonesimulator17.2</string>
<key>DTXcode</key>
<string>1510</string>
<key>DTXcodeBuild</key>
<string>15C65</string>
<key>MinimumOSVersion</key>
<string>16.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
framework module onnxruntime {
export *

module * { export * }
}
6 changes: 6 additions & 0 deletions xcframework/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# xcframeworkフォルダの内容について
## Frameworks

iOS向けの配布ライブラリXCFramework内のFrameworkを作るための雛形です。
雛形は端末用とシミュレータ用の2種類です。

0 comments on commit c3da5cb

Please sign in to comment.