Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 5.3 #97

Closed
NiwreRelbag opened this issue Sep 17, 2020 · 13 comments · Fixed by #107
Closed

Swift 5.3 #97

NiwreRelbag opened this issue Sep 17, 2020 · 13 comments · Fixed by #107
Assignees

Comments

@NiwreRelbag
Copy link

Can you compile for XCode 12, Swift 5.3 please.
Thx.

@hm1205
Copy link

hm1205 commented Sep 23, 2020

Hi,
Any update on the subject ? Due to Apple updates of Xcode and timeline of updates, hope a soon update of polar sdk; if not could be annoying to update ours apps.

best regards

@outsbook
Copy link

Any update on this issue?

@hm1205
Copy link

hm1205 commented Oct 1, 2020

Hi, framework build from source as i had an unexpected free time during work time and seems to work ( both branches with or without swiftprotobuf).
i can keep on working on my app, but waiting for polar official release.
best regards

@outsbook
Copy link

outsbook commented Oct 1, 2020

@hm1205 Can you please share the frameworks which you generated for swift 5.3, thanks

@hm1205
Copy link

hm1205 commented Oct 1, 2020

@outsbook better to give you the process I've been true to build

first update Carthage version to latest version

second fix Carthage to work with swift 5.3 and Xcode 12 :

#!/usr/bin/env bash

# carthage.sh
# Usage example: ./carthage.sh build --platform iOS

set -euo pipefail

xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT

# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig

export XCODE_XCCONFIG_FILE="$xcconfig"
carthage "$@"

credit to : rastersize see this post

then rebuild or build Rxswift from Carthage (using previous script) with '--no-use-binaries' ( avoid bitcode error ) and '--platform IOS' as arguments

finally run build script: build_sdk.sh

Hope will work for you. best regards

@outsbook
Copy link

outsbook commented Oct 1, 2020

@hm1205 Thank you very much for your help, it's seems to work

@ymatt345
Copy link

I am waiting for the official update of polar-bye-sdk.
I wish to provide us soon.

@ymatt345
Copy link

Please inform us of your planned update release for Swift5.3.
All of our development efforts are suspended now.
Best regards,

@josephlarralde
Copy link

@hm1205 Thanks ! It seems to work for me too. I just had to copy the generated frameworks from Carthage/Build/iOS/RxSwift.framework and 3rd_party_sdk/PolarBleSdk.framework into polar-sdk-ios and the ios example now builds and runs fine.

@Arwain
Copy link

Arwain commented Nov 4, 2020

@josephlarralde how did you get 3rd_party_sdk? When I run carthage build I get Carthage/Build/iOS/RxSwift.framework and Carthage/Checkouts/polar-ble-sdk/polar-sdk-ios/PolarBleSdk.framework.

@josephlarralde
Copy link

@Arwain to be precise, I ran ./carthage.sh update RxSwift --no-use-binaries --platform iOS, which generated the Carthage/Build/iOS/RxSwift.framework, then I ran ./build_sdk.h which generated the 3rd_party_sdk/PolarBleSdk.framework. But 3rd_party_sdk already existed anyway ... Does that help ?

@Arwain
Copy link

Arwain commented Nov 4, 2020

@josephlarralde thank you for your reply and for breaking this down! I'm with you through the initial steps, however, after I run ./carthage.sh update RxSwift --no-use-binaries --platform iOS I get the RxSwift.framework.

No ./build_sdk.h is generated. I think this is what I'm missing. What/where is this script generated?
zsh: no such file or directory: ./build_sdk.h

@josephlarralde
Copy link

@Arwain are you typing your commands from sources/iOS/ios-communications ?
Because that's where I run both scripts from.
carthage.sh is just @hm1205 's script, and build_sdk.sh (sorry just noticed the .h typo in my previous answer) is already in there.
That's also where the 3rd_party_sdk folder is, in which the new PolarBleSdk.framework will be built.

@JOikarinen JOikarinen self-assigned this Nov 20, 2020
@JOikarinen JOikarinen linked a pull request Nov 20, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants