fix: generate icons directly from SVGs for better quality
This is really prep for MSIX image assets for the Windows build, but I figured I might as well do the macOS icons as a first step so that this can be its own separate change.
1
.gitattributes
vendored
|
@ -38,6 +38,7 @@
|
|||
.gitignore text eol=lf
|
||||
.markdownlintrc text eol=lf
|
||||
LICENSE text eol=lf
|
||||
Makefile text eol=lf
|
||||
TRADEMARK text eol=lf
|
||||
app.config eol=lf
|
||||
|
||||
|
|
Before ![]() (image error) Size: 71 KiB |
Before ![]() (image error) Size: 64 KiB |
Before ![]() (image error) Size: 79 KiB |
Before ![]() (image error) Size: 79 KiB |
Before ![]() (image error) Size: 22 KiB |
Before ![]() (image error) Size: 21 KiB |
Before (image error) Size: 4.5 KiB After (image error) Size: 4.5 KiB |
Before (image error) Size: 7.7 KiB After (image error) Size: 7.7 KiB |
Before (image error) Size: 5.7 KiB After (image error) Size: 5.7 KiB |
Before (image error) Size: 7.6 KiB After (image error) Size: 7.6 KiB |
106
Makefile
Normal file
|
@ -0,0 +1,106 @@
|
|||
# This Makefile generates icon and tile images from the sources in `Assets/`.
|
||||
# This doesn't need to be run every time: just when there's a significant change to the source assets or
|
||||
# if we need different icons or tiles.
|
||||
|
||||
# I recommend running "make" with the "-j" parameter to parallelize these jobs.
|
||||
# On my computer, a full run takes ~45 sec with "-j" or ~3.5 minutes without.
|
||||
|
||||
# Requirements:
|
||||
# - cairosvg
|
||||
# - convert (from ImageMagick)
|
||||
# - optipng
|
||||
|
||||
MAC_IMAGES = \
|
||||
scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png \
|
||||
scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png \
|
||||
scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png \
|
||||
scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png \
|
||||
scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png \
|
||||
scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png \
|
||||
scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png \
|
||||
scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png \
|
||||
scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png \
|
||||
scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png \
|
||||
scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_16x16.png \
|
||||
scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_16x16@2x.png \
|
||||
scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_32x32.png \
|
||||
scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_32x32@2x.png \
|
||||
scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_128x128.png \
|
||||
scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_128x128@2x.png \
|
||||
scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_256x256.png \
|
||||
scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_256x256@2x.png \
|
||||
scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_512x512.png \
|
||||
scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_512x512@2x.png \
|
||||
Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/icon-48.png \
|
||||
Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/icon-64.png \
|
||||
Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/icon-96.png \
|
||||
Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/icon-128.png \
|
||||
Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/icon-256.png \
|
||||
Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/icon-512.png \
|
||||
Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/toolbar-icon-16.png \
|
||||
Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/toolbar-icon-19.png \
|
||||
Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/toolbar-icon-32.png \
|
||||
Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/toolbar-icon-38.png \
|
||||
Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/toolbar-icon-48.png \
|
||||
Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/toolbar-icon-72.png
|
||||
|
||||
.PHONY: all clean mac
|
||||
|
||||
all: mac
|
||||
|
||||
clean:
|
||||
rm -vf $(MAC_IMAGES)
|
||||
|
||||
mac: $(MAC_IMAGES)
|
||||
|
||||
# Assumes the input SVG is square and that pixel [0,0] is a good background color
|
||||
# Pads the output horizontally, using the background color, to match the requested size
|
||||
# Usage: $(eval $(call svg2png,outpath/outfile.png,Assets/infile.svg,width,height,dpi))
|
||||
define svg2png
|
||||
$(1): $(2)
|
||||
BORDER_COLOR=`convert -background none -format '%[pixel:u.p{0,0}]' "$$<" info:` && \
|
||||
echo "Detected border color: $$$${BORDER_COLOR}" && \
|
||||
cairosvg --output-height "$(4)" -f png -o - "$$<" | \
|
||||
convert -background none -bordercolor "$$$${BORDER_COLOR}" -gravity center -extent "$(3)x$(4)" -density "$(5)" - "$$@" && \
|
||||
optipng -o7 -zm1-9 "$$@"
|
||||
endef
|
||||
|
||||
# macOS app icon
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png,Assets/rounded.svg,16,16,72))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png,Assets/rounded.svg,32,32,144))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png,Assets/rounded.svg,32,32,72))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png,Assets/rounded.svg,64,64,144))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png,Assets/rounded.svg,128,128,72))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png,Assets/rounded.svg,256,256,144))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png,Assets/rounded.svg,256,256,72))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png,Assets/rounded.svg,512,512,144))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png,Assets/rounded.svg,512,512,72))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png,Assets/rounded.svg,1024,1024,144))
|
||||
|
||||
# macOS app status bar icon
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_16x16.png,Assets/glyph.svg,16,16,72))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_16x16@2x.png,Assets/glyph.svg,32,32,144))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_32x32.png,Assets/glyph.svg,32,32,72))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_32x32@2x.png,Assets/glyph.svg,64,64,144))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_128x128.png,Assets/glyph.svg,128,128,72))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_128x128@2x.png,Assets/glyph.svg,256,256,144))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_256x256.png,Assets/glyph.svg,256,256,72))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_256x256@2x.png,Assets/glyph.svg,512,512,144))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_512x512.png,Assets/glyph.svg,512,512,72))
|
||||
$(eval $(call svg2png,scratch-link-mac/Assets.xcassets/StatusBarIcon.iconset/icon_512x512@2x.png,Assets/glyph.svg,1024,1024,144))
|
||||
|
||||
# macOS Safari extension icon
|
||||
$(eval $(call svg2png,Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/icon-48.png,Assets/rounded.svg,48,48,72))
|
||||
$(eval $(call svg2png,Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/icon-64.png,Assets/rounded.svg,64,64,72))
|
||||
$(eval $(call svg2png,Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/icon-96.png,Assets/rounded.svg,96,96,72))
|
||||
$(eval $(call svg2png,Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/icon-128.png,Assets/rounded.svg,128,128,72))
|
||||
$(eval $(call svg2png,Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/icon-256.png,Assets/rounded.svg,256,256,72))
|
||||
$(eval $(call svg2png,Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/icon-512.png,Assets/rounded.svg,512,512,72))
|
||||
|
||||
# macOS Safari extension toolbar icon
|
||||
$(eval $(call svg2png,Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/toolbar-icon-16.png,Assets/glyph.svg,16,16,72))
|
||||
$(eval $(call svg2png,Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/toolbar-icon-19.png,Assets/glyph.svg,19,19,72))
|
||||
$(eval $(call svg2png,Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/toolbar-icon-32.png,Assets/glyph.svg,32,32,72))
|
||||
$(eval $(call svg2png,Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/toolbar-icon-38.png,Assets/glyph.svg,38,38,72))
|
||||
$(eval $(call svg2png,Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/toolbar-icon-48.png,Assets/glyph.svg,48,48,72))
|
||||
$(eval $(call svg2png,Scratch\ Link\ Safari\ Helper/Scratch\ Link\ Safari\ Extension/Resources/images/toolbar-icon-72.png,Assets/glyph.svg,72,72,72))
|
Before ![]() (image error) Size: 5.8 KiB After ![]() (image error) Size: 4.6 KiB ![]() ![]() |
Before ![]() (image error) Size: 13 KiB After ![]() (image error) Size: 9.8 KiB ![]() ![]() |
Before ![]() (image error) Size: 2.1 KiB After ![]() (image error) Size: 1.8 KiB ![]() ![]() |
Before ![]() (image error) Size: 32 KiB After ![]() (image error) Size: 22 KiB ![]() ![]() |
Before ![]() (image error) Size: 2.7 KiB After ![]() (image error) Size: 2.4 KiB ![]() ![]() |
Before ![]() (image error) Size: 4.3 KiB After ![]() (image error) Size: 3.5 KiB ![]() ![]() |
Before ![]() (image error) Size: 373 B After ![]() (image error) Size: 525 B ![]() ![]() |
Before ![]() (image error) Size: 454 B After ![]() (image error) Size: 608 B ![]() ![]() |
Before ![]() (image error) Size: 793 B After ![]() (image error) Size: 955 B ![]() ![]() |
Before ![]() (image error) Size: 957 B After ![]() (image error) Size: 1.1 KiB ![]() ![]() |
Before ![]() (image error) Size: 1.2 KiB After ![]() (image error) Size: 1.4 KiB ![]() ![]() |
Before ![]() (image error) Size: 1.8 KiB After ![]() (image error) Size: 2 KiB ![]() ![]() |
Before ![]() (image error) Size: 5.8 KiB After ![]() (image error) Size: 4.6 KiB ![]() ![]() |
Before ![]() (image error) Size: 14 KiB After ![]() (image error) Size: 9.8 KiB ![]() ![]() |
Before ![]() (image error) Size: 680 B After ![]() (image error) Size: 732 B ![]() ![]() |
Before ![]() (image error) Size: 1.3 KiB After ![]() (image error) Size: 1.3 KiB ![]() ![]() |
Before ![]() (image error) Size: 14 KiB After ![]() (image error) Size: 9.8 KiB ![]() ![]() |
Before ![]() (image error) Size: 32 KiB After ![]() (image error) Size: 22 KiB ![]() ![]() |
Before ![]() (image error) Size: 1.3 KiB After ![]() (image error) Size: 1.3 KiB ![]() ![]() |
Before ![]() (image error) Size: 2.8 KiB After ![]() (image error) Size: 2.4 KiB ![]() ![]() |
Before ![]() (image error) Size: 32 KiB After ![]() (image error) Size: 22 KiB ![]() ![]() |
Before ![]() (image error) Size: 52 KiB After ![]() (image error) Size: 51 KiB ![]() ![]() |
Before ![]() (image error) Size: 3.3 KiB After ![]() (image error) Size: 3.5 KiB ![]() ![]() |
Before ![]() (image error) Size: 6.9 KiB After ![]() (image error) Size: 6.4 KiB ![]() ![]() |
Before ![]() (image error) Size: 394 B After ![]() (image error) Size: 525 B ![]() ![]() |
Before ![]() (image error) Size: 814 B After ![]() (image error) Size: 955 B ![]() ![]() |
Before ![]() (image error) Size: 6.9 KiB After ![]() (image error) Size: 6.4 KiB ![]() ![]() |
Before ![]() (image error) Size: 15 KiB After ![]() (image error) Size: 12 KiB ![]() ![]() |
Before ![]() (image error) Size: 814 B After ![]() (image error) Size: 955 B ![]() ![]() |
Before ![]() (image error) Size: 1.7 KiB After ![]() (image error) Size: 1.8 KiB ![]() ![]() |
Before ![]() (image error) Size: 15 KiB After ![]() (image error) Size: 12 KiB ![]() ![]() |
Before ![]() (image error) Size: 30 KiB After ![]() (image error) Size: 24 KiB ![]() ![]() |
|
@ -1,155 +0,0 @@
|
|||
SIGN_ID=Scratch Foundation, Inc.
|
||||
APP_ID=edu.mit.scratch.scratch-link
|
||||
APP_BUNDLE=Scratch\ Link.app
|
||||
CONFIG=release
|
||||
|
||||
SIGN_MAS_APP=Apple Distribution: $(SIGN_ID)
|
||||
SIGN_MAS_INS=3rd Party Mac Developer Installer: $(SIGN_ID)
|
||||
SIGN_MAC_APP=Developer ID Application: $(SIGN_ID)
|
||||
SIGN_MAC_INS=Developer ID Installer: $(SIGN_ID)
|
||||
|
||||
# Assume there's a recent tag called something like "1.1" and turn "1.1-2-g123abc" into "1.1.2"
|
||||
APP_VERSION=$(shell git describe --always --long | sed 's/-\([0-9]*\)-g.*/.\1/')
|
||||
VERSION_DETAIL=$(shell git describe --always --long --dirty --exclude '*')
|
||||
BIN_PATH=$(shell swift build --configuration $(CONFIG) --show-bin-path)
|
||||
|
||||
BIN_FILE=$(BIN_PATH)/scratch-link
|
||||
APP_DEST=dist/$(APP_BUNDLE)
|
||||
PACKAGE_FILE=scratch-link-$(APP_VERSION).pkg
|
||||
ZIP_FILE=scratch-link-$(APP_VERSION).zip
|
||||
SWIFT_SOURCES=$(wildcard Sources/scratch-link/*.swift)
|
||||
|
||||
.PHONY: all bin clean dist dist-mas dist-devid distclean lint resolve-dependencies uninstall xcodeproj zip
|
||||
|
||||
#all: $(APP_DEST)
|
||||
all: Assets.xcassets/AppIcon.appiconset Assets.xcassets/StatusBarIcon.iconset
|
||||
|
||||
show-version:
|
||||
@echo APP_VERSION: $(APP_VERSION)
|
||||
@echo VERSION_DETAIL: $(VERSION_DETAIL)
|
||||
|
||||
#lint: $(SWIFT_SOURCES)
|
||||
# swiftlint lint --path Sources
|
||||
|
||||
#bin: $(BIN_FILE)
|
||||
|
||||
#dist: dist-mas dist-devid
|
||||
|
||||
# For distribution to the Mac App Store
|
||||
#dist-mas: dist/mas-$(PACKAGE_FILE)
|
||||
|
||||
#dist/mas-$(PACKAGE_FILE): dist/tmp.mas/$(APP_BUNDLE)
|
||||
# productbuild --sign "$(SIGN_MAS_INS)" --component-compression auto --component "$<" /Applications "$@"
|
||||
|
||||
#dist/tmp.mas/$(APP_BUNDLE): dist/$(APP_BUNDLE)
|
||||
# rm -rf dist/tmp.mas/
|
||||
# mkdir -p dist/tmp.mas/
|
||||
# cp -aR "$<" "$@"
|
||||
# xcrun swift-stdlib-tool --copy --sign "$(SIGN_MAS_APP)" --Xcodesign --options --Xcodesign runtime --platform macosx --scan-folder "$@/Contents/MacOS" --destination "$@/Contents/Frameworks"
|
||||
# test -r "$@/Contents/Frameworks/libswiftCore.dylib" # verify swift-stdlib-tool did its job
|
||||
# codesign --sign "$(SIGN_MAS_APP)" --identifier "$(APP_ID)" --deep --entitlements Packaging/entitlements.plist --options runtime "$@"
|
||||
# find "$@" -type f -perm +111 -print0 | xargs -0 codesign --verify --verbose
|
||||
|
||||
# For "Developer ID" distribution outside the Mac App Store
|
||||
#dist-devid: dist/$(PACKAGE_FILE)
|
||||
|
||||
#resolve-dependencies:
|
||||
# swift package resolve
|
||||
|
||||
#zip: dist/$(ZIP_FILE)
|
||||
|
||||
# build PKG (signed but not notarized)
|
||||
#dist/tmp.devid/$(PACKAGE_FILE): dist/tmp.devid/app/$(APP_BUNDLE)
|
||||
# pkgbuild --analyze --root dist/tmp.devid/app/ dist/tmp.devid/components.plist
|
||||
# plutil -replace "BundleIsRelocatable" -bool "NO" dist/tmp.devid/components.plist
|
||||
# pkgbuild --root dist/tmp.devid/app/ --install-location /Applications/ --component-plist dist/tmp.devid/components.plist dist/tmp.devid/ScratchLink.pkg
|
||||
# productbuild --synthesize --package dist/tmp.devid/ScratchLink.pkg dist/tmp.devid/distribution.plist
|
||||
# # TODO: add a README and/or LICENSE to dist/tmp.devid/distribution.plist
|
||||
# productbuild --sign "$(SIGN_MAC_INS)" --component-compression auto --distribution dist/tmp.devid/distribution.plist --package-path dist/tmp.devid/ "$@"
|
||||
|
||||
# notarize and staple final PKG
|
||||
#dist/$(PACKAGE_FILE): dist/tmp.devid/$(PACKAGE_FILE)
|
||||
# cp -a "$<" "$@"
|
||||
# Packaging/notarize.sh "${APP_ID}" "$<" "$@" dist/tmp.devid
|
||||
|
||||
#dist/tmp.devid/app/$(APP_BUNDLE): dist/$(APP_BUNDLE)
|
||||
# rm -rf dist/tmp.devid/app
|
||||
# mkdir -p dist/tmp.devid/app
|
||||
# cp -aR "$<" "$@"
|
||||
# xcrun swift-stdlib-tool --copy --sign "$(SIGN_MAC_APP)" --Xcodesign --options --Xcodesign runtime --platform macosx --scan-folder "$@/Contents/MacOS" --destination "$@/Contents/Frameworks"
|
||||
# test -r "$@/Contents/Frameworks/libswiftCore.dylib" # verify swift-stdlib-tool did its job
|
||||
# codesign --sign "$(SIGN_MAC_APP)" --identifier "$(APP_ID)" --deep --entitlements Packaging/entitlements.plist --options runtime "$@"
|
||||
# find "$@" -type f -perm +111 -print0 | xargs -0 codesign --verify --verbose
|
||||
|
||||
# TODO: remove "-Xswiftc -Xfrontend -Xswiftc -validate-tbd-against-ir=none"
|
||||
# once Perfect-Crypto builds in debug without it
|
||||
#$(BIN_FILE): $(SWIFT_SOURCES)
|
||||
# @echo "Build Version: $(APP_VERSION) $(VERSION_DETAIL)"
|
||||
# swift build --configuration $(CONFIG) --no-static-swift-stdlib -Xlinker -rpath -Xlinker '@executable_path/../Frameworks' -Xswiftc -Xfrontend -Xswiftc -validate-tbd-against-ir=none
|
||||
|
||||
#xcodeproj:
|
||||
# swift package generate-xcodeproj
|
||||
|
||||
#dist/$(ZIP_FILE): dist/$(APP_BUNDLE)
|
||||
# cd dist && zip -v9r $(ZIP_FILE) $(APP_BUNDLE)
|
||||
|
||||
#$(APP_DEST): $(BIN_FILE) Packaging/entitlements.plist Packaging/Info.plist dist/Scratch\ Link.iconset dist/iconTemplate.iconset
|
||||
# rm -rf "$@"
|
||||
# mkdir -p "$@/Contents/MacOS"
|
||||
# cp $(BIN_FILE) "$@/Contents/MacOS/"
|
||||
# cp Packaging/Info.plist "$@/Contents/"
|
||||
# plutil -replace "CFBundleVersion" -string "$(APP_VERSION)" "$@/Contents/Info.plist"
|
||||
# plutil -replace "CFBundleShortVersionString" -string "$(APP_VERSION)" "$@/Contents/Info.plist"
|
||||
# plutil -replace "ScratchVersionDetail" -string "$(VERSION_DETAIL)" "$@/Contents/Info.plist"
|
||||
# mkdir -p "$@/Contents/Resources"
|
||||
# iconutil -c icns --output "$@/Contents/Resources/Scratch Link.icns" "dist/Scratch Link.iconset"
|
||||
# iconutil -c icns --output "$@/Contents/Resources/iconTemplate.icns" "dist/iconTemplate.iconset"
|
||||
|
||||
Assets.xcassets/AppIcon.appiconset: ../Assets/Mac/raster/Master\ 1024x1024.png
|
||||
|
||||
Assets.xcassets/StatusBarIcon.iconset: ../Assets/Mac/raster/Mac\ Glyph\ Icon\ 1024x1024.png
|
||||
|
||||
# Generate a full icon set from an input image.
|
||||
# The @2x are marked as 144 DPI while the others are marked as 72 DPI.
|
||||
%.iconset:
|
||||
mkdir -p "$@"
|
||||
sips -s dpiWidth 72 -s dpiHeight 72 -z 16 16 "$<" --out "$@/icon_16x16.png"
|
||||
sips -s dpiWidth 72 -s dpiHeight 72 -z 32 32 "$<" --out "$@/icon_32x32.png"
|
||||
sips -s dpiWidth 72 -s dpiHeight 72 -z 128 128 "$<" --out "$@/icon_128x128.png"
|
||||
sips -s dpiWidth 72 -s dpiHeight 72 -z 256 256 "$<" --out "$@/icon_256x256.png"
|
||||
sips -s dpiWidth 72 -s dpiHeight 72 -z 512 512 "$<" --out "$@/icon_512x512.png"
|
||||
sips -s dpiWidth 144 -s dpiHeight 144 -z 32 32 "$<" --out "$@/icon_16x16@2x.png"
|
||||
sips -s dpiWidth 144 -s dpiHeight 144 -z 64 64 "$<" --out "$@/icon_32x32@2x.png"
|
||||
sips -s dpiWidth 144 -s dpiHeight 144 -z 256 256 "$<" --out "$@/icon_128x128@2x.png"
|
||||
sips -s dpiWidth 144 -s dpiHeight 144 -z 512 512 "$<" --out "$@/icon_256x256@2x.png"
|
||||
sips -s dpiWidth 144 -s dpiHeight 144 -z 1024 1024 "$<" --out "$@/icon_512x512@2x.png"
|
||||
for PNG in "$@"/icon_*.png; do pngcrush -new -brute -ow "$${PNG}"; done
|
||||
|
||||
# An App Icon Set is almost the same, except for the file name pattern and an additional file called Contents.json
|
||||
# Assume that Contents.json is handled already
|
||||
%.appiconset:
|
||||
mkdir -p "$@"
|
||||
sips -s dpiWidth 72 -s dpiHeight 72 -z 16 16 "$<" --out "$@/AppIcon-16.png"
|
||||
sips -s dpiWidth 72 -s dpiHeight 72 -z 32 32 "$<" --out "$@/AppIcon-32.png"
|
||||
sips -s dpiWidth 72 -s dpiHeight 72 -z 128 128 "$<" --out "$@/AppIcon-128.png"
|
||||
sips -s dpiWidth 72 -s dpiHeight 72 -z 256 256 "$<" --out "$@/AppIcon-256.png"
|
||||
sips -s dpiWidth 72 -s dpiHeight 72 -z 512 512 "$<" --out "$@/AppIcon-512.png"
|
||||
sips -s dpiWidth 144 -s dpiHeight 144 -z 32 32 "$<" --out "$@/AppIcon-16@2x.png"
|
||||
sips -s dpiWidth 144 -s dpiHeight 144 -z 64 64 "$<" --out "$@/AppIcon-32@2x.png"
|
||||
sips -s dpiWidth 144 -s dpiHeight 144 -z 256 256 "$<" --out "$@/AppIcon-128@2x.png"
|
||||
sips -s dpiWidth 144 -s dpiHeight 144 -z 512 512 "$<" --out "$@/AppIcon-256@2x.png"
|
||||
sips -s dpiWidth 144 -s dpiHeight 144 -z 1024 1024 "$<" --out "$@/AppIcon-512@2x.png"
|
||||
for PNG in "$@"/AppIcon-*.png; do pngcrush -new -brute -ow "$${PNG}"; done
|
||||
|
||||
#clean:
|
||||
# rm -rf dist/ .build/*-apple-*/debug .build/*-apple-*/release "$(BIN_FILE)"
|
||||
|
||||
#distclean: clean
|
||||
# rm -rf .build
|
||||
|
||||
#uninstall:
|
||||
# @echo "These steps will probably fail unless run with sudo..."
|
||||
# rm -rf /Library/Scratch/$(APP_BUNDLE)
|
||||
# rmdir /Library/Scratch || true
|
||||
# rm -f "/Library/LaunchAgents/$(APP_ID).plist"
|
||||
# pkgutil --forget "$(APP_ID)"
|
|
@ -192,7 +192,6 @@
|
|||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
<None Include="Entitlements.plist" />
|
||||
<None Include="Makefile" />
|
||||
<None Include="app.config" />
|
||||
<None Include="notarize.sh" />
|
||||
</ItemGroup>
|
||||
|
@ -241,4 +240,4 @@
|
|||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
|
@ -19,6 +19,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||
.gitignore = .gitignore
|
||||
.markdownlintrc = .markdownlintrc
|
||||
LICENSE = LICENSE
|
||||
Makefile = Makefile
|
||||
playground.html = playground.html
|
||||
README.md = README.md
|
||||
stylecop.json = stylecop.json
|
||||
|
|