Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WWDC Recap - Binary Framework in Swift

WWDC Recap - Binary Framework in Swift

Binary Framework in Swift
- ABI Stability
- Module Stability
- XCFramework
- Swift Package Manager

Kishikawa Katsumi

June 17, 2019
Tweet

More Decks by Kishikawa Katsumi

Other Decks in Programming

Transcript

  1. Binary Framework in Swift • ABI Stability • Module Stability

    • XCFramework • Swift Package Manager
  2. Swift Module Interfaces // swift-interface-format-version: 1.0 // swift-tools-version: Apple Swift

    version 5.1 effective-4.2 (swiftlang-1100.0.38.29 clang-1100.0.20.14) // swift-module-flags: -target x86_64-apple-ios12.1-simulator -enable-objc-interop -enable-library-evolution -swift-version 4.2 -enforce-exclusivity=checked -Onone -module-name A @_exported import A import Foundation import Swift public struct A { public init() public func f() }
  3. XCFramework xcodebuild archive \ -scheme KeychainAccess \ -destination 'generic/platform=iOS' \

    -destination 'generic/platform=iOS Simulator' \ -destination 'generic/platform=watchOS' \ -destination 'generic/platform=watchOS Simulator' \ -destination 'generic/platform=tvOS' \ -destination 'generic/platform=tvOS Simulator' \ -destination 'platform=OS X,arch=x86_64' \ SKIP_INSTALL=NO
  4. xcodebuild archive \ -scheme KeychainAccess \ -destination 'generic/platform=iOS' \ -archivePath

    ./KeychainAccess-iOS \ SKIP_INSTALL=NO xcodebuild archive \ -scheme KeychainAccess \ -destination 'generic/platform=iOS Simulator' \ -archivePath ./KeychainAccess-iOS-Simulator \ SKIP_INSTALL=NO xcodebuild archive \ -scheme KeychainAccess \ -destination 'generic/platform=watchOS' \ -archivePath ./KeychainAccess-watchOS \ SKIP_INSTALL=NO ...
  5. xcodebuild -create-xcframework \ -framework ./KeychainAccess-iOS.xcarchive/Products/Library/Frameworks/KeychainAccess.framework \ -framework ./KeychainAccess-iOS-Simulator.xcarchive/Products/Library/Frameworks/KeychainAccess.framework \ -framework

    ./KeychainAccess-watchOS.xcarchive/Products/Library/Frameworks/KeychainAccess.framework \ -framework ./KeychainAccess-watchOS-Simulator.xcarchive/Products/Library/Frameworks/KeychainAccess.framework \ -framework ./KeychainAccess-tvOS.xcarchive/Products/Library/Frameworks/KeychainAccess.framework \ -framework ./KeychainAccess-tvOS-Simulator.xcarchive/Products/Library/Frameworks/KeychainAccess.framework \ -framework ./KeychainAccess-macOS.xcarchive/Products/Library/Frameworks/KeychainAccess.framework \ -output KeychainAccess.xcframework XCFramework
  6. SPM & XCFramework • OSSϥΠϒϥϦʹ͓͍ͯ͸SPMͰಋೖ͢Δ΄͏͕ϝϦοτ͕ଟ͍ • ґଘղܾ • όʔδϣϯ؅ཧ •

    Package.swiftΛஔ͚ͩ͘ • XCFramework͸౰໘ϕϯμʔϥΠϒϥϦʹ࢖ΘΕΔͷͰ͸