Hi everyone,
I have been doing some research regarding some families of methods within our codebase. I've been using function body macros as a very effective method to bulk change these methods and perform experimentation. At some point in the future, it's possible these macros might reach a state whereby we would like to finalise them as the new method version and ship releases. However, at this time we would want to stop expanding the macros and instead replace the previous implementation with the version expanded from the macro.
As far as I can see, there is no obvious supported method for performing this translation. Am I correct in thinking this? If so, I'd be interested to hear through what methods it might be possible to actually do this. I can think of the following:
- Some utility created using Swift-syntax externally to the project, which then operates on the codebase, possibly as text
- Some very manual method of simply transforming the expanded versions output from the macro and replacing the original source code
In any case, can anyone advise on this?
Thanks in advance