-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
71 lines (61 loc) · 4.9 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
SHELL = /bin/sh
# --args:
# diAccessLevel - access level of the dependency injection graph. If module is used by another module (like Cio) then you want `public`. Else, `internal`.
# moduleName - the name of the module that you are generating code for.
# imports - Import statements to be at the top of the generated files in case the file needs classes from other modules. Split by `-` (example: `imports=Cio-Foo-Bar`)
generate:
./binny sourcery --sources Sources/Common --templates Sources/Templates --output Sources/Common/autogenerated
./binny sourcery --sources Sources/DataPipeline --templates Sources/Templates --output Sources/DataPipeline/autogenerated --args imports=CioInternalCommon
./binny sourcery --sources Sources/MessagingPush --templates Sources/Templates --output Sources/MessagingPush/autogenerated --args imports=CioInternalCommon
./binny sourcery --sources Sources/MessagingPushAPN --templates Sources/Templates --output Sources/MessagingPushAPN/autogenerated --args imports=CioMessagingPush-CioInternalCommon
./binny sourcery --sources Sources/MessagingPushFCM --templates Sources/Templates --output Sources/MessagingPushFCM/autogenerated --args imports=CioMessagingPush-CioInternalCommon
./binny sourcery --sources Sources/MessagingInApp --templates Sources/Templates --output Sources/MessagingInApp/autogenerated --args imports=CioInternalCommon-UIKit
./binny sourcery --sources Sources/Migration --templates Sources/Templates --output Sources/Migration/autogenerated --args imports=CioInternalCommon
lint:
./binny swiftlint lint --strict
# specify swiftversion this way instead of .swift-version to (1) keep project files slim and (2) we can specify the version in a CI server matrix for multiple version testing.
# use the min Swift version that we support/test against.
format:
./binny swiftformat . --swiftversion 5.3 && ./binny swiftlint lint --fix
# Check what code has not yet had documentation written for it.
# Jazzy is a great tool that generates docs, yes, but also tells you what public facing code is missing docs.
# This command will simply show you the output of the undocumented code of jazzy. It's not the most human-readable but it will do for now.
check-undocumented:
jazzy --module CioDataPipelines --swift-build-tool spm --output /tmp/CioDataPipelinesDocs > /dev/null 2>&1 && cat /tmp/CioDataPipelinesDocs/undocumented.json
jazzy --module CioMessagingPush --swift-build-tool spm --output /tmp/CioMessagingPushDocs > /dev/null 2>&1 && cat /tmp/CioMessagingPushDocs/undocumented.json
# generates code reference docs for project
doc:
jazzy --module CioDataPipelines --output /tmp/CioDataPipelinesDocs
jazzy --module CioMessagingPushAPN --output /tmp/CioMessagingPushAPNDocs
jazzy --module CioMessagingPushFCM --output /tmp/CioMessagingPushFCMDocs
jazzy --module CioMessagingInApp --output /tmp/CioMessagingInApp
# generates code reference docs with all modules *combined* together.
doc_combined:
mkdir -p .build/sourcekitten/
sourcekitten doc --module-name CioDataPipelines -- -scheme Customer.io-Package -destination 'platform=iOS Simulator,name=iPhone 8' > .build/sourcekitten/DataPipelines.json
sourcekitten doc --module-name CioMessagingPushAPN -- -scheme Customer.io-Package -destination 'platform=iOS Simulator,name=iPhone 8' > .build/sourcekitten/MessagingPushAPN.json
sourcekitten doc --module-name CioMessagingPushFCM -- -scheme Customer.io-Package -destination 'platform=iOS Simulator,name=iPhone 8' > .build/sourcekitten/MessagingPushFCM.json
sourcekitten doc --module-name CioMessagingInApp -- -scheme Customer.io-Package -destination 'platform=iOS Simulator,name=iPhone 8' > .build/sourcekitten/MessagingInApp.json
jazzy --title "Customer.io iOS SDK" --sourcekitten-sourcefile .build/sourcekitten/MessagingInApp.json,.build/sourcekitten/MessagingPushAPN.json,.build/sourcekitten/MessagingPushFCM.json,.build/sourcekitten/DataPipelines.json, --output /tmp/foodocs
# Setup a sample app for you to then compile.
#
# How to use:
# make setup_sample_app app=CocoaPods-FCM
setup_sample_app:
cp "Apps/$(app)/BuildEnvironment.sample.swift" "Apps/$(app)/BuildEnvironment.swift" || true
echo "⚠️ Enter the Customer.io workspace settings into Apps/$(app)/BuildEnvironment.swift ⚠️"
# Update cocoapods dependencies and update Podfile.lock lockfile with new versions.
# This is meant to be used during development to update Customer.io SDK or other dependencies.
# CI server should use install and not update.
#
# How to use:
# make update_cocoapods_dependencies app=CocoaPods-FCM
update_cocoapods_dependencies:
pod update --project-directory=Apps/$(app) || true
# Install cocoapods dependencies with versions from lockfile (Podfile.lock)
# This is meant to be used by the CI server and after you pull code from github during development.
#
# How to use:
# make install_cocoapods_dependencies app=CocoaPods-FCM
install_cocoapods_dependencies:
pod install --project-directory=Apps/$(app) || true