mirror of
https://github.com/xmqywx/mio-plugin-music.git
synced 2026-04-12 01:54:31 +00:00
35 lines
843 B
Bash
Executable File
35 lines
843 B
Bash
Executable File
#!/bin/bash
|
|
# Build the Music Player plugin as a .bundle for MioIsland
|
|
set -e
|
|
|
|
PLUGIN_NAME="music-player"
|
|
BUNDLE_NAME="${PLUGIN_NAME}.bundle"
|
|
BUILD_DIR="build"
|
|
SOURCES="Sources/*.swift"
|
|
|
|
echo "Building ${PLUGIN_NAME} plugin..."
|
|
|
|
# Clean
|
|
rm -rf "${BUILD_DIR}"
|
|
mkdir -p "${BUILD_DIR}/${BUNDLE_NAME}/Contents/MacOS"
|
|
|
|
# Compile to dynamic library
|
|
swiftc \
|
|
-emit-library \
|
|
-module-name MusicPlugin \
|
|
-target arm64-apple-macos15.0 \
|
|
-sdk $(xcrun --show-sdk-path) \
|
|
-o "${BUILD_DIR}/${BUNDLE_NAME}/Contents/MacOS/MusicPlugin" \
|
|
${SOURCES}
|
|
|
|
# Copy Info.plist
|
|
cp Info.plist "${BUILD_DIR}/${BUNDLE_NAME}/Contents/"
|
|
|
|
# Ad-hoc sign
|
|
codesign --force --sign - "${BUILD_DIR}/${BUNDLE_NAME}"
|
|
|
|
echo "✓ Built ${BUILD_DIR}/${BUNDLE_NAME}"
|
|
echo ""
|
|
echo "Install:"
|
|
echo " cp -r ${BUILD_DIR}/${BUNDLE_NAME} ~/.config/codeisland/plugins/"
|