-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
68 lines (56 loc) · 2.05 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
62
63
64
65
66
67
68
.PHONY: help
help: ## Show this usage
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: xcode
xcode: ## Select latest version of Xcode
sudo xcode-select --switch /Applications/Xcode.app/
.PHONY: bootstrap
bootstrap: ## Install tools
make clean
make build-cli-tools
make format-configuration
bundle config set path 'vendor/bundle'
bundle install
bundle binstubs generamba --path=vendor/bin
.PHONY: template-flux-%
template-flux-%: ## Generate swift flux files from template. Use specific module name.
bundle exec generamba gen ${@:template-flux-%=%} flux
make xcodegen
.PHONY: project
project: ## Generate project
make xcodegen
.PHONY: xcodegen
xcodegen: ## Generate Xcode project and workspace
swift run -c release --package-path ./Tools xcodegen
.PHONY: swiftgen
swiftgen: ## Generate resources swift files.
swift run -c release --package-path ./Tools swiftgen
.PHONY: open
open: ## Open Xcode workspace
open ./App.xcodeproj
.PHONY: clean
clean: ## Clean generated files
rm -rf ./**/Generated/*
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf Pods
rm -rf Carthage
rm -rf ./Tools/**/.build/*
.PHONY: format-configuration
format-configuration: ## Create default .swift-format file if not exists.
ifneq ("$(wildcard .swift-format)","")
echo Exists .swift-format;
else
swift run -c release --package-path ./Tools swift-format --mode dump-configuration > .swift-format;
endif
.PHONY: lint
lint: ## Linting Swift code
swift run -c release --package-path ./Tools swift-format -r ./PCSwiftUI -m lint
.PHONY: format
format: ## Reformatting Swift code
swift run -c release --package-path ./Tools swift-format -r ./PCSwiftUI -i
.PHONY: build-cli-tools
build-cli-tools: ## Build CLI tools managed by SwiftPM
swift build -c release --package-path ./Tools --product license-plist
swift build -c release --package-path ./Tools --product swiftgen
swift build -c release --package-path ./Tools --product swift-format
swift build -c release --package-path ./Tools --product xcodegen