feat(resources): automatically generate Windows ICO file

Also corrects the location/adds several other resources
This commit is contained in:
Jason Dreyzehner 2016-10-26 19:41:10 -04:00
parent e262e29afb
commit 2eb47a53a4
9 changed files with 18 additions and 2 deletions

View File

Before

Width:  |  Height:  |  Size: 373 KiB

After

Width:  |  Height:  |  Size: 373 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

View File

@ -2,9 +2,11 @@
# export all slices marked for export to the proper directory
echo "Exporting all assets from src.sketch..."
# sketchtool is installed by install.sh
sketchtool export layers src.sketch
function postprocess {
# $1 = distribution name
echo "Beginning postprocessing for $1..."
echo "Postprocessing assets for macOS..."
@ -15,6 +17,14 @@ function postprocess {
tiffutil -cathidpicheck $1/mac/dmg-background.png $1/mac/dmg-background@2x.png -out $1/mac/dmg-background.tiff
echo "Removing raw background pngs..."
rm $1/mac/dmg-background.png $1/mac/dmg-background@2x.png
echo "Postprocessing assets for Windows..."
echo "Combining windows/ico pngs into a single ICO file..."
# convert ships with imagemagick
convert $1/windows/ico/ico_16x16.png $1/windows/ico/ico_24x24.png $1/windows/ico/ico_32x32.png $1/windows/ico/ico_48x48.png $1/windows/ico/ico_64x64.png $1/windows/ico/ico_128x128.png $1/windows/ico/ico_256x256.png $1/windows/icon.ico
echo "Removing raw windows/ico pngs..."
rm -r $1/windows/ico/* && rmdir $1/windows/ico
}
function iconset {

View File

@ -1,2 +1,8 @@
echo "Installing sketchtool... (this requires Sketch.app)"
# This installs sketchtool: https://www.sketchapp.com/tool/
sh /Applications/Sketch.app/Contents/Resources/sketchtool/install.sh
echo "Installing imagemagick... (This requires Homebrew)"
# This requires Homebrew: http://brew.sh/
brew install imagemagick
# imagemagick provides the `convert` utility, used to generate ICO files

View File

@ -4,9 +4,9 @@ This directory contains a `src.sketch` file from which all other assets are expo
## Requirements
You'll need [Sketch](https://www.sketchapp.com/) to make any changes to this directory.
You'll need [Sketch](https://www.sketchapp.com/) to make any changes to this directory. You'll also need to have [Homebrew](http://brew.sh/) installed to regenerate all assets.
Sketch is only available for macOS, and several processes in `generate.sh` require utilities that ship with the OS, so this process must be performed on macOS.
Sketch and Homebrew are only available for macOS, and several processes in `generate.sh` require utilities that ship with macOS, so this process requires macOS.
## Install sketchtool

Binary file not shown.