-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·44 lines (36 loc) · 1.28 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
#!/bin/bash
NW_VERSION=0.8.4
NW_PATH=/opt/node-webkit/$NW_VERSION
NW=$NW_PATH/node-webkit.app/Contents/MacOS/node-webkit
GYP=nw-gyp
# App info
APP_NAME=Cubelets\ Studio
APP_SLUG=cubelets-studio
echo "Installing node modules..."
npm install
echo "Pruning node modules..."
rm -rf node_modules/cubelets/node_modules/socket.io-client/node_modules/active-x-obfuscator/.*.un~
echo "Building native node modules for node-webkit..."
cd node_modules/cubelets/node_modules/bluetooth-serial-port
$GYP clean
$GYP configure --target=$NW_VERSION
$GYP build
cd ../../../..
cd node_modules/cubelets/node_modules/socket.io-client/node_modules/ws
$GYP clean
$GYP configure --target=$NW_VERSION
$GYP build
cd ../../../../../..
#echo "Stopping for development"
#exit
echo "Zipping up app.nw package..."
mkdir -p build
node ./tools/set-app-name "$APP_NAME" # proper formatting in node-webkit
zip -r build/app.nw * [email protected]
node ./tools/set-app-name "$APP_SLUG" # restore npm compatibility
echo "Packaging app.nw into $APP_NAME.app..."
rm -rf "build/$APP_NAME.app"
cp -R "$NW_PATH/node-webkit.app" "build/$APP_NAME.app"
mv build/app.nw "build/$APP_NAME.app/Contents/Resources/app.nw"
cp resources/Info.plist "build/$APP_NAME.app/Contents/Info.plist"
cp resources/nw.icns "build/$APP_NAME.app/Contents/Resources/nw.icns"