Download iOS dependencies from S3 bucket

321 views Asked by At

Is there iOS dependency manager support to download dependencies from the S3 bucket? I tried to use Carthage, it's working with public files.

My requirement is to download dependency from S3 bucket which is not public.

Any help will be appreciated.

1

There are 1 answers

4
kakaiikaka On

The closest solution to your question may be this tech: SPM Binary Frameworks, this is the documentation to it.

    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"]),
    ]

Did you see this part: url: "https://url/to/some/remote/xcframework.zip"? In SPM, you can compress any xcframwork as a zip file and host it in any publicly available location. Then SPM can download them as zip file and automatically load the xcframework inside it.

When you host the binaries on a server, create a ZIP archive with the XCFramework in its root directory and make it available publicly.

So according to this answer, I can see you can generate a downloadable URL in S3.

So, try this: build your dependency as an xcframwork -> calculate its checksum -> upload to s3 -> try to generate a downloadable URL in S3.

Comment below if you have met some troubles.