Closed andeart closed 3 months ago
Oh, this is great! I'm not enough of a Cocoapods expert, so I went with the simplest solution. This is much better. Thanks!
@badlogic Happy to help! And thanks for the approval. Do you have an idea of when we can expect a release containing this update please?
@andeart apologies, had to get a few C++ side fixes in as well. I just released 4.2.32 to pub.dev. Should be live in a few minutes.
Thanks for your contribution!
I appreciate the quick update @badlogic !
Issue: The current .podspec files (for both iOS and macOS) define the
HEADER_SEARCH_PATHS
using__dir__
. There is nothing wrong with this in isolation. On runningpod install
in a Spine-dependent Flutter project, this generates theLocal Podspecs/spine_flutter.podspec.json
file with theHEADER_SEARCH_PATHS
value containing a path specific to that machine/environment. For example, if I ran this locally for a Flutter iOS project, it would result in:This is still harmless in isolation as this file is typically inside a gitignored directory for the Flutter project, and so (in theory) should not matter that it contains values specific to the developer's environment.
However, because of this machine/environment-specific value, the Flutter project's
ios/Podfile.lock
file now contains aspine_flutter
spec-checksum entry that varies per developer/environment. This is an issue on shared Flutter projects because thePodfile.lock
files are usually added to source control.In other words, due to the nature of the current
HEADER_SEARCH_PATHS
assignment, every cloner of the Spine-dependent Flutter repo will end up with a differentspine_flutter
spec-checksum entry in theirios/Podfile.lock
file, leading to source-control hassles or repeated overwrites of the same file without any dependency changes to explain it.Solution: By using the officially defined
PODS_TARGET_SRCROOT
variable from the CocoaPods spec, the generatedspine_flutter.podspec.json
gets generated with aHEADER_SEARCH_PATHS
value that is not specific to that machine/environment, and (importantly) still points to the same location of the expectedspine-cpp
directory within that Flutter project's iOS plugins. Consequently, even after runningpod install
, the spec-checksum of thespine_flutter
entry inios/Podfile.lock
remains constant across machines/environments, as we might expect if the Spine dependency isn't actually being modified.Additional context: I gave this update a test with fresh clones across multiple machines and the checksum value in the
Podfile.lock
files now remains consistent across multiple machines, for both iOS and macOS.Let me know if I missed anything please. Thanks for creating this useful runtime!