forked from bloomberg/xcdiff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (39 loc) · 1.27 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
40
41
42
43
44
45
46
47
48
49
50
51
52
VERSION_MAJOR = 0
VERSION_MINOR = 7
VERSION_PATCH = 0
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
GIT_SHORT_HASH = $(shell git rev-parse --short HEAD)
TOOL_NAME = xcdiff
PREFIX = /usr/local
INSTALL_PATH = $(PREFIX)/bin/
BUILD_PATH = .build/release/$(TOOL_NAME)
clean:
xcrun swift package clean
install: clean build
mkdir -p $(PREFIX)/bin
cp -f $(BUILD_PATH) $(INSTALL_PATH)
build:
xcrun swift build --disable-sandbox -c release
test:
xcrun swift test --enable-code-coverage
test_ci: test
./Scripts/coverage.sh
update_version:
sed -i '' 's/\(Version(\)\(.*\)\(, \)/\1$(VERSION_MAJOR), $(VERSION_MINOR), $(VERSION_PATCH)\3/' Sources/XCDiffCommand/Constants.swift
sed -i '' 's/upToNextMinor(from: ".*")/upToNextMinor(from: "${VERSION}")/' Documentation/Installation.md
sed -i '' 's/output, ".*debug.local/output, "${VERSION}+debug.local/' Tests/XCDiffCommandTests/CommandsRunnerTests.swift
update_hash:
sed -i '' 's/#GIT_SHORT_HASH#/$(GIT_SHORT_HASH)/' Sources/XCDiffCommand/Constants.swift
format:
swiftformat .
autocorrect:
swiftlint autocorrect --quiet
lint:
swiftlint version
swiftformat --version
swiftlint --strict --quiet
swiftformat . --lint
regenerate_command_snapshots:
./Scripts/generate_tests_commands_files.p
install_tools:
./Scripts/brew.sh