2

I am using this fastlane plugin to get and bump my project version and/or build number. However, when I use it all the file references to SPM dependencies in my project.pbxproj change automatically so that labels that are specific to the package change to things like SwiftPackageProductDependency, RemoteSwiftPackageReference, and BuildFile.

On its own this is not such a big deal since these are just comments (nice to have but not really that important), but these revert back anytime anyone makes a change to the project (e.g. adding, removing, or moving a file in the project). This results in extra changes to discard in git, which is annoying since you have to find the lines in the project file with the changes you want in the middle of a bunch of other changes.

e.g. this:

B21693D8256DC06F00F98045 /* FirebaseMessaging in Frameworks */,
B21693E6256DC0F100F98045 /* FirebaseFirestore in Frameworks */,
B21693A4256DBFB500F98045 /* Segment in Frameworks */,
B2CC9E5325647C8D00AC7158 /* Sentry in Frameworks */,

is converted to:

B21693D8256DC06F00F98045 /* BuildFile in Frameworks */,
B21693E6256DC0F100F98045 /* BuildFile in Frameworks */,
B21693A4256DBFB500F98045 /* BuildFile in Frameworks */,
B2CC9E5325647C8D00AC7158 /* BuildFile in Frameworks */,

and many other similar changes throughout the project file. And these changes revert whenever the project file is modified in Xcode. Note this happens every time I call the methods in the fastlane plugin and the changes revert back every time the project file changes subsequently.

Is there any way to prevent this from happening in the first place or to mitigate it by regenerating the project file from the command line similar to whatever happens when you make changes to the project in the Xcode GUI so the changes are cancelled out? I don't want to have to e.g. add and remove a file in Xcode manually every time I run my fastlane lane.

A similar issue was posted on StackOverflow with SwiftLint, but it has no answers posted. I also created an issue on the repo for the fastlane plugin, but I doubt the issue is caused by the plugin directly and I haven't gotten a response anyway. I've also posted this same question on the Swift Forum but I haven't gotten a response there either.

I tried xcodebuild -resolvePackageDependencies but it doesn't have any effect on these changes.

I tried swift package generate-xcodeproj but I got the error:

error: root manifest not found

I was looking at plugins that would let me modify the project from the command line, but adding another dependency just for a hack like this is not ideal, plus I don't even know if I will be able to get it working.

shim
  • 9,289
  • 12
  • 69
  • 108
  • There has been some activity in the issue I created for this on the plugin's repo, apparently this is caused by another library (Xcodeproj) and is already resolved in that https://github.com/SiarheiFedartsou/fastlane-plugin-versioning/issues/59 — still waiting for a fix but this can safely be closed for now. – shim Mar 11 '21 at 20:56
  • I’m voting to close this question because problem seems to be resolvable by updating dependencies (https://github.com/SiarheiFedartsou/fastlane-plugin-versioning/issues/59) – shim Mar 11 '21 at 20:57

0 Answers0