-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (48 loc) · 1.35 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
53
54
55
56
57
58
59
60
61
CONFIG = debug
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS 17.2,iPhone \d\+ Pro [^M])
PLATFORM_MACOS = macOS
open:
open Hoods.xcworkspace
install:
bundle install
swift package resolve
build:
swift build
test-debug:
swift package clean
swift test --verbose --very-verbose
test:
for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)"; do \
xcodebuild test \
-skipMacroValidation \
-configuration $(CONFIG) \
-workspace .github/package.xcworkspace \
-scheme Hoods \
-destination platform="$$platform" || exit 1; \
done
release:
swift build -c release
format:
swiftformat --verbose .
swiftlint lint --autocorrect .
lint:
swiftformat --lint .
swiftlint lint .
clean:
rm -rf .build/
rm -rf .swiftpm/
rm -rf Examples/HoodsCLI/.build/
rm -rf Examples/HoodsCLI/.swiftpm/
rm -rf .Hoods.doccarchive/
docs:
xcodebuild docbuild -scheme "Hoods" -derivedDataPath tmp/derivedDataPath -destination platform=macOS
rsync -r tmp/derivedDataPath/Build/Products/Debug/Hoods.doccarchive/ .Hoods.doccarchive
rm -rf tmp/
serve-docs:
serve --single .Hoods.doccarchive
cli: ## Build the demo CLI
swift package update --package-path Examples/HoodsCLI/
swift build --package-path Examples/HoodsCLI/
define udid_for
$(shell xcrun simctl list devices available '$(1)' | grep '$(2)' | sort -r | head -1 | awk -F '[()]' '{ print $$(NF-3) }')
endef