forked from adobe/aepsdk-edge-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
164 lines (132 loc) · 8.07 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
export EXTENSION_NAME = AEPEdge
PROJECT_NAME = $(EXTENSION_NAME)
SCHEME_NAME_XCFRAMEWORK = AEPEdgeXCF
TEST_APP_IOS_SCHEME = TestAppiOS
TEST_APP_TVOS_SCHEME = TestApptvOS
CURR_DIR := ${CURDIR}
IOS_SIMULATOR_ARCHIVE_PATH = $(CURR_DIR)/build/ios_simulator.xcarchive/Products/Library/Frameworks/
IOS_SIMULATOR_ARCHIVE_DSYM_PATH = $(CURR_DIR)/build/ios_simulator.xcarchive/dSYMs/
IOS_ARCHIVE_PATH = $(CURR_DIR)/build/ios.xcarchive/Products/Library/Frameworks/
IOS_ARCHIVE_DSYM_PATH = $(CURR_DIR)/build/ios.xcarchive/dSYMs/
TVOS_SIMULATOR_ARCHIVE_PATH = $(CURR_DIR)/build/tvos_simulator.xcarchive/Products/Library/Frameworks/
TVOS_SIMULATOR_ARCHIVE_DSYM_PATH = $(CURR_DIR)/build/tvos_simulator.xcarchive/dSYMs/
TVOS_ARCHIVE_PATH = $(CURR_DIR)/build/tvos.xcarchive/Products/Library/Frameworks/
TVOS_ARCHIVE_DSYM_PATH = $(CURR_DIR)/build/tvos.xcarchive/dSYMs/
setup-tools: install-githook
setup:
pod install
clean:
rm -rf build
pod-install:
pod install --repo-update
open:
open $(PROJECT_NAME).xcworkspace
pod-repo-update:
pod repo update
pod-update: pod-repo-update
pod update
ci-pod-repo-update:
bundle exec pod repo update
ci-pod-install:
bundle exec pod install --repo-update
ci-pod-update: ci-pod-repo-update
bundle exec pod update
ci-archive: ci-pod-update _archive
archive: pod-update _archive
_archive: clean build-ios build-tvos
@echo "######################################################################"
@echo "### Generating iOS and tvOS Frameworks for $(PROJECT_NAME)"
@echo "######################################################################"
xcodebuild -create-xcframework -framework $(IOS_SIMULATOR_ARCHIVE_PATH)$(PROJECT_NAME).framework -debug-symbols $(IOS_SIMULATOR_ARCHIVE_DSYM_PATH)$(PROJECT_NAME).framework.dSYM \
-framework $(TVOS_SIMULATOR_ARCHIVE_PATH)$(PROJECT_NAME).framework -debug-symbols $(TVOS_SIMULATOR_ARCHIVE_DSYM_PATH)$(PROJECT_NAME).framework.dSYM \
-framework $(IOS_ARCHIVE_PATH)$(PROJECT_NAME).framework -debug-symbols $(IOS_ARCHIVE_DSYM_PATH)$(PROJECT_NAME).framework.dSYM \
-framework $(TVOS_ARCHIVE_PATH)$(PROJECT_NAME).framework -debug-symbols $(TVOS_ARCHIVE_DSYM_PATH)$(PROJECT_NAME).framework.dSYM -output ./build/$(PROJECT_NAME).xcframework
build-ios:
@echo "######################################################################"
@echo "### Building iOS archive"
@echo "######################################################################"
xcodebuild archive -workspace $(PROJECT_NAME).xcworkspace -scheme $(SCHEME_NAME_XCFRAMEWORK) -archivePath "./build/ios.xcarchive" -sdk iphoneos -destination="iOS" SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES ADB_SKIP_LINT=YES
xcodebuild archive -workspace $(PROJECT_NAME).xcworkspace -scheme $(SCHEME_NAME_XCFRAMEWORK) -archivePath "./build/ios_simulator.xcarchive" -sdk iphonesimulator -destination="iOS Simulator" SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES ADB_SKIP_LINT=YES
build-tvos:
@echo "######################################################################"
@echo "### Building tvOS archive"
@echo "######################################################################"
xcodebuild archive -workspace $(PROJECT_NAME).xcworkspace -scheme $(SCHEME_NAME_XCFRAMEWORK) -archivePath "./build/tvos.xcarchive" -sdk appletvos -destination="tvOS" SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES ADB_SKIP_LINT=YES
xcodebuild archive -workspace $(PROJECT_NAME).xcworkspace -scheme $(SCHEME_NAME_XCFRAMEWORK) -archivePath "./build/tvos_simulator.xcarchive" -sdk appletvsimulator -destination="tvOS Simulator" SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES ADB_SKIP_LINT=YES
zip:
cd build && zip -r -X $(PROJECT_NAME).xcframework.zip $(PROJECT_NAME).xcframework/
swift package compute-checksum build/$(PROJECT_NAME).xcframework.zip
build-app: setup
@echo "######################################################################"
@echo "### Building $(TEST_APP_IOS_SCHEME)"
@echo "######################################################################"
xcodebuild clean build -workspace $(PROJECT_NAME).xcworkspace -scheme $(TEST_APP_IOS_SCHEME) -destination 'generic/platform=iOS Simulator'
@echo "######################################################################"
@echo "### Building $(TEST_APP_TVOS_SCHEME)"
@echo "######################################################################"
xcodebuild clean build -workspace $(PROJECT_NAME).xcworkspace -scheme $(TEST_APP_TVOS_SCHEME) -destination 'generic/platform=tvOS Simulator'
test: unit-test-ios functional-test-ios unit-test-tvos functional-test-tvos
unit-test-ios:
@echo "######################################################################"
@echo "### Unit Testing iOS"
@echo "######################################################################"
rm -rf build/reports/iosUnitResults.xcresult
xcodebuild test -workspace $(PROJECT_NAME).xcworkspace -scheme "UnitTests" -destination "platform=iOS Simulator,name=iPhone 14" -derivedDataPath build/out -resultBundlePath build/reports/iosUnitResults.xcresult -enableCodeCoverage YES ADB_SKIP_LINT=YES
functional-test-ios:
@echo "######################################################################"
@echo "### Functional Testing iOS"
@echo "######################################################################"
rm -rf build/reports/iosFunctionalResults.xcresult
xcodebuild test -workspace $(PROJECT_NAME).xcworkspace -scheme "FunctionalTests" -destination "platform=iOS Simulator,name=iPhone 14" -derivedDataPath build/out -resultBundlePath build/reports/iosFunctionalResults.xcresult -enableCodeCoverage YES ADB_SKIP_LINT=YES
unit-test-tvos:
@echo "######################################################################"
@echo "### Unit Testing tvOS"
@echo "######################################################################"
rm -rf build/reports/tvosUnitResults.xcresult
xcodebuild test -workspace $(PROJECT_NAME).xcworkspace -scheme "UnitTests" -destination 'platform=tvOS Simulator,name=Apple TV' -derivedDataPath build/out -resultBundlePath build/reports/tvosUnitResults.xcresult -enableCodeCoverage YES ADB_SKIP_LINT=YES
functional-test-tvos:
@echo "######################################################################"
@echo "### Functional Testing tvOS"
@echo "######################################################################"
rm -rf build/reports/tvosFunctionalResults.xcresult
xcodebuild test -workspace $(PROJECT_NAME).xcworkspace -scheme "FunctionalTests" -destination 'platform=tvOS Simulator,name=Apple TV' -derivedDataPath build/out -resultBundlePath build/reports/tvosFunctionalResults.xcresult -enableCodeCoverage YES ADB_SKIP_LINT=YES
# Runs the Edge Network (Konductor) integration tests after installing pod dependencies
# Usage:
# make test-integration-upstream EDGE_ENVIRONMENT=<environment> EDGE_LOCATION_HINT=<location_hint>
# If EDGE_ENVIRONMENT is not specified, test target will use its default value.
.SILENT: test-integration-upstream # Silences Makefile's automatic echo of commands
test-integration-upstream: pod-install; \
rm -rf build/reports/iosIntegrationUpstreamResults.xcresult; \
if [ -z "$$EDGE_ENVIRONMENT" ]; then \
echo ''; \
echo '-------------------------- WARNING -------------------------------'; \
echo 'EDGE_ENVIRONMENT was NOT set; the test will use its default value.'; \
echo '------------------------------------------------------------------'; \
echo ''; \
fi; \
xcodebuild test \
-quiet \
-workspace $(PROJECT_NAME).xcworkspace \
-scheme UpstreamIntegrationTests \
-destination 'platform=iOS Simulator,name=iPhone 14' \
-derivedDataPath build/out \
-resultBundlePath build/reports/iosIntegrationUpstreamResults.xcresult \
-enableCodeCoverage YES \
ADB_SKIP_LINT=YES \
EDGE_ENVIRONMENT=$(EDGE_ENVIRONMENT) \
EDGE_LOCATION_HINT=$(EDGE_LOCATION_HINT)
install-githook:
git config core.hooksPath .githooks
lint-autocorrect:
./Pods/SwiftLint/swiftlint --fix
lint:
./Pods/SwiftLint/swiftlint lint Sources TestApps
# make check-version VERSION=4.0.0
check-version:
sh ./Script/version.sh $(VERSION)
test-SPM-integration:
sh ./Script/test-SPM.sh
test-podspec:
sh ./Script/test-podspec.sh
test-version-update:
sh ./Script/update-versions.sh -n Edge -v 9.9.9