bielikb / xcframeworks

Demonstration of creating and integrating xcframeworks and their co-op with static libraries and Swift packages
MIT License
536 stars 46 forks source link

Embed XCFramework using Run script phase #6

Closed hrabkin closed 3 years ago

hrabkin commented 3 years ago

I have found the way on how to embed a simple dynamic framework using Run script phase

Do you happen to know how to embed XCFramework using Run script phase?

yurkins commented 3 years ago

@GRyabkin Nice!

bielikb commented 3 years ago

Hi, if you're eg using the fastlane plugin to create the xcframework, you should be fine with

  1. Adding an aggregate target to your project that builds the dynamic framework

    Screenshot 2020-11-02 at 19 56 10
  2. Adding the Run script phase to the aggregated target. Here's an example of the script that

    
    // cd to the project folder.
    cd ${SRCROOT} #  Please note that if `fastlane` folder is not present as a subfolder of this project folder you might want run additional `cd ..` command

// run the lane that builds the xcframework bundle exec fastlane export_xcframework



Let me know if that works. If not, you might want to play with your setup
hrabkin commented 3 years ago

Hey dude, I had the aggregate target before. I wanted to simplify by using fastlane for my CI. Looks like the action doesn't work.

bielikb commented 3 years ago

Can you please clarify what exactly you're trying to achieve? I lack details about your current setup and what's the final goal you try to achieve, so any direction or information would be helpful ;)

hrabkin commented 3 years ago

I want to make your fastlane action to work

hrabkin commented 3 years ago

I want to build xcframework of my SDK by using the fastlane action

hrabkin commented 3 years ago

I have my Bundle name set as $(PRODUCT_NAME) maybe hardcoding this param helps but it's strange that it's not taken into account. Also, look fastlane action xcodebuild has derivedDataPath parameter I am surprised that you recommend me to cd to folder where derived data will be generated

hrabkin commented 3 years ago

Two archives succeded but the error looking into logs happens at combining them I guess

bielikb commented 3 years ago

Im afraid that without the demo project/setup that reproduces your issue I won't be able to help you.

bielikb commented 3 years ago

Have you tried to not use the product name param? Will you get the same result?

hrabkin commented 3 years ago

Forget, I will try to finish it up with fastlane action

hrabkin commented 3 years ago

The question was about embedding xcframework into project, not building it