| ... | ... | @@ -1,4 +1,94 @@ |
| 1 | 1 | #!/bin/sh |
| 2 | 2 | set -e |
| 3 | 3 | cd "$(dirname "$0")" |
| 4 | | swift build -c release |
| 4 | |
| 5 | CONFIG=release |
| 6 | APP=Sequencer.app |
| 7 | BIN=Sequencer |
| 8 | |
| 9 | swift build -c "$CONFIG" |
| 10 | |
| 11 | # (Re)build the .app bundle from scratch so stale files never linger. |
| 12 | rm -rf "$APP" |
| 13 | mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" |
| 14 | |
| 15 | cp ".build/$CONFIG/$BIN" "$APP/Contents/MacOS/$BIN" |
| 16 | |
| 17 | cat > "$APP/Contents/Info.plist" <<'PLIST' |
| 18 | <?xml version="1.0" encoding="UTF-8"?> |
| 19 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 20 | <plist version="1.0"> |
| 21 | <dict> |
| 22 | 	<key>CFBundleName</key> |
| 23 | 	<string>Sequencer</string> |
| 24 | 	<key>CFBundleDisplayName</key> |
| 25 | 	<string>Clover Sequencer</string> |
| 26 | 	<key>CFBundleExecutable</key> |
| 27 | 	<string>Sequencer</string> |
| 28 | 	<key>CFBundleIdentifier</key> |
| 29 | 	<string>com.clover.Sequencer</string> |
| 30 | 	<key>CFBundlePackageType</key> |
| 31 | 	<string>APPL</string> |
| 32 | 	<key>CFBundleShortVersionString</key> |
| 33 | 	<string>1.0</string> |
| 34 | 	<key>CFBundleVersion</key> |
| 35 | 	<string>1</string> |
| 36 | 	<key>LSMinimumSystemVersion</key> |
| 37 | 	<string>14.0</string> |
| 38 | 	<key>NSHighResolutionCapable</key> |
| 39 | 	<true/> |
| 40 | 	<key>NSPrincipalClass</key> |
| 41 | 	<string>Sequencer.SeqApplication</string> |
| 42 | 	<key>CFBundleDocumentTypes</key> |
| 43 | 	<array> |
| 44 | 		<dict> |
| 45 | 			<key>CFBundleTypeName</key> |
| 46 | 			<string>Sequencer Project</string> |
| 47 | 			<key>CFBundleTypeRole</key> |
| 48 | 			<string>Editor</string> |
| 49 | 			<key>LSHandlerRank</key> |
| 50 | 			<string>Owner</string> |
| 51 | 			<key>LSTypeIsPackage</key> |
| 52 | 			<true/> |
| 53 | 			<key>NSDocumentClass</key> |
| 54 | 			<string>Sequencer.ProjectDocument</string> |
| 55 | 			<key>LSItemContentTypes</key> |
| 56 | 			<array> |
| 57 | 				<string>com.clover.sequencer.project</string> |
| 58 | 			</array> |
| 59 | 			<key>CFBundleTypeExtensions</key> |
| 60 | 			<array> |
| 61 | 				<string>sq</string> |
| 62 | 			</array> |
| 63 | 		</dict> |
| 64 | 	</array> |
| 65 | 	<key>UTExportedTypeDeclarations</key> |
| 66 | 	<array> |
| 67 | 		<dict> |
| 68 | 			<key>UTTypeIdentifier</key> |
| 69 | 			<string>com.clover.sequencer.project</string> |
| 70 | 			<key>UTTypeDescription</key> |
| 71 | 			<string>Sequencer Project</string> |
| 72 | 			<key>UTTypeConformsTo</key> |
| 73 | 			<array> |
| 74 | 				<string>com.apple.package</string> |
| 75 | 			</array> |
| 76 | 			<key>UTTypeTagSpecification</key> |
| 77 | 			<dict> |
| 78 | 				<key>public.filename-extension</key> |
| 79 | 				<array> |
| 80 | 					<string>sq</string> |
| 81 | 				</array> |
| 82 | 			</dict> |
| 83 | 		</dict> |
| 84 | 	</array> |
| 85 | </dict> |
| 86 | </plist> |
| 87 | PLIST |
| 88 | |
| 89 | # Mark the bundle as an app package for Finder/Launch Services. |
| 90 | printf 'APPL????' > "$APP/Contents/PkgInfo" |
| 91 | |
| 92 | codesign --force --deep --sign "Sequencer Dev" "$APP" |
| 93 | |
| 94 | echo "Built $APP" |