Closed macblazer closed 3 years ago
Sorry for the long delay but to get this done I had to learn more about Swift Package Manager, XCFrameworks, and a bunch of other stuff, all of which I wasn't really looking forward to.
That said, I have now pushed the first release that does support Swift Package Manager. It still has a v in it's tag but that should be okay. I suspect you saw the issue because no tagged version of OCMock had a Package.swift
file. Please try and let me know whether it works now.
In the meantime I've tried this, and I can confirm that Swift Package Manager can find OCMock by version, even when the version is tagged with a v. So, I'm going to close this issue.
Unfortunately, there is another issue left, which I will comment on in #500.
There is now some potential support in
master
for pulling in OCMock via the Swift Package Manager. However, the version tags used by OCMock that are prefixed with av
such as the most recentv3.8.1
do not work with SPM's current versioning engine.Request
Drop the
v
from the release tags in the next and all future versions of OCMock so that it can fully work with CocoaPods, Carthage, and Swift Package Manager. Future version numbers will look like3.8.2
,3.9.0
, etc.Reasoning
Attempting to pull in OCMock via SPM within Xcode results in an error stating that "https://github.com/erikdoe/ocmock.git has no Package.swift manifest for version 3.8.1" (screenshot below). This indicates that Xcode is pulling the
v
off the front of the tags which is semi-helpful, but it still does not allow the package to be used.When attempting to pull in OCMock via SPM within a Package.swift file, the output of
swift test
is:Here is the Package.swift file:
Output of
swift --version
:Output of
xcodebuild -version
:Workaround
Specifying a branch or revision of the OCMock repository as a SPM dependency does work.
Using the branch specification will always pull the head of the branch which will pull in breaking changes on major version updates. Using the revision specification pulls in that one specific revision and needs to be manually updated to a new revision on a regular basis.