-
Notifications
You must be signed in to change notification settings - Fork 122
/
Makefile
72 lines (61 loc) · 1.74 KB
/
Makefile
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
60
61
62
63
64
65
66
67
68
69
70
71
72
PATH := $(PWD)/node_modules/.bin:$(PATH)
APPNAME := WebGL\ Workshop
OSXDEST := build/osx/$(APPNAME).app
OSXFILE := $(OSXDEST)/Contents/Resources/app.nw
NWVERSION := 0.11.0
.PHONY: build/osx clean pack publish
pack:
npm run clean
npm install
npm dedupe
cp package.json _package.json
node lib/pack
find . -type file \
| grep -v ./app/ \
| grep -v ./.git/ \
| grep -v ./docs/ \
| grep -v ./build/ \
| grep -v ./answers/ \
| grep -v ./lessons/ \
| grep -v ./workshop/ \
| grep -v ./exercises/ \
| grep -v ./_package.json \
| grep -v ./Makefile \
| grep -v workshop.tar.gz \
| grep -v ./node_modules/[^@] \
| tar -cvzf workshop.tar.gz -T -
mv _package.json package.json
publish: pack
npm publish ./workshop.tar.gz
purge: clean
rm -rf node_modules; true
rm -rf build; true
clean:
rm -rf build/osx; true
optimize:
rm -rf node_modules
npm install --production
npm dedupe
build: build/osx
build/osx: $(OSXFILE)
build/downloads/osx.zip:
mkdir -p build/downloads
test -f build/downloads/osx.zip || \
(nw-download build/downloads/osx.zip -p osx -r $(NWVERSION)); true
$(OSXDEST): build/downloads/osx.zip
mkdir -p build/osx
unzip -qo -d build/osx build/downloads/osx.zip
cp -R build/osx/node-webkit-v*-ia32/node-webkit.app $(OSXDEST)
build/osx/app.icns:
mkdir -p build/osx
which iconutil
iconutil --convert icns --output build/osx/app.icns app/app.iconset
$(OSXFILE): build/osx/app.icns $(OSXDEST)
mkdir -p $(OSXFILE)
rm -rf $(OSXFILE)/node_modules 2> /dev/null; true
cp -R node_modules $(OSXFILE)/node_modules
cp -R app/* $(OSXFILE)/
mv $(OSXFILE)/Info.plist $(OSXDEST)/Contents/Info.plist
rm -rf $(OSXFILE)/node_modules/nw-download
cp build/osx/app.icns $(OSXFILE)/../nw.icns
cp exercises.json $(OSXFILE)/exercises.json