-
Notifications
You must be signed in to change notification settings - Fork 1
/
package.sh
44 lines (33 loc) · 1.14 KB
/
package.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
#!/bin/bash
# Bomb out on first error
set -e
# Change to the directory of this script, if not already
pushd "$(dirname "$0")"
echo -e "\nDetecting Java..."
java -version
# Compile
echo -e "\nCompiling..."
javac SoundRecorder.java
# Jar
echo -e "\nCreating jar..."
jar cvfe SoundRecorder.jar SoundRecorder SoundRecorder.class
# Create App Structure
echo -e "\nCreating empty bundle..."
rm -rf SoundRecorder.app
mkdir -p SoundRecorder.app/Contents/MacOS
mkdir -p SoundRecorder.app/Contents/Resources
# Copy jar
echo -e "\nCopying jar..."
cp SoundRecorder.jar SoundRecorder.app/SoundRecorder.jar
# Create Launcher
echo -e "\nCreating launcher..."
echo -e "#!/bin/bash\njava -jar \"\$(dirname "\$0")/../../SoundRecorder.jar\" > /tmp/soundrecorder.log 2>&1\n" > SoundRecorder.app/Contents/MacOS/SoundRecorder
chmod +x SoundRecorder.app/Contents/MacOS/SoundRecorder
# Creating icon
echo -e "\nCopying resource files..."
cp /usr/share/httpd/icons/small/sound.png SoundRecorder.app/Contents/Resources/SoundRecorder.png || true
cp Info.plist SoundRecorder.app/Contents/Info.plist
echo -e "\nCleaning up..."
rm -f SoundRecorder.class
rm -f SoundRecorder.jar
popd