代码之家  ›  专栏  ›  技术社区  ›  narner

从Swift包创建Cocoapods框架

  •  0
  • narner  · 技术社区  · 2 年前

    我有一个Swift包,其结构如下:

    enter image description here

    我还需要生成一个通过Cocoapods进行分发的框架。以下是我在以前是Xcode框架项目时用来生成的内容-如果我直接从Swift包构建,我如何为Cocoapods生成框架?

    xcodebuild archive \
        -scheme roboflow-swift \
        -archivePath "archives/roboflow-swift-iOS.xcarchive" \
        -destination "generic/platform=iOS" \
        -sdk iphoneos \
        SKIP_INSTALL=NO \
        BUILD_LIBRARY_FOR_DISTRIBUTION=YES
    
    xcodebuild archive \
        -scheme roboflow-swift \
        -archivePath "archives/roboflow-swift-iOS-simulator.xcarchive" \
        -destination "generic/platform=iOS Simulator" \
        -sdk iphonesimulator \
        SKIP_INSTALL=NO \
        BUILD_LIBRARY_FOR_DISTRIBUTION=YES
    
    xcodebuild -create-xcframework \
        -framework "archives/roboflow-swift-iOS.xcarchive/Products/Library/Frameworks/roboflow-swift.framework" \
        -framework "archives/roboflow-swift-iOS-simulator.xcarchive/Products/Library/Frameworks/roboflow-swift.framework" \
        -output "roboflow-swift.xcframework"
    
    0 回复  |  直到 2 年前