Skip to content

Commit 9e1a4f5

Browse files
committed
Merge branch '24-build-xcframework-instead-of-carthage-archive' into 'master'
Resolve "Build xcframework instead of Carthage archive" Closes #24 See merge request pace/mobile/ios/pace-cloud-sdk!41
2 parents b2c4815 + eb0b793 commit 9e1a4f5

File tree

4 files changed

+67
-38
lines changed

4 files changed

+67
-38
lines changed

.gitlab-ci.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,17 @@ stages:
1414
- publish
1515

1616
before_script:
17-
- eval $(ssh-agent)
18-
- ssh-add -D
1917
- mkdir -p Carthage/Build && rsync -a ~/CarthageCache-PACECloudSDK/Build/ Carthage/Build > /dev/null 2>&1 || echo "CarthageCache not found"
20-
- mkdir -p ~/.ssh
21-
- touch ~/.ssh/known_hosts
22-
- ssh-keygen -F repo.pacelink.net > /dev/null || ssh-keyscan repo.pacelink.net >> ~/.ssh/known_hosts
23-
- ssh-keygen -F docs.pacelink.net > /dev/null || ssh-keyscan docs.pacelink.net >> ~/.ssh/known_hosts
24-
- ssh-keygen -F lab.jamit.de > /dev/null || ssh-keyscan lab.jamit.de >> ~/.ssh/known_hosts
25-
- ssh-add || true # Add default key to SSH agent (deploy keys)
26-
- rm -f tmpfile && echo "$SSH_PRIVATE_KEY_DEPLOYS" >tmpfile && chmod 600 tmpfile && ssh-add tmpfile && rm -f tmpfile
27-
- ssh-add -l
18+
- carthage bootstrap --platform iOS --no-use-binaries --cache-builds
2819
- bundle install || true
2920
- export TAG_COMMIT_TIME=$(git show -s --format=%ct $CI_COMMIT_SHA)
3021
- echo "Commit time to be used as build number:" $TAG_COMMIT_TIME
3122
- export BUILD_NUMBER=$(TZ=Etc/Utc date -j -f '%s' ${TAG_COMMIT_TIME} "+%Y%m%d%H")
3223
- export VERSION_NAME=$(TZ=Etc/Utc date -j -f '%s' ${TAG_COMMIT_TIME} "+%y.%V.%u")
3324
- echo "Building version $VERSION_NAME with build number $BUILD_NUMBER"
3425
- export XCODE_XCCONFIG_FILE=$PWD/linkerFix.xcconfig
26+
- export TAG_NAME=${CI_COMMIT_TAG:-'2.0.0'}
27+
- echo "Current tag version $TAG_NAME"
3528

3629
after_script:
3730
- mkdir -p ~/CarthageCache-PACECloudSDK/Build && rsync -a Carthage/Build/ ~/CarthageCache-PACECloudSDK/Build > /dev/null 2>&1 || echo "Couldn't copy Carthage"
@@ -86,6 +79,23 @@ after_script:
8679
refs:
8780
- merge_requests
8881

82+
.xcframework: &xcframework
83+
script:
84+
- bundle exec fastlane set_version version_number:$TAG_NAME
85+
- xcodebuild archive
86+
-scheme $PROJECT_NAME
87+
-sdk iphoneos
88+
-archivePath "archives/ios_devices.xcarchive" BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO
89+
- xcodebuild archive
90+
-scheme $PROJECT_NAME
91+
-sdk iphonesimulator
92+
-archivePath "archives/ios_simulators.xcarchive" BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO
93+
- xcodebuild
94+
-create-xcframework
95+
-framework archives/ios_devices.xcarchive/Products/Library/Frameworks/$PROJECT_NAME.framework
96+
-framework archives/ios_simulators.xcarchive/Products/Library/Frameworks/$PROJECT_NAME.framework
97+
-output build/${PROJECT_NAME}_${TAG_NAME}.xcframework
98+
8999
pacecloudsdk_plists:
90100
extends: .plist
91101

@@ -103,23 +113,20 @@ pacecloudsdk_unit_tests:
103113
framework_review:
104114
extends: .xcode_version
105115
stage: build
106-
script:
107-
- bundle exec fastlane build_framework
116+
<<: *xcframework
108117
only:
109-
refs:
110-
- merge_requests
118+
- merge_requests
111119

112120
framework_release_build:
113121
extends: .xcode_version
114122
stage: build
115-
script:
116-
- bundle exec fastlane build_framework archive:true
123+
<<: *xcframework
117124
only:
118125
- tags
119126
artifacts:
120127
name: $PROJECT_NAME
121128
paths:
122-
- ./PACECloudSDK.framework.zip
129+
- ./build/
123130
expire_in: 1 week
124131

