Garrison Henkle
12/06/2023, 5:19 PMPablichjenkov
12/06/2023, 8:36 PMGarrison Henkle
12/06/2023, 9:40 PMAnonymike
12/13/2023, 3:19 PMGarrison Henkle
12/13/2023, 4:34 PMGarrison Henkle
12/13/2023, 4:56 PMpodInstallSyntheticIos
task:
a. Add SPM support by including the custom ruby file from the SPM dev at the top of the synthetic podfile
b. copy over a dummy pbxproj file (the Cocoapods plugin also does this)
c. run pod install on the synthetic podfile
d. copy over a dummy xcworkspace that has support for a non-legacy build location enabled. SPM cannot use the legacy build location, and I couldn’t find another way to enable it (although that doesn’t mean there isn’t another way, I’m not an iOS dev)
2. Override the podSetupBuild
tasks:
a. Run the xcodebuild --showBuildSettings
command and write the results using the Cocoapod plugin’s class. This allows the rest of the Cocoapods plugin’s tasks to successfully run
b. I honestly don’t remember why I overrode this, so it might be unnecessary. I may have changed the -project flag in the xcodebuild command
The above basically gets SPM to automatically install on the synthetic pods project and allows the module to build successfully whenever the cocoapods plugin generates the .def files for the project. The problem is after that when you try to get the actual iOS app to build. It is unable to link the SPM dependencies of the cocoapod, and adding the SPM dependencies to the iosApp itself causes duplicate modules so it fails either way. If there was a way to do what the Kotlin Cocoapods plugin does and “linkOnly” the SPM packages in iosApp, I think everything would work.
I updated by gist with a few more things that might be useful. I can’t give my repo unfortunately, but I think I copied everything important over and censored all my work stuff :)Anonymike
12/13/2023, 9:25 PM