XcodeGen/Makefile

48 lines
1.4 KiB
Makefile
Raw Normal View History

2018-02-27 03:41:46 +03:00
TOOL_NAME = XcodeGen
export EXECUTABLE_NAME = xcodegen
2018-03-03 02:14:55 +03:00
VERSION = 1.7.0
2017-07-28 15:13:41 +03:00
2017-09-23 18:22:22 +03:00
PREFIX = /usr/local
INSTALL_PATH = $(PREFIX)/bin/$(EXECUTABLE_NAME)
SHARE_PATH = $(PREFIX)/share/$(EXECUTABLE_NAME)
2017-07-28 14:55:36 +03:00
CURRENT_PATH = $(PWD)
REPO = https://github.com/yonaskolb/$(EXECUTABLE_NAME)
2017-10-28 20:58:56 +03:00
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
cp -f .build/release/$(EXECUTABLE_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)
2018-02-25 11:11:48 +03:00
archive: build
./scripts/archive.sh