-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
39 lines (30 loc) · 1.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
TOOL_NAME = Genesis
export EXECUTABLE_NAME = genesis
VERSION = 0.8.0
PREFIX = /usr/local
INSTALL_PATH = $(PREFIX)/bin/$(EXECUTABLE_NAME)
FORMULA = Formula/$(EXECUTABLE_NAME).rb
REPO = https://github.com/yonaskolb/$(EXECUTABLE_NAME)
RELEASE_TAR = $(REPO)/archive/$(VERSION).tar.gz
SWIFT_BUILD_FLAGS = --disable-sandbox -c release --arch arm64 --arch x86_64
EXECUTABLE_PATH = $(shell swift build $(SWIFT_BUILD_FLAGS) --show-bin-path)/$(EXECUTABLE_NAME)
.PHONY: install build uninstall format_code release
install: build
mkdir -p $(PREFIX)/bin
cp -f $(EXECUTABLE_PATH) $(INSTALL_PATH)
build:
swift build $(SWIFT_BUILD_FLAGS)
uninstall:
rm -f $(INSTALL_PATH)
rm -rf $(SHARE_PATH)
format_code:
swiftformat Tests --wraparguments beforefirst --stripunusedargs closure-only --header strip --disable blankLinesAtStartOfScope
swiftformat Sources --wraparguments beforefirst --stripunusedargs closure-only --header strip --disable blankLinesAtStartOfScope
commit_format_code: format_code
git add .
git commit -m "Format code with `swiftformat --version`"
release: format_code
sed -i '' 's|\(let version = "\)\(.*\)\("\)|\1$(VERSION)\3|' Sources/GenesisCLI/GenesisCLI.swift
git add .
git commit -m "Update to $(VERSION)"
git tag $(VERSION)