chore: revise how dev version of app icon is set on macOS during `make run`

The way it was done previously didn't always produce the intended result (for
unknown reasons), i.e. the dev app would sometimes launch with a transparent
blank square appearing in place of the expected icon.
This commit is contained in:
Michael Bradley, Jr 2021-01-19 10:10:36 -06:00 committed by Michael Bradley
parent fe3698a912
commit 0a77bedb15
7 changed files with 20 additions and 15 deletions

View File

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>nim_status_client</string>
<key>CFBundleIconFile</key>
<string>status-icon.icns</string>
<string>status.icns</string>
<key>CFBundleIdentifier</key>
<string>im.Status.NimStatusClient</string>
<key>CFBundleInfoDictionaryVersion</key>

View File

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>nim_status_client.sh</string>
<key>CFBundleIconFile</key>
<string>status-icon.icns</string>
<string>status.icns</string>
<key>CFBundleIdentifier</key>
<string>im.Status.NimStatusClient</string>
<key>CFBundleInfoDictionaryVersion</key>

View File

@ -310,7 +310,7 @@ $(STATUS_CLIENT_DMG): nim_status_client $(DMG_TOOL)
cp bin/nim_status_client $(MACOS_OUTER_BUNDLE)/Contents/MacOS/
cp nim_status_client.sh $(MACOS_OUTER_BUNDLE)/Contents/MacOS/
chmod +x $(MACOS_OUTER_BUNDLE)/Contents/MacOS/nim_status_client.sh
cp status-icon.icns $(MACOS_OUTER_BUNDLE)/Contents/Resources/
cp status.icns $(MACOS_OUTER_BUNDLE)/Contents/Resources/
cp status.svg $(MACOS_OUTER_BUNDLE)/Contents/
cp -R resources.rcc $(MACOS_OUTER_BUNDLE)/Contents/
cp -R $(FLEETS) $(MACOS_OUTER_BUNDLE)/Contents/
@ -443,19 +443,17 @@ clean: | clean-common
run: rcc $(RUN_TARGET)
STATUS_MACOS_DEV_ICON ?= tmp/macos/status-dev-icon.rsrc
ICON_TOOL := node_modules/.bin/fileicon
$(ICON_TOOL):
echo -e "\e[92mInstalling:\e[39m fileicon"
npm i
NIM_STATUS_CLIENT_DEV ?= t
STATUS_PORT ?= 30306
$(STATUS_MACOS_DEV_ICON):
mkdir -p tmp/macos
cp status-dev-icon.icns tmp/macos/
sips -i tmp/macos/status-dev-icon.icns
DeRez -only icns tmp/macos/status-dev-icon.icns > tmp/macos/status-dev-icon.rsrc
set-status-macos-dev-icon:
Rez -append tmp/macos/status-dev-icon.rsrc -o bin/nim_status_client
SetFile -a C bin/nim_status_client
set-status-macos-dev-icon: $(ICON_TOOL)
npx fileicon set bin/nim_status_client status-dev.icns
run-linux:
echo -e "\e[92mRunning:\e[39m bin/nim_status_client"
@ -464,7 +462,7 @@ run-linux:
STATUS_PORT="$(STATUS_PORT)" \
./bin/nim_status_client
run-macos: $(STATUS_MACOS_DEV_ICON) set-status-macos-dev-icon
run-macos: set-status-macos-dev-icon
echo -e "\e[92mRunning:\e[39m bin/nim_status_client"
NIM_STATUS_CLIENT_DEV="$(NIM_STATUS_CLIENT_DEV)" \
STATUS_PORT="$(STATUS_PORT)" \

6
package-lock.json generated
View File

@ -301,6 +301,12 @@
"strip-eof": "^1.0.0"
}
},
"fileicon": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/fileicon/-/fileicon-0.2.4.tgz",
"integrity": "sha512-2gipEXOI2jvh6yp7FN/SZ5M67fbLknZ+Q3kizBQupe+4w12z51WnmCBiiGfdeMZzUmhCTPSJuCK/Sl1kEyWmhA==",
"dev": true
},
"find-up": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",

View File

@ -4,7 +4,8 @@
"private": true,
"files": [],
"devDependencies": {
"create-dmg": "status-im/create-dmg"
"create-dmg": "status-im/create-dmg",
"fileicon": "0.2.4"
},
"engines": {
"node": ">=8"