Skip to content

Commit

Permalink
fixed icon and version for .app, added .app building to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Jan 27, 2020
1 parent 3d01b39 commit 0bbddfb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dist
__pycache__
.*cache
*.swp
.DS_Store

.idea
venv*
Expand Down
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ script:
- "make test"
- "make test-integration"
- "make package"
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
make dist/ActivityWatch.app;
fi

before_deploy:
# Remove the folder from which the zip was created
Expand Down
24 changes: 21 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Instructions on how to do this can be found in the guide linked above.

# These targets should always rerun
.PHONY: build install test clean clean_all
.PHONY: build install test clean clean_all dist/ActivityWatch.app

SHELL := /usr/bin/env bash

Expand Down Expand Up @@ -125,8 +125,26 @@ test-integration:
# Example: https://ci.appveyor.com/project/ErikBjare/activitywatch/build/1.0.167/job/k1ulexsc5ar5uv4v
pytest ./scripts/tests/integration_tests.py ./aw-server/tests/ -v

pyinstaller:
pip install -r requirements.txt
ICON := "aw-qt/media/logo/logo.png"

aw-qt/media/logo/logo.icns:
mkdir build/MyIcon.iconset
sips -z 16 16 $(ICON) --out build/MyIcon.iconset/icon_16x16.png
sips -z 32 32 $(ICON) --out build/MyIcon.iconset/icon_16x16@2x.png
sips -z 32 32 $(ICON) --out build/MyIcon.iconset/icon_32x32.png
sips -z 64 64 $(ICON) --out build/MyIcon.iconset/icon_32x32@2x.png
sips -z 128 128 $(ICON) --out build/MyIcon.iconset/icon_128x128.png
sips -z 256 256 $(ICON) --out build/MyIcon.iconset/icon_128x128@2x.png
sips -z 256 256 $(ICON) --out build/MyIcon.iconset/icon_256x256.png
sips -z 512 512 $(ICON) --out build/MyIcon.iconset/icon_256x256@2x.png
sips -z 512 512 $(ICON) --out build/MyIcon.iconset/icon_512x512.png
cp $(ICON) build/MyIcon.iconset/icon_512x512@2x.png
iconutil -c icns build/MyIcon.iconset
rm -R build/MyIcon.iconset
mv build/MyIcon.icns aw-qt/media/logo/logo.icns

dist/ActivityWatch.app: aw-qt/media/logo/logo.icns
pip install git+git://github.com/pyinstaller/pyinstaller.git@55c8855d9db0fa596ceb28505f3ee2f402ecd4da
pyinstaller --clean --noconfirm --windowed aw.spec

package:
Expand Down
9 changes: 7 additions & 2 deletions aw.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ aw_qt_location = "aw-qt/"
awa_location = "aw-watcher-afk/"
aww_location = "aw-watcher-window/"

icon = aw_qt_location + 'media/logo/logo.ico'
if platform.system() == "Darwin":
icon = aw_qt_location + 'media/logo/logo.icns'
else:
icon = aw_qt_location + 'media/logo/logo.ico'
block_cipher = None

extra_pathex = []
Expand Down Expand Up @@ -193,4 +196,6 @@ if platform.system() == "Darwin":
icon=icon,
bundle_identifier="ActivityWatch",
info_plist={"CFBundleExecutable": "MacOS/aw-qt",
"CFBundleIconFile": "logo.ico"})
"CFBundleIconFile": "logo.icns",
# TODO: Get the right version here
"CFBundleShortVersionString": "0.8.4"})

0 comments on commit 0bbddfb

Please sign in to comment.