R.swift icon indicating copy to clipboard operation
R.swift copied to clipboard

Proper SPM support for iOS projects

Open narek-sv opened this issue 2 years ago • 2 comments

The new Swift Package Manager (Xcode 13.3 / Swift 5.6) enables extensible build tools and custom command plugins. So now it's possible to make proper integration with SPM for iOS projects. Do you have any plans/raw estimations to implement this?

narek-sv avatar Mar 15 '22 10:03 narek-sv

Hi, I've tried to create SPM custom command for R.swift, but it's not working completely according to R.swift - is using xcodeproj for detecting resources in project. It's time to add possibility in R.swift to take package.swift resources.

My example of build tool plugin:

https://github.com/martinpristas/SPM-Plugins-Example

martinpristas avatar Mar 24 '22 09:03 martinpristas

I'm also wondering if there is anything planned already? We have several former Pods that we're changing to SPM and quite a bunch of them used R.Swift.

marcoboerner avatar Apr 11 '22 09:04 marcoboerner

https://github.com/fthdgn/R.swift.Plugin

I've developed a SPM build plugin for R.swift. It works for my project, however there are some points which I am not sure.

rswift generate command requires many environment variable which provided by Xcode while running on a standart build phase. However, the new system does not provide these environment variables. I set some environment variables, and put empty string to the others.

The other problem is, I cannot use rswift executable zip file from GitHub release directly. Plugin requires an info.json. I put the executable inside Binaries directory.

fthdgn avatar Oct 19 '22 03:10 fthdgn