-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
executable file
·59 lines (51 loc) · 1.54 KB
/
build.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env sh
if [ -d build/KeyboardCleaner.app ]; then
rm -rf build/Keyboard\ Cleaner.app
fi
mkdir -p build/Keyboard\ Cleaner.app/Contents
mkdir build/Keyboard\ Cleaner.app/Contents/MacOS
version=$(cat VERSION)
build_id=$(uuidgen | sed y/ABCDEF/abcdef/)
cat << EOF > build/Keyboard\ Cleaner.app/Contents/Info.plist
<?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>CFBundleName</key>
<string>Keyboard Cleaner</string>
<key>CFBundleDisplayName</key>
<string>Keyboard Cleaner</string>
<key>CFBundleExecutable</key>
<string>keyboard-cleaner</string>
<key>CFBundleIdentifier</key>
<string>com.github.gltchitm.KeyboardCleaner</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleVersion</key>
<string>$version</string>
<key>CFBundleShortVersionString</key>
<string>$version</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>LSMinimumSystemVersion</key>
<string>11.0</string>
<key>LSUIElement</key>
<true />
</dict>
</plist>
EOF
cat << EOF > build/Keyboard\ Cleaner.app/Contents/keyboard-cleaner-build.txt
Keyboard Cleaner
Version: $version
Build ID: $build_id
Built: $(date)
EOF
clang \
-framework Cocoa \
-o build/Keyboard\ Cleaner.app/Contents/MacOS/keyboard-cleaner \
src/main.m
echo "Built Keyboard Cleaner!"
echo " Version: $version"
echo " Build ID: $build_id"