【问题标题】:Download iOS dependencies from S3 bucket从 S3 存储桶下载 iOS 依赖项
【发布时间】:2022-09-23 08:04:22
【问题描述】:

iOS 依赖项管理器是否支持从 S3 存储桶下载依赖项? 我尝试使用 Carthage,它正在处理公共文件。

我的要求是从不公开的 S3 存储桶下载依赖项。

任何帮助将不胜感激。

    标签: ios amazon-s3 dependency-management carthage


    【解决方案1】:

    最接近您问题的解决方案可能是这种技术:SPM Binary Frameworks,这是它的documentation

        targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages this package depends on.
        .target(
            name: "MyLibrary"
        ),
        .binaryTarget(
            name: "SomeRemoteBinaryPackage",
            url: "https://url/to/some/remote/xcframework.zip",
            checksum: "The checksum of the ZIP archive that contains the XCFramework."
        ),
        .binaryTarget(
            name: "SomeLocalBinaryPackage",
            path: "path/to/some.xcframework"
        )
        .testTarget(
            name: "MyLibraryTests",
            dependencies: ["MyLibrary"]),
        ]
    

    你看到这部分了吗:url: "https://url/to/some/remote/xcframework.zip"? 在 SPM 中,您可以将任何 xcframwork 压缩为 zip 文件并将其托管在任何公开可用的位置。然后 SPM 可以将它们下载为 zip 文件并自动加载其中的xcframework

    当您在服务器上托管二进制文件时,请在其根目录中创建一个包含 XCFramework 的 ZIP 存档并使其公开可用。

    所以根据this answer,我可以看到你可以在S3中生成一个可下载的URL。

    所以,试试这个:build your dependency as an xcframwork -> calculate its checksum -> upload to s3 -> try to generate a downloadable URL in S3

    如果您遇到了一些麻烦,请在下方评论。

    【讨论】:

      猜你喜欢
      • 2016-08-26
      • 1970-01-01
      • 1970-01-01
      • 2014-06-20
      • 2017-05-05
      • 1970-01-01
      • 2021-05-23
      • 2021-09-22
      • 2012-01-29
      相关资源
      最近更新 更多