XcodeGen/Makefile

44 lines
1.3 KiB
Makefile
Raw Normal View History

2017-12-27 12:50:30 +03:00
TOOL_NAME = xcodegen
2017-12-27 12:51:22 +03:00
VERSION = 1.5.0
2017-07-28 15:13:41 +03:00
2017-09-23 18:22:22 +03:00
PREFIX = /usr/local
INSTALL_PATH = $(PREFIX)/bin/$(TOOL_NAME)
SHARE_PATH = $(PREFIX)/share/$(TOOL_NAME)
2017-07-28 14:55:36 +03:00
CURRENT_PATH = $(PWD)
2017-10-28 20:58:56 +03:00
REPO = https://github.com/yonaskolb/$(TOOL_NAME)
RELEASE_TAR = $(REPO)/archive/$(VERSION).tar.gz
SHA = $(shell curl -L -s $(RELEASE_TAR) | shasum -a 256 | sed 's/ .*//')
.PHONY: install build uninstall format_code update_brew release
2017-07-28 14:55:36 +03:00
2017-09-23 18:22:22 +03:00
install: build
mkdir -p $(PREFIX)/bin
2017-10-28 20:58:56 +03:00
cp -f .build/release/$(TOOL_NAME) $(INSTALL_PATH)
2017-08-24 02:22:51 +03:00
mkdir -p $(SHARE_PATH)
cp -R $(CURRENT_PATH)/SettingPresets $(SHARE_PATH)/SettingPresets
2017-09-23 18:22:22 +03:00
build:
swift build --disable-sandbox -c release -Xswiftc -static-stdlib
2017-07-28 14:55:36 +03:00
uninstall:
2017-09-18 23:47:52 +03:00
rm -f $(INSTALL_PATH)
2017-09-23 18:22:22 +03:00
rm -rf $(SHARE_PATH)
2017-10-28 20:58:56 +03:00
format_code:
2017-12-26 13:47:18 +03:00
swiftformat Tests --wraparguments beforefirst --stripunusedargs closure-only --header strip
swiftformat Sources --wraparguments beforefirst --stripunusedargs closure-only --header strip
2017-10-28 20:58:56 +03:00
update_brew:
sed -i '' 's|\(url ".*/archive/\)\(.*\)\(.tar\)|\1$(VERSION)\3|' Formula/xcodegen.rb
sed -i '' 's|\(sha256 "\)\(.*\)\("\)|\1$(SHA)\3|' Formula/xcodegen.rb
git add .
git commit -m "Update brew to $(VERSION)"
release: format_code
sed -i '' 's|\(let version = "\)\(.*\)\("\)|\1$(VERSION)\3|' Sources/XcodeGen/main.swift
git add .
git commit -m "Update to $(VERSION)"
git tag $(VERSION)