This repository has been archived by the owner on Oct 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
117 lines (79 loc) · 3.69 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
XCODEFLAGS=-project Sylvester.xcodeproj \
-destination 'platform=macOS'
TRAVIS_ENV_VARIABLES=TEST_FIXTURES_PATH=`pwd`/Tests/Fixtures
BUILD_SETTINGS='SWIFT_ACTIVE_COMPILATION_CONDITIONS=XCODEBUILD'
XPC_BUILD_SETTINGS='SWIFT_ACTIVE_COMPILATION_CONDITIONS=XPC XCODEBUILD'
TRAVIS_BUILD_SETTINGS='SWIFT_ACTIVE_COMPILATION_CONDITIONS=XCODEBUILD TRAVIS'
TRAVIS_XPC_BUILD_SETTINGS='SWIFT_ACTIVE_COMPILATION_CONDITIONS=XPC XCODEBUILD TRAVIS'
MAKE_PRETTY=| xcpretty && exit ${PIPESTATUS[0]}
MAKE_PRETTY_FOR_TRAVIS=| xcpretty -f `xcpretty-travis-formatter` && exit ${PIPESTATUS[0]}
.PHONY: all travis travis-pr carthage build build-normal build-xpc build-sandbox travis-build-pr travis-build travis-build-normal travis-build-xpc travis-build-sandbox test test-normal test-xpc test-sandbox travis-test-pr travis-test travis-test-normal travis-test-xpc travis-test-sandbox generate-boilerplate generate-docs swiftlint convert-xccov-to-sonarqube clean
###################
##### General #####
###################
all: carthage build
travis: carthage travis-build
travis-pr: carthage travis-build-pr
####################
##### Carthage #####
####################
carthage:
carthage update --platform macOS
#################
##### Build #####
#################
build: build-normal build-xpc build-sandbox
build-normal:
xcodebuild $(XCODEFLAGS) -scheme Sylvester $(MAKE_PRETTY)
build-xpc:
xcodebuild $(XCODEFLAGS) -scheme SylvesterXPC $(MAKE_PRETTY)
build-sandbox:
xcodebuild $(XCODEFLAGS) -scheme Sandbox $(MAKE_PRETTY)
########################
##### Travis Build #####
########################
travis-build-pr: travis-build-normal travis-build-xpc
travis-build: travis-build-pr travis-build-sandbox
travis-build-normal:
xcodebuild $(XCODEFLAGS) -scheme Sylvester $(MAKE_PRETTY_FOR_TRAVIS)
travis-build-xpc:
xcodebuild $(XCODEFLAGS) -scheme SylvesterXPC $(MAKE_PRETTY_FOR_TRAVIS)
travis-build-sandbox:
xcodebuild $(XCODEFLAGS) -scheme Sandbox $(MAKE_PRETTY_FOR_TRAVIS)
################
##### Test #####
################
test: test-normal test-xpc test-sandbox
test-normal:
xcodebuild test $(XCODEFLAGS) -scheme Sylvester $(BUILD_SETTINGS) $(MAKE_PRETTY)
test-xpc:
xcodebuild test $(XCODEFLAGS) -scheme SylvesterXPC $(XPC_BUILD_SETTINGS) $(MAKE_PRETTY)
test-sandbox:
xcodebuild test $(XCODEFLAGS) -scheme Sandbox $(XPC_BUILD_SETTINGS) $(MAKE_PRETTY)
#######################
##### Travis Test #####
#######################
travis-test-pr: clean travis-test-normal travis-test-xpc convert-xccov-to-sonarqube
travis-test: travis-test-pr travis-test-sandbox
travis-test-normal:
xcodebuild test $(XCODEFLAGS) -scheme Sylvester -configuration Debug $(TRAVIS_BUILD_SETTINGS) $(MAKE_PRETTY_FOR_TRAVIS)
travis-test-xpc:
xcodebuild test $(XCODEFLAGS) -scheme SylvesterXPC -configuration Debug -resultBundlePath .test-results $(TRAVIS_XPC_BUILD_SETTINGS) $(MAKE_PRETTY_FOR_TRAVIS)
travis-test-sandbox:
$(TRAVIS_ENV_VARIABLES) xcodebuild test $(XCODEFLAGS) -scheme Sandbox $(TRAVIS_XPC_BUILD_SETTINGS) $(MAKE_PRETTY_FOR_TRAVIS)
#################
##### Other #####
#################
generate-boilerplate:
cd Source/Enumerations/Generated; \
../../../Scripts/generate_boilerplate.swift
generate-docs:
jazzy --clean --module SylvesterXPC --xcodebuild-arguments -scheme,SylvesterXPC
jazzy --module SylvesterCommon --xcodebuild-arguments -scheme,SylvesterCommon,-configuration,Debug,SWIFT_ACTIVE_COMPILATION_CONDITIONS=XPC --output docs/SylvesterCommon
./Scripts/generate_docs.swift `pwd`/docs
swiftlint:
swiftlint lint --reporter json > .test-results/swiftlint.json
convert-xccov-to-sonarqube:
./Scripts/xccov_to_sonarqube_generic.sh .test-results/1_Test/action.xccovarchive/ > .test-results/sonarqube-generic-coverage.xml
clean:
rm -rf ./.test-results