-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
87 lines (63 loc) · 3.13 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
export EXTENSION_NAME = AEPNotificationContent
export APP_NAME = DemoApp
CURRENT_DIRECTORY := ${CURDIR}
PROJECT_NAME = $(EXTENSION_NAME)
TARGET_NAME_XCFRAMEWORK = $(EXTENSION_NAME).xcframework
SCHEME_NAME_XCFRAMEWORK = AEPNotificationContentXCF
SIMULATOR_ARCHIVE_PATH = $(CURRENT_DIRECTORY)/build/ios_simulator.xcarchive/Products/Library/Frameworks/
SIMULATOR_ARCHIVE_DSYM_PATH = $(CURRENT_DIRECTORY)/build/ios_simulator.xcarchive/dSYMs/
IOS_ARCHIVE_PATH = $(CURRENT_DIRECTORY)/build/ios.xcarchive/Products/Library/Frameworks/
IOS_ARCHIVE_DSYM_PATH = $(CURRENT_DIRECTORY)/build/ios.xcarchive/dSYMs/
IOS_DESTINATION = 'platform=iOS Simulator,name=iPhone 15'
setup:
(pod install)
(cd TestApps/$(APP_NAME) && pod install)
setup-tools: install-githook
clean:
(rm -rf build)
build:
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
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
zip:
cd build && zip -r -X $(PROJECT_NAME).xcframework.zip $(PROJECT_NAME).xcframework/
swift package compute-checksum build/$(PROJECT_NAME).xcframework.zip
test: clean unit-test
unit-test:
@echo "######################################################################"
@echo "### Unit Testing"
@echo "######################################################################"
xcodebuild test -workspace $(PROJECT_NAME).xcworkspace -scheme "UnitTests" -destination $(IOS_DESTINATION) -derivedDataPath build/out -resultBundlePath build/$(PROJECT_NAME).xcresult -enableCodeCoverage YES
pod-install:
(pod install --repo-update)
(cd TestApps/$(APP_NAME) && pod install --repo-update)
ci-pod-install:
(bundle exec pod install --repo-update)
(cd TestApps/$(APP_NAME) && bundle exec pod install --repo-update)
archive: pod-install _archive
ci-archive: ci-pod-install _archive
_archive: clean build
xcodebuild -create-xcframework \
-framework $(SIMULATOR_ARCHIVE_PATH)$(EXTENSION_NAME).framework -debug-symbols $(SIMULATOR_ARCHIVE_DSYM_PATH)$(EXTENSION_NAME).framework.dSYM \
-framework $(IOS_ARCHIVE_PATH)$(EXTENSION_NAME).framework -debug-symbols $(IOS_ARCHIVE_DSYM_PATH)$(EXTENSION_NAME).framework.dSYM \
-output ./build/$(TARGET_NAME_XCFRAMEWORK)
format: lint-autocorrect swift-format
check-format:
(swiftformat --lint $(PROJECT_NAME)/Sources --swiftversion 5.1)
install-swiftformat:
(brew install swiftformat)
swift-format:
(swiftformat $(PROJECT_NAME)/Sources --swiftversion 5.1)
lint-autocorrect:
($(CURRENT_DIRECTORY)/Pods/SwiftLint/swiftlint --fix)
lint: swift-lint check-format
swift-lint:
(./Pods/SwiftLint/swiftlint lint $(PROJECT_NAME)/Sources)
check-version:
(sh ./Script/version.sh $(VERSION))
test-SPM-integration:
(sh ./Script/test-SPM.sh)
test-podspec:
(sh ./Script/test-podspec.sh)
# used to test update-versions.sh script locally
test-versions:
(sh ./Script/update-versions.sh -n NotificationContent -v 5.9.9)