-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
51 lines (45 loc) · 1.54 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
.PHONY: lint
lint:
@which swiftformat || \
(printf '\e[31m⛔️ Could not find SwiftFormat.\e[m\n\e[33m🚑 Run: brew install swiftformat\e[m\n' && exit 1)
@which swiftlint || \
(printf '\e[31m⛔️ Could not find SwiftLint.\e[m\n\e[33m🚑 Run: brew install swiftlint\e[m\n' && exit 1)
swiftformat --quiet .
swiftlint --fix --quiet
swiftlint --strict --quiet
.PHONY: install-cli
install:
swift build --arch arm64 -c release
cp -f `swift build --arch arm64 -c release --show-bin-path`/xtree ~/.local/bin/xtree
.PHONY: release-cli
release-cli:
mkdir -p Release
swift package clean
swift build -c release --arch x86_64
cp -f `swift build -c release --arch x86_64 --show-bin-path`/xtree Release/xtree
strip -rSTx Release/xtree
cd Release && zip -r x86_64.zip xtree
cd Release && mv xtree xtree-x86_64
@echo
swift package clean
swift build --arch arm64 -c release
cp -f `swift build -c release --arch arm64 --show-bin-path`/xtree Release/xtree
strip -rSTx Release/xtree
cd Release && zip -r arm64.zip xtree
cd Release && mv xtree xtree-arm64
.PHONY: release-app
release-app:
rm -rf Release/build
rm -rf Release/XTree.app
rm -rf Release/XTree.zip
mkdir -p Release
xcodebuild \
-workspace XTree.xcworkspace \
-scheme XTree \
-configuration Release \
-destination 'generic/platform=macOS' \
-derivedDataPath Release/build \
-clonedSourcePackagesDirPath "${HOME}/Library/Developer/Xcode/DerivedData/XTree" \
| xcbeautify
mv Release/build/Build/Products/Release/XTree.app Release/XTree.app
cd Release && zip -r XTree.zip XTree.app