aws-amplify / amplify-swift

A declarative library for application development using cloud services.
Apache License 2.0
436 stars 192 forks source link

Publish a Carthage-compatible xcframework #3493

Open blimmer opened 5 months ago

blimmer commented 5 months ago

Is your feature request related to a problem? Please describe.

We use fastlane to build our application on a CircleCI macos.m1.large.gen1 executor. Compiling the amplify-swift package alone with a cold cache takes around 3 minutes 40 seconds.

Caching SPM packages is challenging because the built packages are stored in the DerivedData folder, and developing a reliable cache-busting technique is not straightforward.

Describe the solution you'd like

If this package provided a prebuilt xcframework, we could use a tool like Carthage to pull the prebuilt framework instead of building it ourselves.

Another project in your GitHub organization, https://github.com/aws-amplify/aws-sdk-ios, already publishes a Carthage-compatible xcframework file to each Github Release (e.g., https://github.com/aws-amplify/aws-sdk-ios/releases/tag/2.33.8):

Screenshot_2024-02-02_at_08_54_11

Following a similar process for this package would significantly improve our user experience by reducing compile times.

Describe alternatives you've considered

I have tried using Carthage to produce an archive, but have run into problems.

# Cartfile
github "aws-amplify/amplify-swift" ~>2.25.3

But when I run carthage update, I receive a build-time error:

/Users/blimmer/MY_REPO/Carthage/Checkouts/amplify-swift/AmplifyTools/AmplifyXcode/AmplifyXcode.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 17.2.99. (in target 'ProjectSpec' from project 'AmplifyXcode')

I'm not a seasoned iOS developer, so I'm not sure how/if I could work around this issue. A Github Code Search for people using Carthage with this package makes me think that others have not been able to make this work either. To be clear, I'm not looking for support on Carthage in this forum, I'm just providing context on what other steps I've tried.

Is the feature request related to any of the existing Amplify categories?

No response

Additional context

@phantumcode mentioned in https://github.com/aws-amplify/amplify-swift/issues/3015#issuecomment-1607996447 that xcframeworks was not a viable distribution method for this repository. However, since a related project, the AWS SDK for iOS has implemented this behavior since 2021 (see https://github.com/aws-amplify/aws-sdk-ios/issues/3348#issuecomment-770096569), I wanted to bring this up again for discussion.

github-actions[bot] commented 5 months ago

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

thisisabhash commented 5 months ago

Thank you for posting this. Our team will discuss and post updates here.