Skip to content

Commit

Permalink
v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rezigned committed Sep 30, 2021
0 parents commit b0cdece
Show file tree
Hide file tree
Showing 38 changed files with 1,500 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

custom: ["https://www.paypal.me/rezigned", "https://buymeacoffee.com/rezigned"]
Binary file added .github/icon.icns
Binary file not shown.
Binary file added .github/mousemory.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# https://github.com/github/gitignore/blob/master/Swift.gitignore
#
## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
.DS_Store

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 @rezigned

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
76 changes: 76 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
NAME = Mousemory
KEY = $(shell echo $(NAME) | tr 'A-Z' 'a-z')
APP = $(NAME).app
DMG = $(NAME).dmg
BUNDLE = com.rezigned.$(NAME)
ICON = .github/icon.icns
BUILD_DIR = ./build/Release

# github
GITHUB_URL = https://github.com/rezigned/$(NAME)
RELEASE_URL = $(GITHUB_URL)/releases/download/v\#\{version\}/$(DMG)

# homebrew
CASK_DIR = $(shell brew --repository)/Library/Taps/homebrew/homebrew-cask
CASK_FILE = $(CASK_DIR)/Casks/mousemory.rb
BREW = brew
DESC = $(NAME) - remembers mouse position across multiple monitors

.PHONY: install build

install: check
create-dmg \
--volname $(NAME) \
--window-pos 200 120 \
--window-size 800 400 \
--hide-extension "$(APP)" \
--app-drop-link 600 185 \
--volicon "$(ICON)" \
--icon-size 128 \
--icon "$(APP)" 200 190 \
"$(DMG)" \
$(BUILD_DIR)

check:
[ -f "$(DMG)" ] && rm $(DMG) || true
[ -d "$(BUILD_DIR)/$(APP).dSYM" ] && rm -rf $(BUILD_DIR)/*.dSYM || true
[ -d "$(BUILD_DIR)/$(NAME).swiftmodule" ] && rm -rf $(BUILD_DIR)/*.swiftmodule || true

clean:
defaults delete $(BUNDLE)

build:
xcodebuild clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO

version:
plutil -p $(NAME)/Info.plist | grep CFBundleShortVersionString | awk '{ print $$3 }'

cask-token:
$(CASK_DIR)/developer/bin/generate_cask_token $(APP) 2>/dev/null \
| grep "Proposed token" \
| awk '{ print $$3 }'

cask-create:
brew create --cask $(RELEASE_URL) --set-name "$(shell $(MAKE) -s cask-token)"

cask-edit:
cat $(CASK_FILE)

cask-audit:
brew audit --new-cask $(KEY)

cask-style:
brew style --fix $(KEY)

cask-checksum: $(DMG)
shasum -a 256 $(DMG) | awk '{print $$1}'

cask-update:
sed -i -E -e 's/\(url[ ]*\)"[^"]*"/\1"$(shell echo $(GITHUB_URL) | sed 's/\//\\\//g')"/g' \
-e 's/\(app[ ]*\)"[^"]*"/\1"$(APP)"/g' \
-e 's/\(name[ ]*\)"[^"]*"/\1"$(NAME)"/g' \
-e 's/\(desc[ ]*\)"[^"]*"/\1"$(DESC)"/g' \
-e 's/\(url[ ]*\)"[^"]*"/\1"$(shell echo $(RELEASE_URL) | sed 's/\//\\\//g')"/g' \
-e 's/\(homepage[ ]*\)"[^"]*"/\1"$(shell echo $(GITHUB_URL) | sed 's/\//\\\//g')"/g' \
-e 's/\(version[ ]*\)"[^"]*"/\1"$(shell $(MAKE) -s version | sed 's/"//g')"/g' \
-e 's/\(sha256[ ]*\)make "[^"]*"/\1"$(shell $(MAKE) -s cask-checksum)"/g' $(CASK_FILE)
Loading

0 comments on commit b0cdece

Please sign in to comment.