-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (54 loc) · 1.43 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
SWIFT_BUILD=swift build -c release --package-path Tools
SWIFT_BUILD_PRODUCT=swift build -c release --package-path Tools --product
SWIFT_RUN=swift run -c release --package-path Tools
SWIFT_BUILD_OUT:=./Tools/.build/release
GRPC_OUT:=./Sources/Proto
WORKSPACE=TCASwiftUITemplateApp.xcworkspace
export PATH += :$(SWIFT_BUILD_OUT)
.PHONY: open
open:
open $(WORKSPACE)
# setup
.PHONY: setup
setup: build-proto-bin submodule-init
# Submodule
.PHONY: submodule-init
submodule-init:
git submodule update --init --recursive
.PHONY: submodule-update
submodule-update:
git submodule update --remote
# proto
.PHONY: build-proto-bin
build-proto-bin:
$(SWIFT_BUILD_PRODUCT) protoc-gen-swift
$(SWIFT_BUILD_PRODUCT) protoc-gen-grpc-swift
.PHONY: proto-update
proto-update: submodule-update proto
.PHONY: proto
proto:
mkdir -p $(GRPC_OUT)
protoc ./proto/proto/*.proto \
-I./proto \
--grpc-swift_out Client=true,Server=false,Visibility=Public:$(GRPC_OUT) \
--swift_out Visibility=Public:$(GRPC_OUT) \
--swift_opt FileNaming=DropPath
# Tools
# Package build
.PHONY: package-build
package-build:
$(SWIFT_BUILD)
.PHONY: package-build-ci
package-build-ci:
$(SWIFT_BUILD_PRODUCT) swiftlint
$(SWIFT_BUILD_PRODUCT) swiftformat
# SwiftFormat
.PHONY: run-swiftformat
run-swiftformat:
$(SWIFT_RUN) swiftformat .
# swift-mod
.PHONY: run-swift-mod
run-swift-mod:
$(SWIFT_RUN) swift-mod
.PHONY: run-format
run-format: run-swiftformat run-swift-mod