-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
54 lines (42 loc) · 1.23 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
#----------------------------
APP=PagerdutyNotifier
APPDIR=dist/$(APP).app
EXECUTABLE=$(APPDIR)/Contents/MacOS/notifier
ICONFILE=$(APPDIR)/Contents/Resources/PagerDuty.icns
build: $(EXECUTABLE) $(ICONFILE)
$(EXECUTABLE): src/*.go
go build -o "$@" $^
run: build
open $(APPDIR)
test:
go test -v src/*.go
lint:
golangci-lint run
install:
cp -r $(APPDIR) /Applications
icon-clear-cache:
sudo rm -rfv /Library/Caches/com.apple.iconservices.store
sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \;
sleep 3
sudo touch /Applications/*
killall Dock; killall Finder
$(ICONFILE): assets/pd-logo.png
rm -rf assets/pd.iconset
mkdir -p assets/pd.iconset
for size in 16 32 64 128 256 512 1024; do \
sips -z $$size $$size assets/pd-logo.png --out assets/pd.iconset/icon_$${size}x$${size}.png; \
done
iconutil -c icns -o $(ICONFILE) assets/pd.iconset
clean:
rm -rf package
rm -rf assets/pd.iconset
rm -f assets/pd.icns
rm -f $(EXECUTABLE)
rm -f $(ICONFILE)
rm -f dist/Applications
dmg: build
ln -fs /Applications dist
hdiutil create -volname $(APP) -srcfolder ./dist -ov ${PACKAGE}
# Some pre-requisits for building this project
install-dependencies:
go mod download