forked from erikdoe/ocmock
/
Makefile
78 lines (55 loc) · 2.52 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
# This makefile has the following top-level targets:
# - ci used by Travis for continuous integration
# - dist used to build the binary distribution
#
# Note that the dist target uses git checkout to copy the source into the
# product directory. This means you should make sure that you don't have
# uncommited local changes when building a distribution.
BUILD_DIR = $(CURDIR)/Build
PRODUCT_DIR = $(BUILD_DIR)/Product
XCODECI = xcodebuild -project "$(CURDIR)/Source/OCMock.xcodeproj" -xcconfig "$(CURDIR)/Source/OCMockCI.xcconfig" -destination-timeout 600
XCODEDIST = xcodebuild -project "$(CURDIR)/Source/OCMock.xcodeproj" -xcconfig "$(CURDIR)/Source/OCMockDist.xcconfig"
SHELL = /bin/bash -e -o pipefail
.PHONY: macos ioslib ios tvos watchos sourcecode product dmg swiftpm carthage
clean:
rm -rf "$(CURDIR)/Build"
ci: ci-macos ci-ios swiftpm
ci-macos:
@echo "Building macOS framework and running tests..."
$(XCODECI) -scheme OCMock -sdk macosx test | xcpretty -c
ci-ios:
@echo "Building iOS library and running tests..."
$(XCODECI) -scheme OCMockLib -destination 'platform=iOS Simulator,OS=latest,name=iPhone 11' test | xcpretty -c
dist: product sourcecode dmg
macos:
@echo "** Building macOS framework..."
$(XCODEDIST) -scheme OCMock install INSTALL_PATH="/macOS" | xcpretty -c
ioslib:
@echo "** Building iOS library..."
$(XCODEDIST) -target OCMockLib -sdk iphonesimulator install INSTALL_PATH="/iOS library" | xcpretty -c
ios:
@echo "** Building iOS framework..."
$(XCODEDIST) -target "OCMock iOS" -sdk iphonesimulator install INSTALL_PATH="/iOS" | xcpretty -c
tvos:
@echo "** Building tvOS framework..."
$(XCODEDIST) -target "OCMock tvOS" -sdk appletvsimulator install INSTALL_PATH="/tvOS" | xcpretty -c
watchos:
@echo "** Building watchOS framework..."
$(XCODEDIST) -target "OCMock watchOS" -sdk watchsimulator install INSTALL_PATH="/watchOS" | xcpretty -c
sourcecode:
@echo "** Checking out source code..."
mkdir -p "$(PRODUCT_DIR)"
git archive master | tar -x -C "$(PRODUCT_DIR)" Source
product: macos ioslib ios tvos watchos
@echo "** Verifying build products..."
Tools/buildcheck.rb $(PRODUCT_DIR)
dmg:
@echo "** Creating disk image..."
Tools/makedmg.rb $(PRODUCT_DIR) $(BUILD_DIR)
swiftpm:
echo "** Testing Swift Package Manager Distribution"
swift build
swift test
carthage:
XCODE_XCCONFIG_FILE="$(CURDIR)/Source/Carthage.xcconfig" carthage build --no-skip-current --project-directory "$(CURDIR)/Source"
XCODE_XCCONFIG_FILE="$(CURDIR)/Source/Carthage.xcconfig" carthage archive OCMock