125132
# Documentation

ExampleApp/.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@ pacecloudsdkexample_stop_review:
118118
extends: .stop_review
119119
<<: *only_merge_requests
120120
variables:
121-
REPO_PROJECT_ID: "pacecloudsdkexample"
121+
REPO_PROJECT_ID: "pacecloudsdkexample"

README.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
# PACE Cloud SDK
2-
This framework combines multipe functionalities provided by PACE i.e. authorizing via **PACE ID** or requesting and displaying **Apps**. These functionalities are separated and structured into different ***Kits*** by namespacing as follows:
32

4-
- [IDKit](#idkit)
5-
- [AppKit](#appkit)
3+
This framework combines multipe functionalities provided by PACE i.e. authorizing via **PACE ID** or requesting and displaying **Apps**. These functionalities are separated and structured into different ***Kits*** by namespaces, i.e. [IDKit](#idkit), [AppKit](#appkit).
4+
5+
- [PACE Cloud SDK](#pace-cloud-sdk)
6+
* [Specifications](#specifications)
7+
* [Setup](#setup)
8+
+ [Carthage](#carthage)
9+
+ [Cocoapods](#cocoapods)
10+
+ [Swift Package Manager](#swift-package-manager)
11+
* [IDKit](#idkit)
12+
+ [Setup](#setup-1)
13+
+ [Authorization](#authorization)
14+
+ [Token refresh](#token-refresh)
15+
+ [Session refreshToken](#session-refreshtoken)
16+
* [AppKit](#appkit)
17+
+ [Main Features](#main-features)
18+
+ [Setup](#setup-2)
19+
+ [Native login](#native-login)
20+
+ [Deep Linking](#deep-linking)
21+
+ [AppKitDelegate](#appkitdelegate)
22+
+ [Requesting local Apps](#requesting-local-apps)
23+
+ [Is POI in range?](#is-poi-in-range-)
24+
+ [AppWebView / AppViewController](#appwebview---appviewcontroller)
25+
+ [AppDrawerContainer](#appdrawercontainer)
26+
+ [AppDrawer](#appdrawer)
27+
+ [AppError](#apperror)
28+
* [FAQ](#faq)
629

730
## Specifications
831
**PACECloudSDK** currently supports iOS 11 and above.
@@ -100,6 +123,8 @@ Available parameters:
100123
configValues: [ConfigValue: Any]? // Default: nil
101124
```
102125

126+
Biometry is used for 2FA during the payment process, thus make sure that `NSFaceIDUsageDescription` is correctly set in your target properties.
127+
103128
### Native login
104129
You can use *AppKit* with your native login (given that your token has the necessary scopes) as well. In case of a native login,
105130
it is crucial that you set the configuration during setup accordingly, i.e. setting the `authenticationMode` to `.native`,
@@ -204,3 +229,13 @@ Possible errors:
204229
- `badRequest`: The request does not match the expected format
205230
- `invalidURNFormat`: The passed POI reference value does not conform to our URN format
206231
- `customURLSchemeNotSet`: The App tried to open an URL in `SFSafariViewController`, but deep linking has not been correctly configured
232+
233+
## FAQ
234+
235+
<details>
236+
<summary>
237+
Error "Failed to build module 'PACECloudSDK' from its module interface; the compiler that produced it may have used features that aren't supported by this compiler"
238+
</summary>
239+
240+
Make sure that all dependencies mentioned in [specifications](#specifications) have been included and set to `Embed & Sign`.
241+
</details>

fastlane/Fastfile

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,6 @@ platform :ios do
55
carthage(command: 'bootstrap', cache_builds: true, platform: 'iOS', use_binaries: false)
66
end
77

8-
lane :build_framework do |options|
9-
carthage(
10-
command: 'build',
11-
no_skip_current: true,
12-
cache_builds: true,
13-
platform: 'iOS'
14-
)
15-
16-
if options[:archive]
17-
carthage(
18-
frameworks: ['PACECloudSDK'],
19-
output: 'PACECloudSDK.framework.zip',
20-
command: 'archive'
21-
)
22-
end
23-
end
24-
258
desc 'Run tests'
269
lane :test do
2710
scan(
@@ -33,4 +16,8 @@ platform :ios do
3316
reinstall_app: true
3417
)
3518
end
19+
20+
lane :set_version do |options|
21+
set_info_plist_value(path: 'PACECloudSDK/Info.plist', key: 'CFBundleShortVersionString', value: options[:version_number])
22+
end
3623
end

0 commit comments

Comments
 (0)