forked from SourceDocs/SourceDocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (31 loc) · 1012 Bytes
/
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
40
41
42
TOOL_NAME = sourcedocs
VERSION = 2.0.1
PREFIX = /usr/local
INSTALL_PATH = $(PREFIX)/bin/$(TOOL_NAME)
BUILD_PATH = .build/release/$(TOOL_NAME)
TAR_FILENAME = $(VERSION).tar.gz
.PHONY: build docs
install: build
install -d "$(PREFIX)/bin"
install -C -m 755 $(BUILD_PATH) $(INSTALL_PATH)
build:
swift build --disable-sandbox -c release
uninstall:
rm -f $(INSTALL_PATH)
lint:
swiftlint autocorrect --quiet
swiftlint lint --quiet --strict
docs:
swift run sourcedocs generate --clean -ar -o docs/reference
swift run sourcedocs package -r -o docs
linuxmain:
swift test --generate-linuxmain
zip: build
zip -D $(TOOL_NAME).macos.zip $(BUILD_PATH)
get_sha:
curl -OLs https://github.com/eneko/$(TOOL_NAME)/archive/$(VERSION).tar.gz
shasum -a 256 $(TAR_FILENAME) | cut -f 1 -d " " > sha_$(VERSION).txt
rm $(TAR_FILENAME)
brew_push: get_sha
SHA=$(shell cat sha_$(VERSION).txt); \
brew bump-formula-pr --url=https://github.com/eneko/$(TOOL_NAME)/archive/$(VERSION).tar.gz --sha256=$$SHA $(TOOL_NAME)