Skip to content

Commit

Permalink
Manual merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
iosdevzone committed Sep 25, 2016
2 parents 766032e + c8e3c5a commit 3970f9f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions IDZSwiftCommonCrypto.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Pod::Spec.new do |s|
s.author = { "iOSDevZone" => "[email protected]" }
s.social_media_url = "http://twitter.com/iOSDevZone"

s.osx.deployment_target = '10.10'
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.11'
s.ios.deployment_target = '9.3'
s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0'

Expand All @@ -24,13 +24,15 @@ Pod::Spec.new do |s|
echo 'Running prepare_command'
pwd
echo Running GenerateCommonCryptoModule
swift ./GenerateCommonCryptoModule.swift macosx .
swift ./GenerateCommonCryptoModule.swift iphonesimulator .
swift ./GenerateCommonCryptoModule.swift iphoneos .
swift ./GenerateCommonCryptoModule.swift appletvsimulator .
swift ./GenerateCommonCryptoModule.swift appletvos .
swift ./GenerateCommonCryptoModule.swift watchsimulator .
swift ./GenerateCommonCryptoModule.swift watchos .
TC="--toolchain com.apple.dt.toolchain.Swift_2_3"
SWIFT="xcrun $TC swift"
$SWIFT ./GenerateCommonCryptoModule.swift macosx .
$SWIFT ./GenerateCommonCryptoModule.swift iphonesimulator .
$SWIFT ./GenerateCommonCryptoModule.swift iphoneos .
$SWIFT ./GenerateCommonCryptoModule.swift appletvsimulator .
$SWIFT ./GenerateCommonCryptoModule.swift appletvos .
$SWIFT ./GenerateCommonCryptoModule.swift watchsimulator .
$SWIFT ./GenerateCommonCryptoModule.swift watchos .
CMD

Expand Down

4 comments on commit 3970f9f

@rchatham
Copy link

@rchatham rchatham commented on 3970f9f Oct 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the significance of specifying the toolchain here? line 27

@iosdevzone
Copy link
Owner Author

@iosdevzone iosdevzone commented on 3970f9f Oct 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's there to make sure that Xcode uses the correct toolchain to run the GenerateCommonCryptoModule.swift script. It was needed prior in 0.8.x because the GenerateCommonCryptoModule.swift script was in Swift 2.3 syntax (so Xcode 8.x would fail). Since this script has been updated it should be changed to Swift 3.0. You could argue that it could be removed completely, but it is safer to leave it there in case Swift 4.0 changes anything.

@iosdevzone
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I see what happened here. The podspec checked in with CocoaPods has line 27 commented out (so there is an inconsistency between what's in the repo and the CocoaPods trunk). There is no reliable way of specifying Swift 3.0 explicitly (the options are com.apple.dt.toolchain.Swift_2_3 for Swift 2.3 or com.apple.dt.toolchain.XcodeDefault). Specifying default is the same as omitting it and neither approach will protect against Swift 4.0 breaking things. I'll update the podspec in the repo and it should match what's checked in with CocoaPods from now on.

Thanks for spotting this. In a few months time, when this has all faded from my memory a bit, it might have been tricky to find that error!

@rchatham
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to help! The script and .podspec are super helpful for dealing with the CommonCrypto trickery!

Please sign in to comment.